EasyManua.ls Logo

Delta DVP-SA2 - Page 479

Delta DVP-SA2
1006 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DVP-ES2/EX2/EC5/SS2/SA2/SX2/SE&TP Operation Manual - Programming
3-358
Program Example 1: COM2(RS-485), Function Code H02 (H01 is used the same as H02.)
1. Function code K2 (H02): read multiple bit devices, up to 64 bits can be read.
2. PLC1 connects to PLC2: (M1143 = OFF, ASCII mode), (M1143 = ON, RTU Mode)
3. In ASCII or RTU mode, when PLC’s COM2 sends out data, the data will be stored in
D1256~D1295. The feedback data will be stored in registers starting with S and converted into
D1296~D1311 in Hex automatically.
4. Take the connection between PLC1 (PLC COM2) and PLC2(PLC COM1) for example, the
tables below explains the status when PLC1 reads Y0~Y17 of PLC2.
H87
MOV
M1002
D1120
SET
M1120
K100
MOV
D1129
RST
M1127
Set communication protocol as 9600, 8, E, 1
Retain communication protocol
Set communication timeout as 100ms
MODRW
K2
K1
X0
H0500 D0 K16
Connection device
address K1
Function code K2
read multiple bits
Data address Y0=H0500
Data storing register
Data length (bit)
Processing received data
ASCII mode: The received data is stored in registers starting from D0 in ASCII format and
PLC converts the content to hexadecimal automatically.registers D1296~D1311 in
RTU mode: The received data is stored in registers starting from D0 in Hex.
Reset M1127
M1127
SET
X0
M1122
Sending request
M1143 = OFF
ASCII mode
RST
M1143
M1143 = ON
RTU mode
SET
M1143
Receiving completed
ASCII Mode (M1143 = OFF):
When X0 = ON, MODRW instruction executes the function specified by Function Code 02.
PLC1 PLC2PLC1 sends: “01 02 0500 0010 E8
PLC2 PLC1PLC1 receives: “01 02 02 3412 B5
Registers for data to be sent (sending messages)
Register
Data
Descriptions
D1256 Low
‘0’
30 H
ADR 1
Device address: ADR (1,0)
D1256 High
‘1’
31 H
ADR 0
D1257 Low
‘0’
30 H
CMD 1
Control parameter: CMD (1,0)
D1257 High
‘2’
32 H
CMD 0
D1258 Low
‘0’
30 H
Y0 = H0500
Starting Data Address
D1258 High
‘5’
35 H
D1259 Low
‘0’
30 H
D1259 High
‘0’
30 H
D1260 Low
‘0’
30 H
Number of Data(count by bit)

Table of Contents

Other manuals for Delta DVP-SA2

Related product manuals