WriteFeedbackMode

<< Click to Display Table of Contents >>

 

WriteFeedbackMode

Enum This property allows controlling writing feedback confirmation to I/O Tags. It applies only to readable I/O Tags, that is, I/O Tags whose AllowRead property is set to True. Through this property, reading I/O Tags that receive writings is quicker. This property contains the configuration options described on the next table.

Available options for the WriteFeedbackMode property

Option

Description

0 - wfWaitNextRead

I/O Tag reading is performed normally on the next scan

1 - wfImmediateReadAfterWrite

After each writing, a confirmation reading is performed as soon as possible (default)

2 - wfTrustWriteSuccess

If this I/O Driver indicates a successful writing, the written value is directly assumed by the I/O Tag, without reading it from a device

 

Applications created before this property existed assume the value 0 - wfWaitNextRead when loaded. The next script contains an example of using this property.

Sub CommandButton1_Click()
  Dim mode
  mode = Application.GetObject("Driver1").WriteFeedbackMode
  MsgBox mode
  Select case mode
  Case 0
    MsgBox "Tag reading is performed on the next scan."
  Case 1
    MsgBox "After each writing, a confirmation _
      reading is performed as soon as possible."
  Case 2
    MsgBox "If the driver indicates a writing success, _
      the written value is assumed directly by the tag, _
      without reading it from the PLC."
  End Select
End Sub

 

NOTE

When using mode 2 - wfTrustWriteSuccess, the timestamp and quality may be incorrect, since in a successful writing the value is assumed by the I/O Tag without searching for its timestamp and quality in the device. In addition, the assumed value itself may present a little deviation due to any kind of simplification in numbers that may occur in the I/O Driver or in the device. Also, note that some I/O Drivers or protocols may indicate success, even when writings fail. So, the other modes, 1 - wfImmediateReadAfterWrite or 0 - wfWaitNextRead, must be preferred when possible.

Was this page useful?