WriteFeedbackMode

<< Click to Display Table of Contents >>

 

WriteFeedbackMode

Enum This property allows controlling writing feedback confirmation to Tags. It applies only to readable Tags, that is, Tags whose AllowRead property is set to True. Through this property, reading 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

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 Driver indicates a successful writing, the written value is directly assumed by the Tag, without reading it from the PLC

 

Applications created before this property existed assume the value 0 - wfWaitNextRead when loaded. Example:

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 Tag without searching for its timestamp and quality in the PLC. In addition, the assumed value itself may present a little deviation due to any kind of simplification in numbers that may occur in the Driver or in the PLC. Also, note that some 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?