102
Communications Functions Section 1-9
The start code and end code are not included in AR 09 or AR 10 (number of
bytes received).
Application Example This example shows a program for using the RS-232C port in the RS-232C
Mode to transmit 10 bytes of data (DM 0100 to DM 0104) to the computer,
and to store the data received from the computer in the DM area beginning
with DM 0200. Before executing the program, the following PC Setup setting
must be made.
DM 6645: 1000 (RS-232C port in RS-232C Mode; standard communica-
tions conditions)
DM 6648: 2000 (No start code; end code CR/LF)
The default values are assumed for all other PC Setup settings. From DM
0100 to DM 0104, 3132 is stored in every word. From the computer, execute a
program to receive CQM1 data with the standard communications conditions.
The data will be as follows: “31323132313231323132CR
LF”
1-9-7 CQM1 One-to-one Link Communications
If two CQM1s are linked one-to-one by connecting them together through their
RS-232C ports, they can share common LR areas. When two CQM1s are
linked one-to-one, one of them will serve as the master and the other as the
slave.
Note The peripheral port cannot be used for 1:1 links.
One-to-one Links A one-to-one link allows two CQM1s to share common data in their LR areas.
As shown in the diagram below, when data is written into a word the LR area
of one of the linked Units, it will automatically be written identically into the
same word of the other Unit. Each PC has specified words to which it can
write and specified words that are written to by the other PC. Each can read,
but cannot write, the words written by the other PC.
The word used by each PC will be as shown in the following table, according
to the settings for the master, slave, and link words.
@TXD(48)
DM 0100
#0000
#0010
00101 AR0805
@RXD(47)
DM 0200
#0000
AR09
AR0806
DIFU(13) 00101
00100
If AR 0805 (the Transmit Ready Flag) is ON
when IR 00100 turns ON, the ten bytes of data
(DM 0100 to DM 0104) will be transmitted, left-
most bytes first.
When AR 0806 (Reception Completed Flag)
goes ON, the number of bytes of data specified in
AR 09 will be read from the CQM1's reception
buffer and stored in memory starting at DM 0200,
leftmost bytes first.
1
11
Master Slave
Master area
Slave area
Written automatically.
Write "1"
Master area
Slave areaWrite
DM 6645 setting LR 00 to LR 63 LR 00 to LR 31 LR 00 to LR 15
Master words LR00 to LR31 LR00 to LR15 LR00 to LR07
Slave words LR32 to LR63 LR16 to LR31 LR08 to LR15