INGEAR.NET.MBLINK

GroupUpdate Delegate

Indicates when a GroupRead or GroupWrite completes

[Visual Basic]
Public Delegate Sub GroupUpdate( _
   ByVal sender As Object, _
   ByVal e As TagGroupEventArgs _
)
[C#]
public delegate void GroupUpdate(
   object sender,
   TagGroupEventArgs e
);

Parameters

sender
Instance of TagGroup that invoked the event.
e
Arguments associated with the event

Example

VB
Imports MBLink
Dim MBDevice As New Controller("192.168.1.45")
Dim WithEvents MyGroup As New TagGroup
Dim Tag1 As New Tag("40001")
Dim Tag2 As New Tag("40002")

' * add the event handler
AddHandler MyGroup.Update,  AddressOf MyGroup_Update

' * add tags to group
MyGroup.AddTag(Tag1)
MyGroup.AddTag(Tag2)

' * Read the Group
MBDevice.GroupRead(MyGroup)

' * Event Handler
Private Sub MyGroup_Update(ByVal sender As Object, ByVal e As MBLink.TagGroupEventArgs) Handles MyGroup.Update)

 ' * what caused event
  Console.WriteLine(e.EventName)
  
  ' * process list of tags
  For Each (MBLink.Tag theTag in e.TagList)
     Console.WriteLine(theTag.Value.ToString())
  Next  
  
End Sub

C#
using MBLink'
Controller MBDevice = new Controller("192.168.1.45");
TagGroup MyGroup = new TagGroup();
Tag Tag1 = new Tag("40001");
Tag Tag2 = new Tag("40002");

// add the event handled
MyGroup.GroupUpdate += new MyTag.GroupUpdateEventHandler(MyGroup_Update);

// read the tag
MBDevice.ReadTag(myTag);

// event handler
void MyGroup_Update(sender As Object, e As MBLink.DataChangeEventArgs) Handles Tag1.Changed)
{
  if( e.QualityCode == ResultCode.QUAL_GOOD)
    Console.WriteLine(e.Value.ToString());
}

Requirements

Namespace: MBLink

Assembly: INGEAR.NET.MBLINK (in INGEAR.NET.MBLINK.dll)

See Also

MBLink Namespace