ioPAC 8020 Rugged Remote I/O
Using Modbus/TCP
B-2
Command Body
Station
Address
Function
Code
Byte
Count
Data
Data
…
Example: Coils number 2 and 7 are on, all others are off.
01 01 01 42
In the response the status of coils 1 to 8 is shown as the byte value 42 hex, equal to 0100 0010 binary.
Function Code 02
Function code 02 is used to read the discrete ioPAC 8020 input’s ON/OFF status in a binary data format.
Request message format for function code 02:
Command Body
Station
Address
Function
Code
Start Address
High Byte
Start Address
Low Byte
Requested Number of
Input High Byte
Requested Number
of Input High Byte
Example: Read coil number 1 to 8 (address number 00001 to 00008) from ioPAC 8020 modules
01 01 00 01 00 08
Response message format for function code 02:
Command Body
Station
Address
Function
Code
Byte
Count
Data
Data
…
Example: input number 2 and 3 are on, all others are off.
01 01 01 60
In the response the status of input 1 to 8 is shown as the byte value 60 hex, equal to 0110 0000 binary.
Function Code 03/04
Function code 03 or 04 is used to read the binary contents of input registers
Request message format for function code 03 or 04:
Command Body
Station
Address
Function
Code
Start Address
High Byte
Start Address
Low Byte
Requested Number of
Register High Byte
Requested Number
of Register High Byte
Example: Read Analog inputs #1 and #2 in addresses 40001 to 40002 as floating point values from ioPAC
8020 module
01 04 00 01 00 02
Response message format for function code 03 or 04:
Command Body
Station
Address
Function
Code
Byte
Count
Data
Data
…
Example: Analog input #1 and #2 as floating point values where AI#1=100.0 and AI#2=55.32
01 04 08 42 C8 00 00 47 AE 42 5D
Function Code 05
Forces a single coil to either ON or OFF. The requested ON/OFF state is specified by a constant in the query data
field. A value of FF 00 hex requests it to be ON. A value of 00 00 hex requests it to be OFF.aAvalue of FF FF hex
requests it to release the force.
Request message format for function code 05:
Command Body
Station
Function
Coil Address
Coil Address Low Force Data High Byte Force Data Low Byte