INGEAR.NET.ABLink

 

Tag.QualityCode Property

Returns a numeric quality code related to the last operation

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

Property Value

ResultCode for the list of QUAL_xxx codes

Implements

ITag.QualityCode

Example

VB
Try
  ' ********************************
  ' * initialize controller and tag
   Dim MyPLC as New ABLink.Controller("192.168.1.32", CPU.SLC, Driver.ENET)
   Dim MyTag as New ABLink.Tag("N7:0")
   ' *******************************
   ' * set the value
   MyTag.Value = 1234
   {.. elsewhere in code...}
   
   ' *******************************
   ' * write value to PLC
   MyPLC.WriteTag(MyTag)
    
   ' *******************************
   ' * check the status
   If ResultCode.QUAL_GOOD = MyTag.QualityCode Then
      Console.WriteLine(MyTag.Timestamp.ToString())
   Else
      Console.WriteLine(MyTag.ErrorString)
   End If
   
   Console.WriteLine(MyTag.QualityString)
Catch ex As System.Exception
   Console.WriteLine(ex.Message)
End Try
   
C#
try
{
  //////////////////////////////////
  // initialize controller and tag
  ABLink.Controller MyPLC = new ABLink.Controller("192.168.1.32", CPU.SLC, Driver.ENET);
  ABLink.Tag MyTag = new ABLink.Tag("N7:0");
  /////////////////////////////////
  // set the value
  MyTag.Value = 1234;
  {... elsewhere in code...}
  /////////////////////////////////
  // write value to PLC
  MyPLC.WriteTag(MyTag);
  
  //////////////////////////////////
  // check results
  if(ResultCode.QUAL_GOOD == MyTag.QualityCode)
    Console.WriteLine(MyTag.Timestamp.ToString());
  else
    Console.WriteLine(MyTag.ErrorCode);
  Console.WriteLine(MyTag.QualityString);    
}
catch(System.Exception ex)
{
  Console.WriteLine(ex.Message);
}  

Remarks

 

See Also

Tag Class | ABLink Namespace | QualityString | ErrorCode | ErrorString