406
This program block is
to constitute the data
writing command of
the “VS Protocol”.
In this example, it
uses the content
value of this PLC’s
D110 then writes that
value to the D0 of the
VS Slave #1.
The command data string
from the Master
D11
D12
D13
D14
D1
D2
D3
D4
D5
D6
D7
D8
D10
D9
D15
D16
D17
D18
L
H
L
H
L
H
L
H
L
H
10H
10H
03H
02H
28H
01H
00H
00H
09H
00H
A0H
00H
00H
00H
01H
00H
44H
33H
〜
D L E
D L E
E T X
STX
Data
write to
D0
D0
MOV
MOV H10 D1
M2
K18
MOV K10 D50
M0
M4
M7
MOV H02 D2
CCD D53 D104 K4
WAND D104 HFF D104
HEX D59 D106 K2
CMP D104 D106 M3
CMP D55 K0 M6
END
MOV H03 D16
CCD D3 D102 K12
ASCI D102 D17 K2
Set the number of data bytes to be received
Set the number of data bytes to be sent
M9100
SET
M9101
SET
Y1
RST
M9101
MOV D100 D3
DMOV H09 D4
MOV H28 D6
MOV HA0 D7
MOV H00 D8
MOV H00 D9
MOV H00 D10
DMOV H01 D11
MOV D110 D13
MOV D110 D14
SWAP D14
MOV H10 D15
L
H
L
H
10H
06H
01H
10H
03H
01H
00H
00H
30H
32H
D L E
ACK
DLE
ETX
D51
D52
D53
D54
D55
D56
D57
D58
D59
D60
Activate the sending out flag of the CP1
Calculate the SUM Check
code from the received
data string, take the last
two digits then store that
into D104.
Convert the received SUM Check code
into HEX code and store to D106.
Compare the calculated with the
received SUM Check codes, see
whether they are equal
Check whether the error code is “0”
(no error).
Clear the recive completed flag
The Slave’s feedback
data string
Recive
completed
ag
If the SUM Check codes are not equal or the error
code is not “0”, turn the Y1 “ON” that means the
writing communication is unsuccessful.
Station No.
Device code
Number
of data
Bytes
Function
code
Head
number
of devices
Number
of
devices
SUM
Check
Station No.
Number
of data
Bytes
SUM
Check
Error code