Handling with VIPA data handling blocks Manual BG41/BG42/BG43
4-14 Rev. 99/49
4.1.5.2 FB4 (RECEIVE), data reception without a protocol and procedure
This data block is used for receiving data without a protocol and procedure from a peripheral piece
of equipment. For peripheral addressing please use FB 14.
The following parameters are to be transmitted when loading FB4:
Des. Format Explanation
ADR KH Building block’s absolute base address
K/DB KY Number of channels/data block number
SZ BY Write pointer
LZ BY Read pointer
ANF W Start of receiving buffer
ANZ BI Number of bytes
FEHL BY Error byte
NEUS M New start flag
Tab. 4-7: List of parameters for the loading of FB4
The following details are necessary for the abovementioned parameters:
ADR
Input the physical start address, under which the building block can be accessed
by the PLC. This start address can be set with the DIL switches S1 and S2.
In the case of peripheral addressing enter the address, which you have set with the
DIL switch S1 on the building block, into FB14. The following addresses can be
loaded: BG41: PY128-PY252, BG42 and BG43: PY128-PY248
K/DB
K= Number of channels, through which the data should be received. This channel
must be defined with the FB 100 as a general input/output interface
(without a procedure/protocol).
DB= Number of DBs, in which the data to be received is to be filed.
SZ
Write pointer: is raised by the handling block into the reception DB every time a
byte is registered. The write pointer represents an index for the reception buffer.
LZ
Read pointer: can be processed by user, if the data was processed from the
reception DB. The number of bytes received can be calculated from the difference
between the write and read pointer. Write and read pointers can be evaluated
differently depending on the requirements (see example) and must be stated by
the user. If the read pointer is not updated (or the write pointer not reset) an error
message 5 will result (buffer overflow).
ANF
Word variable, which contains the number of the first data words in the reception
DB, from the point when the received data has been filed. The data is filed in the
order of date left/date right in the receive buffer.