This function writes COILS to a Modbus server by specifying the unit ID and using the Modbus function code of the corresponding multiple writes FC 15, unlike mbcu_write_coils() which can also use FC 05.
Syntax |
i32 mbcu_write_multiple_coils (i32 mbc, i32 unitID, i32 offsCoilStart, i32 nCoil, source) |
||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mbc |
Handle value returned by mbc_init() |
||||||||||||||||||||||||||||||||||
unitID |
Value of the unit ID to be used |
||||||||||||||||||||||||||||||||||
offsCoilStart |
Initial index of the COIL |
||||||||||||||||||||||||||||||||||
nCoil |
Number of COILS to be written. NOTE: The maximum number of COILS that can be written is 1968. |
||||||||||||||||||||||||||||||||||
source |
Area where to take the data to be written. 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 |