This function writes the specified COILS always using the Modbus function code of the corresponding multiple writes FC 15, unlike mbc_write_coils() which can also use FC 05 (if single COIL).
Syntax |
i32 mbc_write_multiple_coils( i32 mbc, i32 offsCoilStart, i32 nCoil, source) |
||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mbc |
Handle value returned by mbc_init() |
||||||||||||||||||||||||||||||||||
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 |