12.
Communication Design Examples
12.6
Communication between PLC and Delta DTA Series Temperature Controller
(MODRD/MODWR)
Control Purpose:
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)
Setting the heating/cooling control cycle. (address: H4712, MODWR instruction)
Setting the control mode as cooling. (address: H4718, MODWR instruction)
Parameter Settings for DTA Series Temperature Controller:
Parameter
Function
Set value
C WE: Write-in function disable/enable
ON
C-SL: ASCII, RTU communication format selection
ASCII
C NO: Communication address setting
BPS: Communication baud rate setting
9600
LENGTH: Data length setting
PARITY: Parity bit setting
STOP BIT: Stop bit setting
UNIT: Temperature display unit C or
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.
Steps of setting factory defaults:
1.
in the main screen to enter
Press
page. Use
to select
. Press
to save the setting.
2.
Press both
and
for about 1s to enter default setting mode. (Other operation is
prohibited in this mode, or setting error will occur, and the TC have to be sent back to
factory for adjusting)
page, press
to set
as
. Press
to save the setting.
3.
In
4.
Turn off TC then power up again.
5.
The communication protocols of DTA series TC are as follows:
z
Supporting MODBUS ASCII/RTU. Baud rate: 2400, 4800, 9600, 19200, 38400.
Supporting function codes: 03H (read multiple words). 06H (write 1 word).
Non-supporting function code: 10H (write multiple words).
12-22
Non-supporting formats in ASCII mode: 7, N, 1 or 8, O, 2 or 8, E, 2.
Supporting formats in RTU mode: 8, N, 1 or 8, N, 2 or 8, O, 1 or 8, E, 1.
Available communication address: 1 to 255, 0 is broadcast address.
DVP-PLC Application Examples
12. Communication Design Examples
Devices:
Devices
Function
M0
Execute MODRD instruction to read target and current temperature.
M1
Execute the first MODWR instruction to set target temperature of TC.
M2
Execute the 2nd MODWR instruction to set the heating/cooling cycle time.
M3
Execute the 3rd MODWR instruction to set the control mode as Cooling.
Control Program:
M1002
D1120
Set communication
format: 9600, 7, E, 1
MOV
H86
SET
M1120
MOV
K500
D1129
RST
M1143
Select communication mode:
MODBUS ASCII
Retain communication setting
Set receiving time-out:
500ms
LD=
C0
K0
M0
Execute MODRD instruction
LD=
C0
K1
M1
Execute the 1st MODWR instruction
LD=
C0
K2
M2
Execute the 2nd MODWR instruction
LD=
C0
K3
M3
Execute the 3rd MODWR instruction
LD=
C0
K4
RST
C0
SET
M1122
MODRD
K1
M0
Sending request
M1
M2
M3
M0
M1
H4700
K2
Read the target value and the present value of the
TC and store them in D1050 and D1051
MODWR
K1
H4701
K240
Set the TC target value as 24
DVP-PLC Application Examples
12-23
12. Communication Design Examples
M2
K1
MODWR
H4712
K20
Set the heating/cooling cycle time: 20s
M3
MODWR
M1127
K1
H4718
K1
Set temperature control mode: cooling mode
CNT
C0
RST
M1127
CNT
C0
RST
M1129
CNT
C0
RST
M1140
CNT
C0
RST
M1141
K10
C0 counts once
when data receiving
is completed.
Reset M1127
M1129
K10
C0 counts once
when communication
timeout occurs
Reset M1129
M1140
K10
C0 counts once
when data receiving
error occurs
Reset M1140
M1141
K10
C0 counts once
when parameter
error occurs
Reset M1141
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.
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.
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
Once PLC starts running, the read/write actions for TC will be performed repeatedly
according to [LD=] instructions.
12-24
DVP-PLC Application Examples
12. Communication Design Examples
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.
Setting the parameters of the TC as following data by MODWR and MODRW instructions.
Parameter
value
Communication address
26C
1001H
50C
1002H
0C
1003H
The first alarm type
1020H
Upper-limit alarm 1
5C
1024H
Lower-limit alarm 1
3C
1025H
Target temperature
Upper limit of temperature range
Lower limit of temperature range
Output type of alarm 1
Parameter Settings for DTB Series Temperature Controller:
Parameter
Function
Set value
C WE: Write-in function disable/enable
ON
C-SL: ASCII, RTU communication format selection
RTU
C NO: Communication address setting
BPS: Communication baud rate setting
9600
LENGTH: Data length setting
PARITY: Parity bit setting
STOP BIT: Stop bit setting
UNIT: Temperature display unit C or
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
DVP-PLC Application Examples
Function
12-25
12. Communication Design Examples
Device
Function
M0
Executing MODRD instruction to read target and present temperature
M1
Executing the 1st MODWR instruction to set target temperature of TC
M2
Executing the 2nd MODWR instruction to set alarm output type
Executing the 1st MODRW instruction to set the upper/lower limit of
temperature range
Executing the 2nd MODRW instruction to set the upper/lower limit of alarm 1
M3
M4
Control Program:
M1002
D1120
Set up communication
format: 9600,8,N,2
MOV
H89
SET
M1120
MOV
K100
SET
M1143
MOV
K500
D0
Upper limit of temp.
Range:50
MOV
K0
D1
Lower limit of temp.
Range:0
MOV
K50
D2
Upper-limit of the
alarm: 5
MOV
K30
D3
Lower-limit of the
alarm:3
Retain communication setting
D1129
Set receiving time-out:
100ms
Select communication mode:
MODBUS RTU
LD=
C0
K0
M0
Execute MODRD instruction
LD=
C0
K1
M1
Execute the 1st MODWR instruction
LD=
C0
K2
M2
Execute the 2nd MODWR instruction
LD=
C0
K3
M3
Execute the 1st MODRW instruction
LD=
C0
K4
M4
Execute the 2nd MODRW instruction
LD=
C0
K5
RST
C0
SET
M1122
M0
Sending request
M1
M2
M3
M4
12-26
DVP-PLC Application Examples
12. Communication Design Examples
M0
MODRD
M1
H1001
K260
K1
H1020
K1
K1
K16
H1002
D0
K2
Set upper/lower limit of temperature range
MODRW
M1127
K1
Set output mode of alarm 1 as the 1st alarm type
MODRW
M4
K2
Set target value as 26
MODWR
M3
H1000
Read the target value and the present value of the
TC and store them in D1073~D1076
MODWR
M2
K1
K1
K16
H1024
D2
K2
Set the upper/lower limit of alarm 1
C0 counts once
when data receiving
CNT
C0
K10
is completed.
RST
M1127
CNT
C0
RST
M1129
CNT
C0
RST
M1140
CNT
C0
RST
M1141
Reset M1127
M1129
K10
C0 counts once
when communication
timeout occurs.
Reset M1129
M1140
K10
C0 counts once
when data receiving
errors occurs.
Reset M1140
M1141
K10
C0 counts once
when parameter error
occurs.
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..
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.
Since DTB series TC supports the function code 10H, the program uses MODRW instruction
to write multiple words.
Once PLC starts running, the read/write actions for TC will be performed repeatedly
according to [LD=] instructions.
DVP-PLC Application Examples
12-27