INGEAR.NET.GELink

 

Tag.QualityCode Property

Returns the quality state of the last PLC access operation for the Tag instance

[Visual Basic]
NotOverridable Public ReadOnly Property QualityCode As Integer _
    Implements ITag.QualityCode
[C#]
public int QualityCode {get;}

Property Value

QUAL_GOOD - Value read/written to programmable logic controller is valid.

QUAL_BAD - Value read/written to programmble logic controller is invalid.

QUAL_UNCERTAIN - Value read/write to programmble logic controller is in an unknown state.

Implements

ITag.QualityCode

Remarks

TimeStamp is updated when this property is QUAL_GOOD, otherwise Timestamp is invalid.    

Example

VB
Dim MyPLC As New GELink.Controller("192.168.1.45")
Dim MyTag As New GELink.Tag("%R1")
MyPLC.ReadTag(MyTag)
If MyTag.QualityCode = ResultCode.QUAL_GOOD Then
  Console.WriteLine(MyTag.Value.ToString())
Else
  Console.WriteLine(MyTag.QualityString)
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.QualityCode != ResultCode.QUAL_GOOD)  Console.WriteLine(MyTag.QualityString); else  Console.WriteLine(MyTag.Value.ToString());

See Also

Tag Class | GELink Namespace | QualityString | ErrorCode | ErrorString