2-377

2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Serial Communication
Instructions
2
RXD
Start Code/End Code Settings and Receive Data
Hint

When RXD(235) is used to read data that was received at one of the Serial Option Board’s ports , the

port’s reception buffer is cleared after RXD(235) is executed. Consequently, RXD(235) can not be

executed repeatedly to read a block of data in parts.

Precautions

RXD(235) can be used only for the CPU Unit’s RS-232C port or the Serial Option Board port. In addi-

tion, the port must be set to no-protocol mode.

Execute this instruction when the reception completion flag (RS-232C incorporated in the CPU unit:

A392.06, Serial Option Board: A392.14) is 1 (ON) to receive data (from the reception buffer).

When data is received, the data must be read by an RXD instruction or the next data cannot be

received. When the reception completion flag turns ON, read the received data with an RXD instruc-

tion before the next reception.

Specify the size of the receive data, not including the start code and end code, in N.

If 0 is specified for N, the Reception Completed Flag and Reception Overflow Flag (note(a)) will be

turned OFF, the Reception Counter (note(b)) will be cleared to 0, and nothing will be stored in memory.

1 2 3 4 5 6 0...
1 2 3 4 5 6 0...
1 2 3 4 5 6 0...
1 2 3 4 5 6 0...
1 2 3 4 5 6 0...
1 2 3 4 5 6 0...
1
3
5
2
4
6
1
3
5
2
4
6
1
2
3
4
5
6
LF
CR
Bytes
Receive bytes: Specified
in the PC Setup
Receive bytes after ST:
Specified in the PC Setup
Receive bytes before
ED: 256 max.
Receive bytes between
ST and ED: 256 max.
Receive bytes before
CR+LF: 256 max.
Receive bytes between
ST and CR+LF: 256 max.
When receiving the most significant
bytes first is specified (0):
Most signifi-
cant bytes
Least signif-
icant bytes
When receiving the least significant
bytes first is specified (1):
Most signifi-
cant bytes
Least signif-
icant bytes
N bytes
stored in the
specified
Max: 256 bytes order.
Received
CPU Unit’s built-in RS-232C port
or Serial Option Board port
Start and CR+LF End Code
CR+LF End Code
Start and End Code
Only End Code
Only Start Code
No Start or End Code
ED
ST
ED
ST
ST CR LF
D
D+1
D+2
15 7 08
D
D+1
D+2
15 7 08