WriteEx

<< Click to Display Table of Contents >>

 

WriteEx

WriteEx([Value], [Timestamp], [Quality], [WriteStatus], [WriteSyncMode])

Writes a value to a device. All its parameters are optional and, if omitted, this method's behavior is the same as the Write method. This method returns a Boolean indicating whether the operation was successful or not. The Value parameter defines the value to write to the Driver. Data type depends on the Driver and, if omitted, Tag's current value is assumed. The Timestamp parameter specifies a date and time to write to the 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 Driver, indicating its writing status, if supported by the Driver, according to its own documentation. The WriteSyncMode parameter allows users to use a writing mode that may be different from the one used in the Driver. The available options for this parameter are the following:

0: Writing mode configured in the Driver

1: Synchronous writing mode

2: Asynchronous writing mode (no confirmation)

 

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

Sub Tag1_OnRead()
  ' Use WriteEx to transfer values from one driver to another
  Application.GetObject("Driver2.Tag")._
    WriteEx Value, TimeStamp, Quality
End Sub

Was this page useful?