Communications Mode
7.7
Receiving a Message Frame from a Peripheral Device (A080
The CPU can receive up to 256 bytes with a single job request. This data is referred to as a message
frame in the following.
S5-CPU
Receive
message
frame
Figure 7-12. Receiving a Message from a Peripheral Device
The CP 523 receives message frames from the peripheral device via a serial interface and stores
them in the Receive mailbox. A maximum of 99 message frames with a total length of 1024
bytes can be stored there.
When the CP 523 is receiving message frames from the peripheral device, it can simultaneously
•
Receive a message frame from the CPU
•
Send a message frame to the CPU
The CP outputs message frames to the CPU in the order in which they were received from the
peripheral device. The CP 523 transfers new data from the Receive mailbox to the transfer
memory if the CPU has written the relevant data into word 0 of the transfer memory.
Data transfer between the CPU and the CP is always initiated by the CPU with "Coordinate
data transfer for receiving a message frame" request. As coordination information, the CP 523
indicates if there are message frames in the Receive mailbox (bit 7 = "1"). The CPU can also
fetch message frames from the CP which have been fragmented because the character delay
time (ZVZ) was exceeded. In these cases, all data received up until the instant of error is
forwarded as message frame to the CPU (except in 3964(R) mode, in which case the error is
flagged in the CBR).
The CP 523 transfers the following to the CPU, together with the coordination information:
•
The length (in bytes) of the next message frame in word 2
•
The number of message blocks in the next message frame in byte 6
•
The number of message frames in the Receive mailbox in byte 7
If a message frame has been received, the CPU can read it out in message blocks of eight bytes.
The next two pages contain a graphic representation of this procedure.
•
"Receive message frame" flowchart
•
Transfer memory assignments from the user program and from the CP 523 for a Receive
request.
Note:
The statement list of the "RECEIVE" function block is explained in 8.2. The function block is a
user-friendly interface for handling "Receive message frame". Use of the function block is also
explained in 8.2.
7-72
CP 523
Transfer
memory
8 bytes
Internal bus
Serial
interface
Receive mail-
box 1K bytes
EWA 4NEB 811 6044-02a
CP 523
)
H
Peripheral
device
Send
message
frame