Read instance of a Tag class or an array of Tag classes from the MODBUS device.
The status of the operationResultCode
If the instance of the Controller class is not already connected to the programmable logic controller, calling this method will automatically establish a connection.
The data value from the programmable logic controller will be returned in the Value property of the Tag class.
| Exception Type | Condition |
|---|---|
| ArgumentNullException | Thrown if Tag parameter is a null reference (Nothing in Visual Basic) |
| InvalidOperationException | Thrown if Tag parameter is not Tag Type, or if Name> is null or empty, or Value is null |
VB
Imports MBLink
Dim MBDevice As New Controller("192.168.1.45")
Dim MyTag As New Tag("40001")
MBDevice.ReadTag(MyTag)
C#
using MBLink;
Controller MBDevice = new Controller("192.168.1.45");
Tag MyTag = new Tag("40001")
MBDevice.ReadTag(MyTag)
Controller Class | MBLink Namespace | GroupRead | WriteTag | Now