WriteEx

<< Click to Display Table of Contents >>

 

WriteEx

WriteEx(N1, N2, N3, N4, Value, [Timestamp], [Quality], [WriteStatus], [WriteSyncMode])

Writes data to a device. This method returns a Boolean indicating whether this operation was successful or not. The N1 to N4 parameters correspond to I/O Driver's N parameters. The Value parameter defines a value to write to the I/O Driver. For more information on these parameters, please check Driver's documentation. The Timestamp, Quality, and WriteStatus parameters are optional. When omitted, this method's behavior is similar to the Write method. The Timestamp parameter specifies a date and time to write to the I/O Tag, if supported by the device. If omitted, assumes the date and time from the moment of the writing operation. The Quality parameter indicates a quality, from 0 (zero) to 255. If omitted, assumes a Good (192) quality. The WriteStatus parameter receives a value returned by the I/O Driver, indicating its writing status, if supported, according to its own documentation. The WriteSyncMode parameter allows users to use a writing mode that may be different from the one used by the I/O Driver. The available options for this parameter are 0: Writing mode configured in the I/O Driver, 1: Synchronous writing mode, or 2: Asynchronous writing mode, no confirmation.

If the WriteSyncMode parameter is omitted, the writing mode configured in the I/O Driver is also used. Example:

Dim status
If tag001.WriteEx(0, 0, 0, 0, 100, , , status) Then
  MsgBox "Successful writing, status = " & status
Else
  MsgBox "Writing failed, status = " & status
End If

Was this page useful?