FieldTalk™ Modbus Master .NET Library

MbusMasterFunctions.readInputFloats Method (Int32, Int32, Single[])

Modbus function 4 (04 hex) for 32-bit float data types, Read Input Registers as float data.

[Visual Basic]
Overloads Public Function readInputFloats( _
   ByVal slaveAddr As Integer, _
   ByVal startRef As Integer, _
   ByVal float32Arr As Single() _
) As Integer
[C#]
public int readInputFloats(
   int slaveAddr,
   int startRef,
   float[] float32Arr
);

Parameters

slaveAddr
Modbus address of slave device or unit identifier (Range: 1 - 255)
startRef
Start reference (Range: 1 - $10000)
float32Arr
Buffer which will be filled with the data read. The length of the array determines how many values are read (Range: 1-62).

Return Value

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

Remarks

Reads the contents of pairs of consecutive input registers (3:00000 table) into float values.

Note    Modbus does not know about any other data type than discretes and 16-bit registers. Because a float value is of 32-bit length, it will be transferred as two consecutive 16-bit registers. This means that the amount of registers transferred with this function is twice the amount of float values passed to this function.
Note    No broadcast supported

See Also

MbusMasterFunctions Class | FieldTalk Namespace | MbusMasterFunctions.readInputFloats Overload List