This function writes the bits of a specified HOLDING REGISTER to a modbus server via a support structure in pass-through mode.
Syntax |
i32 mbc_mask_write_reg_s (i32 mbc, stru_modbus stru, i32 bitMsk, i32 bitVal) |
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mbc |
Handle value returned by mbc_init() |
||||||||||||||||||||||||||||||||||||
stru |
Structure of type stru_modbus containing the parameters |
||||||||||||||||||||||||||||||||||||
bitMsk |
Mask of the bits that have to be written. Note: The mask must have the affected bits in 1 (R3-style, as opposed to what modbus wants instead). result = (result r_and r_not bitMsk) r_or (bitVal r_and bitMsk) |
||||||||||||||||||||||||||||||||||||
bitVal |
Mask containing the state of the affected bits |
||||||||||||||||||||||||||||||||||||
Result |
Returns:
|
||||||||||||||||||||||||||||||||||||
Validity |
Task |
||||||||||||||||||||||||||||||||||||
Note |
The function is pass-through. As long as it returns MBC_WAIT, it must be continuously called within the task |