Returns the error code for the last PLC access for the Tag instance
Types of errors reported: (see Remarks below)
ErrorCode will reflect the probably cause of failure. The ErrorString property provides a description of the error.
Operational Error - E_xxx error codes. See ResultCode
WINSOCK Error - 100xx error codes. Windows has a problem with the network subsystem an unknown Win32 error comes back with a number (like e.g. 10060).
Device Errors - Errors reported by the GE PLC processor. Please consult the GE PLC users manual for resolution.
VB
Dim MyPLC As New GELink.Controller("192.168.1.45")
Dim MyTag As New GELink.Tag("%R1")
MyPLC.ReadTag(MyTag)
If MyTag.ErrorCode = ResultCode.E_SUCCESS Then
Console.WriteLine(MyTag.Value.ToString())
Else
Console.WriteLine(MyTag.ErrorString)
End If
C#
GELink.Controller MyPLC = new GELink.Controller("192.168.1.45");
GELink.Tag MyTag = new GELink.Tag("%R1");
MyPLC.ReadTag(MyTag);
if (MyTag.ErrorCode != ResultCode.E_SUCCESS)
Console.WriteLine(MyTag.ErrorString);
else
Console.WriteLink(MyTag.Value.ToString());
Tag Class | GELink Namespace | ErrorString | QualityCode | QualityString | TimeStamp