Omron C200HX Manuel D’Utilisation

Page de 564
429
3. When RXD(––) is executed, the received data is transferred to the specified
words (without the start and end codes) and the Reception Completed Flag
is turned OFF. The start and end of reception are as follows:
Start:
Continuous reception status if the start code is not enabled.
Reception starts when the start code is received if it is enabled.
End:
Reception ends when the end code is received or 259 bytes of data
have been received.
4. The status resulting from reading the data received will be stored in the SR
Area. Check to see that the operation was successfully completed. The con-
tents of these bits will be reset each time RXD(––) is executed.
RS-232C
Peripheral
Error
SR 26400 to
SR 26403
SR 26408 to
SR 26411
Communications port error code (1 digit BCD) 
0: Normal completion 
1: Parity error 
2: Framing error 
3: Overrun error
SR 26404
SR 26412
Communications Error Flag
SR 26407
SR 26415
Reception Overrun Flag (After reception was
completed, the subsequent data was received
before the data was read by means of the RXD
instruction.)
SR 265
SR 266
Number of bytes received (not including start
and end bits)
Note To reset the RS-232C port (i.e., to restore the initial status), turn ON SR 25209.
To reset the Communications Board port A, turn ON SR 28900. To reset the
Communications Board port B, turn ON SR 28901. These bits will turn OFF auto-
matically after the reset.
8-3-3 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 settings must
be made.
DM 6645: 
1000 (RS-232C port in RS-232C mode; standard settings)
DM 6648: 
2000 (No start code; end code CR/LF)
The default values are assumed for all other PC Setup settings. The host com-
puter must have the same communications settings and a program to receive
the data transmitted from the PC.
The data 3454 is stored in each word from DM 0100 to DM 0104.
@TXD
DM 0100
#0000
#0010
00101 SR 26405
@RXD
DM 0200
#0000
#0256
SR 26406
DIFU(13)
00101
00100
If SR 26405 (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 SR 26406 (Reception Completed Flag)
goes ON, the number of bytes of data specified in
SR 265 will be read from the PC’s reception buff-
er and stored in memory starting at DM 0200, left-
most bytes first.
The data will be as follows:
“34543454345434543454CR LF”
RS-232C Communications
Section 8-3