Writes an instance of a Tag or an array of Tag classes to the MODBUS device
The result of the operation ResultCode
If the instance of the Controller class is not already Connected, calling this method will automatically establish the connection.
| 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")
MyTag.Value = Convert.ToInt16(100)
MBDevice.WriteTag(MyTag)
C#
using MBLink;
Controller MBDevice = new Controller("192.168.1.45");
Tag MyTag = new Tag("40001");
MyTag.Value = Convert.ToIn16(100);
MBDevice.WriteTag(MyTag);
Controller Class | MBLink Namespace | GroupWrite | Now | ReadTag