INGEAR.NET.ABLink

TMR Class

TMR Class (TIMER) A class that represents the entire Allen-Bradley TIMER structure from a type 'T' data table

For a list of all members of this type, see TMR Members.

System.Object
   ABLink.TMR

[Visual Basic]
Public Class TMR
[C#]
public class TMR

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

To read/write a Timer element (e.g "T4:0.ACC") specific the element name in the Tag.Name (e.g Tag.Name = "T4:0.ACC"). For a detailed description of the TIMER structure please refer to the appropriate Allen-Bradley programmable logic controller instruction manual.

Example

VB
' ************************
' * initialize controller and tag
Dim MyPLC as New ABLink.Controller("192.168.1.32")
Dim MyTag as New ABLink.Tag("T4:0")

' ***********************
' * create a TMR class
Dim MyTRM As ABLink.TMR

Try
  ' ***********************
  ' * read the tag
  MyPLC.ReadTag(MyTag)

  If ResultCode.QUAL_GOOD = MyTag.QualityCode Then
    ' **********************
    ' * assign value to TMR class
    MyTMR = MyTag.Value
    Console.WriteLine(MyTMR.ACC.ToString())
    Console.WriteLine(MyTMR.PRE.ToString())
  End If
    
Catch ex As System.Exception
  Console.WriteLine(ex.Message)
End Try    

C#
///////////////////////////////////
// initialize controller and tag class
ABLink.Controller MyPLC = new Controller("192.168.1.32");
ABLink.Tag MyTag = new ABLink.Tag("T4:0");

try
{
   /////////////////////////////////
   // read the tag
   MyPLC.ReadTag(MyTag);
   
   if (ABLink.ResultCode.QUAL_GOOD == MyTag.QualityCode)
   {
     // assign .Value to TMR class
     ABLink.TMR MyTMR = (ABLink.TMR)MyTag.Value;
     Console.WriteLine(MyTMR.ACC.ToString());
     Console.WriteLine(MyTMR.PRE.ToString());
   }
}
catch(System.Exception ex)
{
   Console.WriteLine(ex.Message);
}        
     

Requirements

Namespace: ABLink

Assembly: INGEAR.NET.ABLink (in INGEAR.NET.ABLink.dll)

See Also

TMR Members | ABLink Namespace