Specifications

1070 072 131-102 (96.08) GB
BUEP03E Protocol8-8
8.6.2 BÜP03E Receive Buffer
The Receive command continually copies data from the UART Receive
buffer into the BÜP03E Receive buffer. The user can select the size of
this BÜP03E Receive buffer by issuing the Receive command via a pa-
rameter, however the size must be within the range of 10 to 256 bytes.
Otherwise, a fault message is returned and the BÜP03E Receive buffer is
not applied.
The BÜP03E Receive buffer is managed as a ring buffer, as long as the
user does not influence the RD and WR pointers by issuing the Reset
Receive Buffer command. The first word in the defined BÜP03E Receive
buffer is reserved for the user pointer. The user pointer points to the cha-
racter which was last read in. A maximum of 254 bytes are available for
the characters. The user pointer begins with 0 (zero), although "Character
1" is in the third position in the BÜP03E Receive buffer.
+0 *User pointer
+2 Character 1 1 *RD
2 pointer
3*WR
+n Character n 4 pointer
n+1
BÜP03E receive b.
1+3 : RD and WR pointers after Reset Receive Buffer has been selec-
ted
4 : WR pointer after n-character has been read into the Receive buffer
2 : RD pointer after n-character has been read out of the Receive buffer
2+4 : Read in n-character and output to PLC
Fig. 8-4 BÜP03E — Receive buffer
The RD and WR pointers are required for internal management of the
ring buffer. These pointers are always reset with the Receive command
and can also be reset at any time by the user with the Reset Receive
Buffer command. After being reset, both pointers point to the start of the
BÜP03E Receive buffer. If n-characters are now received, the WR pointer
is increased by n-characters and points to the next free location in the
BÜP03E Receive buffer (n+1). The RD pointer points to the character
which was first received until the user has read the data with the Data
Copy command. RD and WR pointers are then equal, and (RD_Pointer-1)
defined as user pointers.
If the characters are not retrieved in time by the user, the WR pointer may
overtake the RD pointer, resulting in a loss of data. The user is informed
of a data loss when he retrieves the data with the Data Copy command. If
this fault occurs, the data is not copied into the PLC Receive buffer and
the RD and WR pointers are reset by BÜP03E. When the next Data Copy
process occurs, the characters are copied to the head of the PLC memo-
ry.