6 - 74
6 - 74
6. HOW TO COMMUNICATE WITH ID TAGS
(5) Program example
Read ID Tag
command
Module
ready
X0
CH1 ID
communication
complete
X2
MOVP
H0
U0\
G0
CH1 command
code specification
MOVP
H0
U0\
G1
CH1
communication
specification
MOVP
H0
U0\
G2
CH1 processing
specification
MOVP
K10
U0\
G3
CH1 head address
specification
MOVP
K8
U0\
G4
CH1 number of
processed points
specification
SET
Y14
CH1 ID instruction
execution request
Set CH1 command code
specification in "read"
(setting value = 0).
Set CH1 communication
specification in "trigger"
(setting value = 0).
Set CH1 processing
specification (data storage
order) in "upper -> lower"
(setting value = 0).
Set "10" in the head address
specification for the ID tag to
read CH1 data.
Set the CH1 data reading size
to "8 bytes" in the number of
processing points specification.
Execute CH1 ID instruction
(Read command).
CH1
ID-BUSY
X3
CH1 ID
instruction
complete
X4
CH1 error
detection
X5
ID tag read processing
M1010
Write to
ID Tag
command
M1020
Module
ready
X0
MOVP
H1
U0\
G0
CH1 command
code specification
MOVP
H0
U0\
G1
CH1
communication
specification
MOVP
H0
U0\
G2
CH1 processing
specification
MOVP
K20
U0\
G3
CH1 head address
specification
MOVP
K8
U0\
G4
CH1 number of
processed points
specification
BMOVP
D2300
U0\
G100
K4
CH1 data
storage
Write data
Set CH1 command code
specification in "write"
(setting value = 1).
Set CH1 communication
specification in "trigger"
(setting value = 0).
Set CH1 processing
specification (data storage
order) in "upper -> lower"
(setting value = 0).
Set "20" in the head address
specification for the ID tag to
write CH1 data.
Set the CH1 data writing size
to "8 bytes" in the number of
processing points
specification.
Execute CH1 ID instruction
(Read command).
Transfer the data written in the
data register D2300 to D2303
to CH1 data storage area.
SET
Y14
CH1 ID instruction
execution request
CH1 ID
communication
complete
X2
CH1
ID-BUSY
X3
CH1 ID
instruction
complete
X4
CH1 error
detection
X5
ID tag write processing
Specify the number of
points to transfer in words
(8 bytes -> 4 words).
CH1 ID
instruction
complete
X4
BMOV
D1200
U0\
G100
K4
CH1 data
storage
Read data
CH1 error
detection
X5
MOV
D1020
U0\
G41
Add the processing when reading ends normally.
Add the processing when the status is abnormal upon ID instruction execution.
CH1 error
details storage
ID instruction
error code
CH1 ID
instruction
complete
X4
CH1 error
detection
X5
RST
Y14
CH1 ID instruction
execution request
Transfer the data read from
CH1 data storage area to the
data register D1200 to D1203.
When an error occurs with CH1,
transfer the number of error
details from the storage area to
the data register D1020.
Turn off CH1 ID instruction
request when the ID instruction
execution is completed.
Module
ready
X0
Read ID Tag
command
M1010
Module
ready
X0
Read ID Tag
command
M1010
Write to ID
Tag command
M1020
RST
M1010
Read ID Tag
command
RST
M1020
Write to ID
Tag command
Turn off the Read ID Tag
command signal.
Turn off the Write to ID
Tag command signal.
End processing
ID instruction error processing
ID instruction complete processing
Add the processing when writing ends normally.
Write to ID
Tag command
M1020
Specify the number of
points to transfer in words
(8 bytes -> 4 words).