INGEAR.NET.Logix

 

Tag.Now Property

Performs an immediate read / write of the ControlLogix/CompactLogix

[Visual Basic]
NotOverridable Public Property Now As Object _
    Implements ITag.Now
[C#]
public object Now {get; set;}

Implements

ITag.Now

Remarks

Default value is a null reference (Nothing in Visual Basic)

Exceptions

Exception Type Condition
InvalidOperationException Thrown if Controller is a null reference (Nothing in Visual Basic) or if assigning a null value to the .Now property.

Example

VB
Try
  ' ****************************
  ' * initialize controller
  Dim MyPLC as New Logix.Controller("192.168.1.31")
  ' ****************************
  ' * initialize tag
  Dim MyTag as New Logix.Tag("theTag")
  ' ****************************
  ' * set the Controller property
  MyTag.Controller = MyPLC
  ' ****************************
  ' * perform immediate read
  Console.WriteLine(Convert.ToString(MyTag.Now))
Catch ex As System.Exception
  Console.WriteLine(ex.Message)
End Try  


   C# try {  ////////////////////////////////  // initialize controller  Logix.Controller MyPLC = new Logix.Controller("192.168.1.31");  ////////////////////////////////  // initialize tag  Logix.Tag MyTag = new Logix.Tag("N7:0");  ///////////////////////////////  // set controller property  MyTag.Controller = MyPLC;  ///////////////////////////////  // execute immediate read  Console.WriteLine(Convert.ToString(MyTag.Now)); } catch (System.Exception ex) {   Console.WriteLine(ex.Message); }      

See Also

Tag Class | Logix Namespace