Receiving Data From External Devices; Overview Of Receiving Data - Panasonic FP-XH Series User Manual

Hide thumbs Also See for FP-XH Series:
Table of Contents

Advertisement

7.2 Receiving Data from External Devices

7.2 Receiving Data from External Devices

7.2.1 Overview of Receiving Data

Data received from a COM port is stored in a "receive buffer" specified by the system register,
and the "reception done" flag turns ON. If the "reception done" flag is OFF, data can be received
at any time.
Sample program
8-byte data received in the receive buffer via COM1 port is read into DT0 to DT3.
The program described above is executed in the following sequence.
1. The data sent from external devices is stored in the receive buffer.
2. The "reception done R913A" contact turns ON.
3. The received data is sent from the receive buffer to the area starting with data register DT0.
4. The F159 (MTRN) instruction is executed with no data, in order to reset the receive buffer
writing points and to turn OFF the "reception done" contact R913A. The system is now
prepared to receive the next data. (The data in the receive buffer is not cleared.)
Code Description
(1)
Reception done flag
(2)
Data area of receive buffer
Area that transfers receive
(3)
data
(4)
Given area
(5)
Number of send data bytes
(6)
COM port No.
(a)
Detection of reception done
(b)
Retrieval of receive data
Preparation for receiving the
(c)
next data
7-4
R9132: COM0 port; R913A: COM1 port; R9142: COM2 port; R914A:
COM3 port
Specify the area of data stored in a receive buffer. In this example, 5-
word area (DT201 to DT204) is specified to receive 10-byte data.
Receive data is transferred to a given area from the receive buffer.
To execute F159 (MTRN) instruction, specify a dummy area.
Specify "0" for reception.
Specify a COM port No. for data reception.
K0: COM0 port; K1: COM1 port; K2: COM2 port; K3: COM3 port
Turn ON the internal relay (R10) according to the timing of reception
done flag ON.
Transfer data from an area of receive buffer that stores receive data
(DT201 to DT204) to a given data register (DT100 to DT104).
Turn OFF the reception done flag, and prepare for receiving the next
data. The data in the receive buffer is not cleared.
WUME-FPXHCOMG-02

Advertisement

Table of Contents
loading

Table of Contents