ReadFromWeb - method of object PmDataTable

Reading data from Web server in the XML format into this object
ReadFromWeb(URL As String, sParam As String) As Boolean
b = oDataTable.ReadFromWeb("http://ComputerName/ComponentId/data.xml?fmt=purevalue", sParam)
URL(String) The URL address of the data Web server where the XML data are stored. 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, then 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.

The communication also works on secured WEB server on address https://....

sParam(String) Additional parameters of the transfer. It is the text in the form, for example "user:NAME1;psw:PASSWORD1;". If no parameter is needed, then an empty string "" can be entered.
user - User name for the authentication. See the WebRead permission on the server side. If not set and the site requires the authentication, then the onEndOfTransfer event fires with the error pEvent.Error=62.
psw - Password of the user for the authentication. This parameter is ignored if the user parameter is missing.
Return Values:
true - The method successfully queued the request for reading data from the server. After data transfer the onEndOfTransfer event will be fired.
false - The method hasn't queued the request for reading data. Probably the previous request about sending/receiving of this object hasn't been finished yet. The onEndOfTransfer event is not fired.

This method is not functional for PmFree.

By calling the ReadFromWeb method over the object, this object is regarded as the Web client that reads data from the component of the Web server, in this case from 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 data are already transferred after ending this method. The data transfer termination is announced by the event onEndOfTransfer. During the data transfer (i.e. in the time after calling the ReadFromWeb method and before the onEndOfTransfer event fires) neither the ReadFromWeb method nor the WriteToWeb 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.

The client cannot change the data amount assigned to him by the ReadFromWeb method - for example, by reading more data than it is configured. If this is requested, then the client itself has to make this change first - see the description in the chapter XML data sharing.
"Read only" columns: Each cell is empty at the beginning. The cell is considered empty also if it contains numeric value 0 or an emty string "". New value can be written into such cell. After writing a non-zero value into the "Read only" column the cell is "locked". "Locked cell" becomes a constant and cannot be written again. Other still "unlocked" cells can be written into as needed. Methods that write into multiple cells simultaneously will write the values only into "unlocked cells" while the content of "locked" cells remains unchanged.
VBScriptSelect and copy to clipboard

Dim oData
Set oData = pMe.Pm("Data/Param1")
If oData.WebClientIsReady Then
  oData.ReadFromWeb "http://localhost/param/data.xml?fmt=purevalue", "user:oper;psw:ABCD;"
  Pm.Debug "Web client PARAM is not ready (is still active)"
End If
PROMOTIC 8.3.29 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice