Update cookies preferences
Promotic

Read - method of the PmaOpcDaClientGroup object

Description:
Reading the selected block from the data group (defined on the "Data" tab) from the OPC server.
Syntax:
Boolean Read(Long Attr, Long From, Long To)
Parameters:
Attr(Long) The sum of following values specifies the transfer method: (see OPC DA Basic terms)
1 - The data from the DEVICE, otherwise from the CACHE. If DEVICE is entered, then Read method will surely execute communication with the device. Therefore it can be slower then reading from CACHE, but it is for sure that the most recent values were read.
2 - Synchronous access, otherwise asynchronous. The synchronous access comes handy if immediately after calling the Read method it is needed to have the read data set on the "Data" tab. The main disadvantage is that Read method can take longer time (because of waiting for data receive) slowing down the whole application.
The asynchronous access the transmission impulse is done, but the data can be received later, therefore immediately after terminating Read method the data may not be set yet.
From(Long) Index of the first value (zero-based index).
To(Long) Index of the last value (zero-based index). -1 = to the end.
Return value:
true - on success
false - on error
Note:
Calling the method oClientData.Read 0,0,-1 is identical to the Refresh method. For reading all data it is better to use the Refresh method.
The Read method needn't be called if the "Refresh from server at server change" configurator is checked (on the "Parameters" tab) because the data are then "read" automatically.
Example:
JavaScriptVBScriptSelect and copy to clipboard

var oOpcGroup = pMe.Pm("/OpcClient/Group1");
if (oOpcGroup.Read(2, 4, 7))
{
// ...
}
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.