Modbus/TCP & Modbus RTU Function Codes
Function Code 05 - Force Single Digital Output
34 HC900 Process Controller Communications User Guide Revision 13
April 2017
4.7 Function Code 05 - Force Single Digital Output
Description
Force a single digital output (0X reference) to either ON or OFF. These are the same digital outputs (DO)
used in Function Code 01.
The Modbus Comm Digital I/O Channel to address mapping is shown in Table 4-5.
(Table 4-7 for V 2.3 and older CPUs).
The HC900 does not support broadcast, and forcing can only be done in the Run or Run/Prog mode.
Write Coil instructions are not supported for outputs configured in the 8 DO FB in controllers of version
4.4xx or earlier. Use single DO FB when executing write coils to HC900 outputs.
Query
The query message specifies the DO to be forced. In CPU firmware revisions 2.4 or greater, DO coils are
addressed starting at 2001d (7D0h). DO 1 is bit address 2001d.
The requested ON/OFF state is specified by a constant in the query data field.
A value of FF 00 hex forces the output to be ON.
A value of 00 00 hex forces the output to be OFF.
A value of FF FF releases the force.
ATTENTION: Any query (ON or OFF) causes a force mode of this point in the HC900 controller. The DO
module’s diagnostic LED flashes Amber when a force condition is present. While in this mode, internal
control of function blocks cannot communicate to this point. DON’T FORGET to send a query to release
this force.
Example: Force DO Card Rack #1, Slot 1, Channel 6 ON in the controller at slave address 1.
Query message format for function code 05
Slave
Address
(00 for TCP)
Response
The normal response is an echo of the query, returned after the DO state has been forced.
Example: Force DO Card Rack #1, Slot 1, Channel 6 ON in the controller at slave address 1.
Response message format for function code 05
Slave
Address
(00 for TCP)
The Modbus Comm Digital I/O Channel to address mapping is shown starting on page 26.