Cqm1 One-To-One Link Communications - Omron CPM1 Programming Manual

Hide thumbs Also See for CPM1:
Table of Contents

Advertisement

Communications Functions
Application Example
1-9-7

CQM1 One-to-one Link Communications

One-to-one Links
Master area
Slave area
102
The start code and end code are not included in AR 09 or AR 10 (number of
bytes received).
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.
00100
00101 AR0805
AR0806
The data will be as follows: "31323132313231323132CR LF"
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.
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.
Master
Write "1"
Written automatically.
1
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.
DM 6645 setting
Master words
Slave words
DIFU(13)
00101
@TXD(48)
If AR 0805 (the Transmit Ready Flag) is ON
when IR 00100 turns ON, the ten bytes of data
DM 0100
(DM 0100 to DM 0104) will be transmitted, left-
#0000
most bytes first.
#0010
@RXD(47)
When AR 0806 (Reception Completed Flag)
goes ON, the number of bytes of data specified in
DM 0200
AR 09 will be read from the CQM1's reception
#0000
buffer and stored in memory starting at DM 0200,
leftmost bytes first.
AR09
Slave
1
LR 00 to LR 63
LR 00 to LR 31
LR00 to LR31
LR00 to LR15
LR32 to LR63
LR16 to LR31
Section 1-9
1
Master area
Write
Slave area
LR 00 to LR 15
LR00 to LR07
LR08 to LR15

Advertisement

Table of Contents
loading

Table of Contents