Promotic
Login logon

Write - method of the PmaOpcDaClientGroup object

Description:
It allows writing the defined block in the data group (defined on the "Data" tab) to the OPC server.
Syntax:
Boolean Write(Long Attr, Long From, Long To)
Parameters:
Attr(Long) the way of the transfer: (see OPC DA Basic terms)
0 - asynchronous access (recommended)
2 - synchronous access
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:
Writing to the OPC server proceeds always into DEVICE and therefore it is recommended to use the Attr value 0, i.e. the asynchronous access. On writing to DEVICE it is necessary to communicate with the device making Write method take longer time in synchronous access slowing down the whole appication.
The Write method needn't be called if the "Auto send to server on writing into the item" configurator is checked (on the "Parameters" tab) because in this case the data are "written" automatically.
See also:
Example:
Writing all values to the OPC server:
JavaScriptVBScriptSelect and copy to clipboard

var oOpcGroup = pMe.Pm("/OpcClient/Group1");
if (oOpcGroup.Write(0, 0, -1))
{
// ... on success
}
else
{
// ... on error
}
PROMOTIC 9.0.34 SCADA system documentation MICROSYS, spol. s r.o.

Send page remark Contact responsible person
© MICROSYS, spol. s r.o.Update cookies preferences