Function for reading COILS on a modbus server by specifying the unit ID.
Syntax |
i32 mbcu_read_coils (i32 mbc, i32 unitID, i32 offsCoilsStart, i32 nCoil, dest) |
||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mbc |
Handle value returned by mbc_init() |
||||||||||||||||||||||||||||||||||
unitID |
Value of the unit ID to be used |
||||||||||||||||||||||||||||||||||
offsCoilsStart |
Initial index of the COIL |
||||||||||||||||||||||||||||||||||
nCoil |
Number of COILS to be read from offsCoilsStart. NOTE: The maximum number of COILS that can be read is 2000. |
||||||||||||||||||||||||||||||||||
dest |
Area where to put the read data. Can be i16/u16/i32 or array of i16/u16/i32 |
||||||||||||||||||||||||||||||||||
Result |
Returns:
|
||||||||||||||||||||||||||||||||||
Validity |
Task |
||||||||||||||||||||||||||||||||||
Note |
The function is blocking. Exits only when the task is completed |