INGEAR.NET.MBLINK

 

Tag.ErrorString Property

Returns the error code for the last MODBUS device access for the Tag instance as a string

[Visual Basic]
NotOverridable Public ReadOnly Property ErrorString As String _
    Implements ITag.ErrorString
[C#]
public string ErrorString {get;}

Property Value

Types of errors reported: (see Remarks below)

Implements

ITag.ErrorString

Remarks

ErrorCode will reflect the probably cause of failure. The property provides a numeric value for the error.
Operational Error - ES_xxx error strings. See ResultCode
WINSOCK Error - WINSOCK - Windows has a problem with the network subsystem an unknown Win32 error.
Device Errors - Please consult the MODBUS users manual for resolution.
 

Example

VB
Imports MBLink
Dim MBDevice As New Controller("192.168.1.45")
Dim MyTag As New Tag("40001")
MBDevice.ReadTag(MyTag)
If MyTag.ErrorCode = ResultCode.E_SUCCESS Then
  Console.WriteLine(MyTag.Value.ToString())
Else
  Console.WriteLine(MyTag.ErrorString)
End If
C#
using MBLink;
Controller MBDevice = new Controller("192.168.1.45");
Tag MyTag = new Tag("40001");
MBDevice.ReadTag(MyTag);
if (MyTag.ErrorCode != ResultCode.E_SUCCESS)
  Console.WriteLine(MyTag.ErrorString);
else
  Console.WriteLine(MyTag.Value.ToString());

See Also

Tag Class | MBLink Namespace | ErrorCode | QualityCode | QualityString