Communications Functions
Application Example
1-6-4
One-to-one Data Links
3. The results of reading the data received will be stored in the AR area.
Check to see that the operation was successfully completed. The contents
of these bits will be reset each time RXD(47) is executed.
RS-232C
Peripheral
port
port
AR 0800 to
AR 0808 to
AR 0803
AR 0811
AR 0804
AR0812
AR 0807
AR0815
AR 09
AR10
To reset the RS-232C port (i.e., to restore the initial status), turn ON SR
25209. To reset the peripheral port, turn ON SR 25208. These bits will turn
OFF automatically after the reset.
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 no-protocol
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 no-protocol 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 CQM1H data with the standard communications condi-
tions.
00100
DIFU(13) 00101
00101 AR0805
@TXD(48)
AR0806
@RXD(47)
The data will be as follows: "31323132313231323132CR LF"
If a CQM1H is linked one-to-one by connecting it to another CPU Unit through
their RS-232C ports, they can share common LR areas. One of the PCs will
serve as the master and the other as the slave. A CQM1H can be linked one-
to-one with any of the following PCs: CQM1H, CQM1, C200HX/HG/HE,
C200HS, CPM1, CPM1A, CPM2A, CPM2C, or SRM1(-V2).
Error
RS-232C port error code (1 digit BCD) 0: Normal
completion 1: Parity error 2: Framing error 3:
Overrun error
Communications error
Reception Overrun Flag (After reception was
completed, the subsequent data was received
before the data was read by means of the
RXD(47) instruction.)
Number of bytes received (4-digit BCD)
If AR 0805 (the Transmission Enabled Flag) is
ON when IR 00100 turns ON, the ten bytes of
DM 0100
data (DM 0100 to DM 0104) will be transmitted,
#0000
leftmost bytes first.
#0010
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 CQM1H's reception
buffer and stored in memory starting at DM 0200,
#0000
leftmost bytes first.
AR09
Section 1-6
55
Need help?
Do you have a question about the CQM1H - PROGRAM and is the answer not in the manual?