![background image](http://html.mh-extra.com/html/omron/v400-r2-series/v400-r2-series_connection-manual_741434015.webp)
6. Serial Communications Settings
12
6.3. Example of Connection Check
This document shows an example of an ST (structured text) program and protocol macro data
in which the Controller sends/receives the message to/from the Code Reader.
The Controller and the Code Reader send and receive the message of "Reading Trigger
(sequence No. 900)". The following figure outlines the sequence operation.
●
Overview of sequence operation
(1) The ST program executes the protocol macro instruction (ExecPMCR instruction) for
which sequence No. 900 of protocol macro data is specified
(2) The Reading Trigger command (sequence No. 900) is selected from the protocol macro
data, and it is sent to the Code Reader.
(3) The Code Reader executes the command according to the send data from the
Controller.
(4) The Controller receives the result of the command executed by the Code Reader, and
then stores in the specified variable.
Controller
CPU Unit
Serial Communications Unit
RS-232C
Code Reader
Project file
Send data
Receive data
ST Program
IF …. THEN
……….
ELSE
……….
END_IF;
ExecPMCR(….
Protocol macro
data
Sequence No.1
Sequence No.2
Sequence No.900
Output_RecvData
Receive data
storage area
(1) Executing the protocol
macro instruction
(Specifying sequence No.900)
(2) Reading Trigger
(Sequence No.900)
(3) Executing the
command
(4) Receiving the
execution result of
the command and
storing it in the
specified variable