Modbus function 0x05 Write Single Coil. This function code is used to write a single output to either ON or OFF in a remote device. The requested ON/OFF state is specified by a constant in the state field. A non-zero value requests the output to be ON and a value of 0 requests it to be OFF. The request specifies the address of the coil to be forced. Coils are addressed starting at zero. @par
| 423 | @ingroup discrete |
| 424 | */ |
| 425 | uint8_t ModbusMaster::writeSingleCoil(uint16_t u16WriteAddress, uint8_t u8State) |
| 426 | { |
| 427 | _u16WriteAddress = u16WriteAddress; |
| 428 | _u16WriteQty = (u8State ? 0xFF00 : 0x0000); |
| 429 | return ModbusMasterTransaction(ku8MBWriteSingleCoil); |
| 430 | } |
| 431 | |
| 432 | |
| 433 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected