Represents a method that will handle a change in data
Change event will only fire when the Active property = true and under the following conditions:
ReadTag or GroupRead detects a change in the Value property Controller.ReadTag or Controller.GroupRead detects a change in the QualityCode property,
VB
Dim MyPLC As New GELink.Controller("192.168.1.45")
Dim WithEvents MyTag As New GELink.Tag("%R1")
' * add the event handler
AddHandler MyTag.Changed, AddressOf MyTag_Changed
' * Read the tag
MyPLC.ReadTag(MyTag)
' * Event Handler
Private Sub MyTag_Changed(ByVal sender As Object, ByVal e As GELink.DataChangeEventArgs) Handles Tag1.Changed)
If e.QualityCode = ResultCode.QUAL_GOOD Then
Console.WriteLine(e.Value.ToString())
End If
End Sub
C#
GELink.Controller MyPLC = new GELink.Controller("192.168.1.45");
GELink.Tag MyTag = new GELink.Tag("%R1")
// add the event handled
MyTag.Changed += new MyTag.ChangedEventHandler(MyTag_Changed);
// read the tag
MyPLC.ReadTag(myTag);
// event handler
void MyTag_Changed(ByVal sender As Object, ByVal e As GELink.DataChangeEventArgs) Handles Tag1.Changed)
{
if( e.QualityCode == ResultCode.QUAL_GOOD)
Console.WriteLine(e.Value.ToString());
}
Namespace: GELink
Assembly: INGEAR.NET.GELink (in INGEAR.NET.GELink.dll)