PLC To PID Modbus Examples PDF
PLC To PID Modbus Examples PDF
PLC To PID Modbus Examples PDF
12.6 Communication between PLC and Delta DTA Series Temperature Controller
(MODRD/MODWR)
Control Purpose:
z Reading the target value and the set value of the temperature controller (TC). (address:
H4700, MODRD instruction)
z Setting the target temperature as 24° (address H4701, MODWR instruction)
z Setting the heating/cooling control cycle. (address: H4712, MODWR instruction)
z Setting the control mode as cooling. (address: H4718, MODWR instruction)
Ú If TC can not run normally due to improper parameters, users can set the TC to factory
defaults first and then set the parameters according to the above table.
Devices:
Devices Function
Control Program:
M1002
Set communication
MOV H86 D1120 format: 9600, 7, E, 1
LD= C0 K4 RST C0
M0
SET M1122 Sending request
M1
M2
M3
M0
MODRD K1 H4700 K2
Read the target value and the present value of the
M1 TC and store them in D1050 and D1051
MODWR K1 H4701 K240
M2
MODWR K1 H4712 K20
Program Description:
z Initialize PLC RS-485 communication port and set the communication format as MODBUS
ASCII, 9600, 7, E, 1. The RS-485 communication format of TC should be the same with
PLC.
z Since DTA series TC does not support the function code 10H (Write multiple words), the
program needs 3 MODWR instructions to write 3 address data.
z There are only 4 situations for MODBUS communication: flag M1127 for normal
communication and M1129, M1140, M1141 for communication errors. Counter C0 counts
once when any of the 4 flags is ON. Therefore, the program assures the communication
reliability by monitoring the On/Off status of the 4 flags and performs 4 MODBUS
instructions in order by the value in counter C0
z Once PLC starts running, the read/write actions for TC will be performed repeatedly
according to [LD=] instructions.
12.7 Communication between PLC and Delta DTB Series Temperature Controller
(MODRD/MODWR/MODRW)
Control Purpose:
z Reading as well as displaying the target value and the present value of the TC by MODRD
instruction.
z Setting the parameters of the TC as following data by MODWR and MODRW instructions.
Ú If TC can not run normally due to improper parameters, users can set the TC to factory
defaults first and then set the parameters according to the above table. The setting steps of
DTB series are the same with DTA series TC.
Ú Communication protocol of DTB series is as following:
1. Supporting MODBUS ASCII/RTU communication protocol. Communication baud rate:
2400, 4800, 9600, 19200, 38400.
2. Supporting function code: 03H to read the contents of register. 06H to write 1 word into
register. 10H to write many words into register.
3. Non-supported formats in ASCII mode: 7, N, 1 or 8, O, 2 or 8, E, 2
4. Formats in RTU mode: 8, N, 1 or 8, N, 2 or 8, O, 1 or 8, E, 1.
5. Available communication address: 1 to 255, 0 is broadcast address.
Devices:
Device Function
Device Function
Control Program:
M1002
Set up communication
MOV H89 D1120 format: 9600,8,N,2
Lower-limit of the
MOV K30 D3
alarm:3℃
LD= C0 K5 RST C0
M0
SET M1122 Sending request
M1
M2
M3
M4
M0
MODRD K1 H1000 K2
Read the target value and the present value of the
TC and store them in D1073~D1076
M1
MODWR K1 H1001 K260
RST M1141
Program Description:
z Initialize PLC RS-485 communication port and set the communication format as MODBUS
RTU, 9800, 8, N, 2. The RS-485 communication format of TC should be the same with PLC..
z There are only 4 situations for MODBUS communication: flag M1127 for normal
communication and M1129, M1140, M1141 for communication errors. Counter C0 counts
once when any of the 4 flags is ON. Therefore, the program assures the communication
reliability by monitoring the On/Off status of the 4 flags and performs 5 MODBUS
instructions in order by the value in counter C0.
z Since DTB series TC supports the function code 10H, the program uses MODRW instruction
to write multiple words.
z Once PLC starts running, the read/write actions for TC will be performed repeatedly
according to [LD=] instructions.