Modbus RTU
/
TCP Server User Manual for LinPAC / LinCon
Ver : 1.0 (
2009.04)
7
L2
CH 2 Modbus Control Function
This chapter is about how to consist your modbus requests, and how to interpret response
messages.
LinPAC
/
LinCon Modbus Server supports functions:
Function Code
Sub Code
Description
Section
01
-
Read back multiple coils status (0xxxx) for DO
2-1
02
-
Read multiple input discretes (1xxxx) for DI
2-2
03
-
Read back multiple registers (4xxxx) for AO
2-3
04
-
Read multiple input registers (3xxxx) for AI
2-4
05
-
Write single coil (0xxxx) for DO
2-5
06
-
Write single register (4xxxx) for AO
2-6
15
-
Force multiple coils (0xxxx) for DO
2-7
16
-
Write multiple registers (4xxxx) for AO
2-8
108
7
Read range code of ICPDAS AI/O module
2-9.1
8
Set range code of ICPDAS AI/O module
2-9.2
In following sections, the defined Protocol Data Unit (PDU) is used within the framework of Modbus
RTU. For Modbus TCP protocol, there are 6 bytes of prefixed fields need be added.
NOTE :
There are some address rules need to be noted :
(1.) Slot index start from 1, and max. is 8. (depended on your LinPAC
/
LinCon modules )
(2.) DI/O and AI/O points are dressed starting from 0.
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
~
Transaction identifier
Protocol identifier
PDU length
PDU
Hi (0)
Lo (0)
Hi (0)
Lo (0)
Hi
Lo
Formate is defined in eache section