BC10PopBuf
B = Buffer
C = Calculation functions
The BC10PopBuf function extracts a value from a ring buffer. Each time the latter function makes sure to extract from the circular buffer queue the first data entered and than place it in a variable.
IMPLEMENTATION
BC10PopBuf (Buffer, Element, ErrorCode)
Parameters:
IN/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
---|---|---|---|---|
IN | ARRSYS | Buffer | B/W/L/S | Array containing the Buffer |
OUT | GLOBAL | Element | L/S | Variable on which you place the value retrieved from the buffer |
OUT | GLOBAL | ErrorCode | F | Variable containing the error possibly occurred during insertion of the value |
Error
After calling the function if there are any errors the error variable (ErrorCode) take the following values:
0 - No error
1 - Empty Buffer
Example
Extracts an data by the buffer queue and puts it in the “glDato” variable each front of the “gfExtract” variable
MAIN: IF gfExtract gfExtract = 0 BC10PopBuf (Buffer, Element, ErrorCode) IF NOT ErrorCode glDato = Element ENDIF ENDIF
Note
-
Using this feature is linked to the BC10InitBuf function that initializes the buffer and that must be called at least once before the BC10PushBuf function.
-
Complementary to this function is the BC10PushBuf function who places a data in a ring buffer queue.