Reads a TagGroup from the GE PLC
TagGroup parameter and be a single instance of a TagGroup, or an array of TagGroups.
See INGEAR VB.GroupRead and CS.GroupRead projects for an example the demonstrates this functionality.
| Exception Type | Condition |
|---|---|
| ArgumentNullException | Thrown if TagGroup parameter is a null reference (Nothing in Visual Basic). |
| ArgumentException | Thrown if TagGroup parameter is not TagGroup Type. |
VB Try ' ***************************** ' * Initialize Dim MyPLC As New GELink.Controller("192.168.1.45") Dim Tag1 As New GELink.Tag("%R1") Dim Tag2 As New GELink.Tag("%M1") Dim Tag3 As New GELink.Tag("%R2")
Dim MyGroup As New GELink.TagGroup
' ******************************* ' * Add tags to Group MyGroup.AddTag(Tag1) MyGroup.AddTag(Tag2) MyGroup.AddTag(Tag3)
' ***************************** ' * read Tags MyPLC.GroupRead(MyGroup) ' ***************************** ' * display Tag1 value If ResultCode.QUAL_GOOD = Tag1.QualityCode Then Console.WriteLine(Convert.ToString(Tag1.Value)) Else Console.WriteLine(Tag1.ErrorString) End If
' ***************************** ' * display Tag2 value If ResultCode.QUAL_GOOD = Tag2.QualityCode Then Console.WriteLine(Convert.ToString(Tag2.Value)) Else Console.WriteLine(Tag2.ErrorString) End If
' ***************************** ' * display Tag3 values If ResultCode.QUAL_GOOD = Tag3.QualityCode Then Console.WriteLine(Convert.ToString(Tag3.Value)) Else Console.WriteLine(Tag3.ErrorString) End If
Catch ex As Exception Console.WriteLine(ex.Message) End Try
C# try { ////////////////////////////// // Initialize GELink.Controller MyPLC = new GELink.Controller("192.168.1.45");
GELink.Tag Tag1 = new GELink.Tag("%R1"); GELink.Tag Tag2 = new GELink.Tag("%M1"); GELink.Tag Tag3 = new GELink.Tag("R2");
GELink.TagGroup MyGroup = new GELink.TagGroup(); ////////////////////////////// // add tags to group MyGroup.AddTag(Tag1); MyGroup.AddTag(Tag2); MyGroup.AddTag(Tag3);
////////////////////////////// // read Tags MyPLC.GroupRead(MyGroup); ///////////////////////////// // display Tag1 value if (ResultCode.QUAL_GOOD == Tag1.QualityCode) Console.WriteLine(Convert.ToString(Tag1.Value)); else Console.WriteLine(Tag1.ErrorString);
///////////////////////////// // display Tag1 value if (ResultCode.QUAL_GOOD == Tag2.QualityCode) Console.WriteLine(Convert.ToString(Tag2.Value)); else Console.WriteLine(Tag2.ErrorString);
///////////////////////////// // display Tag3 value if (ResultCode.QUAL_GOOD == Tag3.QualityCode) Console.WriteLine(Convert.ToString(Tag3.Value)); else Console.WriteLine(Tag3.ErrorString); } catch (System.Exception ex) { Console.WriteLine(ex.Message); }
Controller Class | GELink Namespace | TagGroup | GroupWrite | IController.GroupRead