Write - method of object PmOpcClientData

It enables writing the defined block in the data group (defined on the Data page) to the OPC server.
Write(Attr As Long, From As Long, To As Long) As Boolean
oClientData.Write Attr, From, To
Attr(Long) the way of the transfer: (see OPC 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 represents "till the end".
Return Values:
true - on success
false - on error
Writing to the OPC server proceeds always into DEVICE and yet it is recommended to use the Attr value 0, which means the asynchronous access. When writing to DEVICE it is necessary to communicate with the device making the Write method take longer time in synchronous access slowing down the whole appication.

The Write method needn't be called if the configurator Auto write to server when writing to item is set on the Parameters page because the data are then "written" automatically.

See also:
Writing all values to the OPC server:
If oClientData.Write(0, 0, -1) Then
  '.. on success
  '.. on error
End If
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice