OnTagRead

<< Click to Display Table of Contents >>

 

OnTagRead

OnTagRead(Tag)

Occurs during an I/O Tag reading, whenever the I/O Driver returns a new value or an error. This means that if an I/O Tag value or quality do not change, this event is not triggered. For this event to work, the EnableDriverEvent property must necessarily be enabled. In addition, the PercentDeadband property can also influence this event, if the EnableDeadband property is enabled. The next script contains an example of using this event.

Sub Tags_OnTagRead(Tag)
  Set Obj = Application.GetObject("Data1.TagName")
  Obj.Value = Tag.Name
  Set Obj = Application.GetObject("Data1.TagRead")
  Obj.Value = True
  Set Obj = Application.GetObject("Data1.TagType")
  Obj.Value = TypeName(Tag)
End Sub

Was this page useful?