Specifications
7. Application Instructions
© DELTA ELECTRONICS, INC. ALL RIGHTS RESERVED
7-39
Program Example 2:
Ϩʳ 8 bits mode (M1161=ON) / 16 bits mode (M1161=OFF) switch:
π8 bits modeρ:
Head code and tail code of PLC transmission data will be set by using
M1126 and M1130 according to D1124~D1126. After setting, PLC will send
head code and tail code that set by user automatically when executing RS
command.
When M1161=ON, the conversion mode will be 8 bits. 16 bits data will
be divided into upper 8 bits and lower 8 bits. Upper 8 bits will be ignored and
lower 8 bits will be received and transmitted.
M1000
M1161
D100 D120
K4 K7RS
X0
transmit data: (PLCШexternal machine)
STX EXT1 EXT2
D100
lower
D101
lower
S
Head
code
tail code
1
tail code
2
m
length 4
Г
source data register will start from
lower 8 bits of D100
D102
lower
D103
lower
receive data: (external machineШPLC)
D120
lower
D121
lower
Head
code
tail code
1
tail code
2
length 7Г
receive data register will start
from lower 8 bits of D120
D
n
D122
lower
D123
lower
D124
lower
D125
lower
D126
lower
PLC will receive all data that transmits from external machine, including
head code and tail code. Please pay attention when setting length
n
.
π16 bits modeρ:
Head code and tail code of PLC transmitting data is set by using M1126
and M1130 according to D1124~D1126. After setting, PLC will send head
code and tail code that set by user automatically when executing RS
command.
When M1161=OFF, the conversion mode will be 16 bits. 16 bits data will
be divided into upper 8 bits and lower 8 bits to receive and transmit data.
transmit data: (PLCШexternal machined)
STX EXT1 EXT2
D100
lower
D100
upper
D101
lower
D101
upper
S
Head
code
tail code
1
tail code
2
m
length 4
Г
Source data register will start
from lower 8 bits of D100
receive data: (external machineШPLC)
D120
lower
D120
upper
D121
lower
D121
upper
Head
code
tail code
1
tail code
2
length 7
Г
receive data register will start
from lower 8 bits of D120
D
n
D122
lower
D122
upper
D123
lower
PLC will receive all data that transmits from external machine, including
head code and tail code. Please pay attention when setting length
n
.