FieldTalk™ Modbus Master .NET Library

MbusMasterFunctions.readCoils Method (Int32, Int32, Boolean[])

Modbus function 1 (01 hex), Read Coil Status/Read Coils.

[Visual Basic]
Overloads Public Function readCoils( _
   ByVal slaveAddr As Integer, _
   ByVal startRef As Integer, _
   ByVal bitArr As Boolean() _
) As Integer
[C#]
public int readCoils(
   int slaveAddr,
   int startRef,
   bool[] bitArr
);

Parameters

slaveAddr
Modbus address of slave device or unit identifier (Range: 1 - 255)
startRef
Start reference (Range: 1 - $10000)
bitArr
Buffer which will contain the data read. The length of the array determines how many coils are read (Range: 1-2000).

Return Value

BusProtocolErrors.FTALK_SUCCESS on success or error code. See BusProtocolErrors for possible error codes.

Remarks

Reads the contents of the discrete outputs (coils, 0:00000 table).

Note    No broadcast supported

See Also

MbusMasterFunctions Class | FieldTalk Namespace | MbusMasterFunctions.readCoils Overload List