ArduinoModbus : Modbus Server class
Write the value of the server's Discrete Input for the specified address and value.
int discreteInputWrite(int address, uint8_t value);
address - address to use for operation
Value - discrete input value to write
1 on success, 0 on failure.
ModbusServer class