Returns the quality state of the last MODBUS device access operation for the Tag instance
QUAL_STRING_GOOD - Value read/written to programmable logic controller is valid.
QUAL_STRING_BAD - Value read/written to MODBUS device is invalid.
QUAL_STRING_UNCERTAIN - Value read/write to MODBUS device is in an unknown state.
VB
Imports MBLink
Dim MBDevice As New Controller("192.168.1.45")
Dim MyTag As New Tag("40001")
MBDevice.ReadTag(MyTag)
If MyTag.QualityCode = ResultCode.QUAL_GOOD Then
Console.WriteLine(MyTag.Value.ToString)
Else
Console.WriteLine(MyTag.QualityString)
End If
C#
using MBLink;
Controller MBDevice = new Controller("192.168.1.45");
Tag MyTag = new Tag("40001");
MBDevice.ReadTag(MyTag);
if (MyTag.QualityCode != ResultCode.QUAL_GOOD)
Console.WriteLine(MyTag.QualityString);
else
Console.WriteLine(MyTag.Value.ToString());
Tag Class | MBLink Namespace | QualityCode | ErrorCode | ErrorString