112
Communications Functions Section 1-9
2. When there are several start and end codes, the first part of each will be
effective.
3. When the end code duplicates the transmission data and the transmission
is stopped part way through, use CR or LF as the end code.
4. The start and end codes are not stored.
1-9-14 Transmission Flags
When sending data from the SRM1, check that the Transmission Enable Flag
is ON for executing the TXD(48) instruction. The Transmission Enable Flag
will turn OFF while the data is being transmitted and will turn ON again when
transmission is complete.
After the SRM1 has received data, the Receive Enable Flag turns ON. When
the RXD instruction is executed, the data received will be written to the speci-
fied words and the Reception Complete Flag will turn OFF.
Note The timing from data reception starting to completion for the SRM1 is as indi-
cated below.
Reception Start:
Without start code: Normal reception status
With start code: After start code is received.
Reception Complete:
When either the end code, the specified no. of bytes, or 256 bytes are
received.
1-9-15 No Protocol Communications Program Example
The following program example is for no protocol communication conducted
through a RS-232C port using TXD(48) and RXD(47) instructions.
If AR 0805 (Transmission Enable Flag) is ON when 00100 is ON, then data
from DM0100 to DM0104 is transmitted from higher to lower values. When AR
0806 (Reception Enable Flag) turns ON, 256 bytes of received data are read
and written to DM 0200 from higher to lower values.
Flag Peripheral port RS-232C port
Transmission Enable Flag AR 0813 AR 0805
Reception Complete Flag AR 0814 AR 0806
First word holding send data.
10 bytes transmitted
Using the RS-232C port data is
stored from higher to lower values
No protocol communications start
00100
AR0806
AR0805
DIFU(13)
00101
@TXD
DM0100
00100
#0000
#0010
@RXD
DM0200
#0000
256
First word to store receive data.
256 bytes transmitted
Using the RS-232C port data is
stored from higher to lower values