Receiving Data From External Devices - Panasonic FP Series Programming Manual

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

You can only execute F159_MTRN with the number of bytes equal to
zero for the COM ports of a CPU; otherwise an operation error will
occur.
POU
All input and output variables which are required for programming the function are declared in the
Header and
POU header.
LD Body
ST Body
if
(DF(ClearTheReceiveBuffer))
(* Clears the receive buffer of the COM1 port of the FP-SIGMA *)
F159_MTRN(s_Start
end_if;
 Communication port of the MCU:
Receiving data from the MCU using F161_MRCV (see page 755) implicitly clears the reception
area and resets the "reception done flag". Hence the communication port can again receive data.

22.4.2 Receiving data from external devices

Steps for receiving data from external devices:
1.
Setting the communication parameters and specifying the receive buffer
2.
Receiving the data
3.
Processing the data in the receive buffer
4.
Preparing the system to receive subsequent data
NOTE
Data received via the communication ports of an MCU has to be moved to the CPU receive buffer
using the instruction F161_MRCV (see page 755).
1. Setting the communication parameters (see)
2. Receiving the data
Data is automatically received in the receive buffer defined in the system registers. Reception can be controlled
by the "reception done" flag or by directly evaluating the receive buffer. (For details on flag operation, see page
757.) When this flag is FALSE and data is sent to the communication port from an external device, operation
takes place as follows. (The "reception done" flag turns to FALSE after switching to RUN mode.)
then
:= wDummy,
n_Number
:= 0,
Data transfer via communication ports
d_Port
:= 1);
747

Advertisement

Table of Contents
loading

Table of Contents