oDataTable.WriteToWeb "http://ComputerName/ComponentId/data.xml", sParam
The URL address of the data Web server where the XML data have to be sent. The PROMOTIC application as the Web server offers the data by default on the path (see the PmDataTable > Web Server page):
Caution! Head of the address ("http:") must be entered! If you want to enter the address of the local computer, it is possible to enter the localhost word as the ComputerName. The Port needn't be entered if the Web server is on the standard port 80.
|sParam||(String) Additional parameters of the transfer. It is the text in the form, for example: "fmt:purevalue;user:NAME1;psw:PASSWORD1;".|
fmt (mandatory) - Named format of the sent XML data. The PROMOTIC system in the meantime offers only the "purevalue" format.
user - Name of the user for the authentication. See the WebWrite permission on the server side. If this parameter is missing and the site requires the authentication, then the onEndOfTransfer event fires with the error pEvent.Error=40.
psw - Password of the user for the authentication. This parameter is ignored if the user parameter is missing.
By calling the WriteToWeb method over the object, this object is regarded as the Web client that writes to the component of the Web server, in this case to another but the same configured PmDataTable object in another application on the same or another computer.
The method only activates the data transfer but there is no assurance that the data are already transferred after the completion of this method. The data transfer termination is announced by the onEndOfTransfer event. During the data transfer (i.e. in the time after calling the WriteToWeb method and before the onEndOfTransfer event fires) neither the WriteToWeb method nor the ReadFromWeb method can be called over the object again - then the method returns the false value. Using the WebClientIsReady property it can be found out if the object is ready for the next transfer.
oData.WriteToWeb "http://localhost/temperatures/data.xml", "fmt:purevalue;user:oper;psw:ABCD"