Académique Documents
Professionnel Documents
Culture Documents
12.6
Control Purpose:
Reading the target value and the set value of the temperature controller (TC). (address:
Function
Set value
ON
ASCII
9600
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.
Press
page. Use
to select
. Press
Press both
and
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
3.
In
4.
5.
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
Function
M0
M1
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
LD=
C0
K0
M0
LD=
C0
K1
M1
LD=
C0
K2
M2
LD=
C0
K3
M3
LD=
C0
K4
RST
C0
SET
M1122
MODRD
K1
M0
Sending request
M1
M2
M3
M0
M1
H4700
K2
K1
H4701
K240
12-23
MODWR
H4712
K20
K1
H4718
K1
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
12.7
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
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
Function
Set value
ON
RTU
9600
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.
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.
4.
5.
Devices:
Device
Function
12-25
Device
Function
M0
M1
M2
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
MOV
K0
D1
MOV
K50
D2
Upper-limit of the
alarm: 5
MOV
K30
D3
Lower-limit of the
alarm:3
LD=
C0
K0
M0
LD=
C0
K1
M1
LD=
C0
K2
M2
LD=
C0
K3
M3
LD=
C0
K4
M4
LD=
C0
K5
RST
C0
SET
M1122
M0
Sending request
M1
M2
M3
M4
12-26
M0
MODRD
M1
H1001
K260
K1
H1020
K1
K1
K16
H1002
D0
K2
M1127
K1
M4
K2
M3
H1000
M2
K1
K1
K16
H1024
D2
K2
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.
12-27