MODBUS Protocol
Function Codes
Thermo Electron Corporation 42i Low Source Instruction Manual C-7
(0x05) Force (Write) Single
Coil
The force (write) single coil function simulates the activation of the digital
inputs in the instrument, which triggers the respective action.
This function code is used to set a single action to either ON or OFF. The
request specifies the address of the action to be forced. Actions are addressed
starting at zero. Therefore, action number 1 is addressed as 0. The requested
ON/OFF state is specified by a constant in the request data field. A value of
0xFF00 requests the action to be ON. A value of 0x0000 requests it to be
OFF. All other values are illegal and will not affect the output. The normal
response is an echo of the request, returned after the state has been written.
Here is an example of a request to write Coil 5 ON:
Request
Function code 1 Byte 0x05
Output Address 2 Bytes 0x0000 to maximum allowed by instrument
Output Value 2 Bytes 0x0000 or 0xFF00
Response
Function code 1 Byte 0x05
Output Address 2 Bytes 0x0000 to maximum allowed by instrument
Output Value 2 Bytes 0x0000 or 0xFF00
Error Response
Function code 1 Byte Function code + 0x80
Exception code 1 Byte 01=Illegal Function, 02=Illegal Address,
03=Illegal Data, 04=Slave Device Failure
Request
Field Name (Hex)
Function 05
Output Address Hi 00
Output Address Lo 05
Output Value Hi FF
Output Value Lo 00