INGEAR.NET.MBLINK

 

Tag.Length Property

Gets / Sets the number items to read or write from the MODBUS device

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

Property Value

Number of contiguous items to be read or written to the programmable logic controller.

Implements

ITag.Length

Remarks

If Length is greater than 1, the data being read will be returned as a System.Array

Maximum Array Lengths

 

Exceptions

Exception Type Condition
IndexOutOfRangeException Thrown if Tag.Length exceeds the maximum array length.

 

 

Example

VB
Imports MBLink
Dim MBDevice As New Controller("192.168.1.45")
Dim MyTag As New Tag("40001")
MyTag.Length = 25
MBDevice.ReadTag(MyTag)
C#
Using MBLink;
Controller MBDevice = new Controller("192.168.1.45");
Tag MyTag = new Tag("40001");
MyTag.Length = 25;
MBDevice.ReadTag(MyTag);

See Also

Tag Class | MBLink Namespace