Chapter 9 Deployment CPU 21xSER-1 Manual VIPA CPU 21x
9-14 HB103E - Rev. 05/45
Communication
The communication happens via the send and receive blocks SFC 217
(SER_SND) and SFC 218 (SER_RCV).
If data is transferred by means of a protocol, the embedding of the data
into the according protocol happens automatically. Depending on the
protocol you have to regard the following aspects
With ASCII res. STX/ETX the sending of the data happens without
acknowledgement of the partner.
Another call of the SFC 217 SER_SND provides you via RetVal with a
return value which contains among others recent information about the
acknowledgement of the partner.
Sending happens with acknowledgement of the partner. Another call of the
SFC 217 SER_SND provides you via RetVal with a return value which
contains among others recent information about the acknowledgement of
the partner. After the transfer with SER_Send you receive the
acknowledgement telegram of the partner by calling the SFC 218
SER_RCV.
Note!
Please regard that the SFC 216 is not called again during a communication
because as a result of this all buffers are cleared.
This block allows to send data via the serial interface.
Name Declaration Type Comment
DataPtr IN ANY Pointer to Data Buffer for sending data
DataLen OUT WORD Length of data to send
RetVal OUT WORD Error Code ( 0 = OK )
Here you define a range of the type Pointer for the send buffer where the
data that has to be send is stored. You have to set type, start and length.
Example: Data is stored in DB5 starting at 0.0 with a length of 124Byte.
DataPtr:=P#DB5.DBX0.0 BYTE 124
Word where the number of sent bytes is stored.
At STX/ETX and 3964R, the length set in DataPtr or 0 is entered.
At ASCII, the value may be different from the sent length when the data is
sent that fast that not all data can be stored in the send buffer of 256Byte.
Overview
ASCII
STX/ETX
3964R
Modbus master
USS
SFC 217
(SER_SND)
DataPtr
DataLen