BC21PushBuf
B = Buffer
C = Calculation functions
The BC21PushBuf function inserts a value into a FIFO memory. The function requires an input value in the 'NewElement' variable and puts it in the memory.
IMPLEMENTATION
BC21PushBuf (Buffer, NewElement, ErrorCode, head, tail)
Parameters:
IN/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
---|---|---|---|---|
IN | ARRGBL/ ARRSYS | Buffer | B/W/L/S | Array containing the Buffer |
IN | GLOBAL | NewElement | L/S/W/B | Variable containing the value to be placed in the buffer |
OUT | GLOBAL | ErrorCode | F | Variable containing the error possibly occurred during insertion of the value |
IN | GLOBAL / SYSTEM | head | L | Internal index |
IN | GLOBAL / SYSTEM | tail | L | Internal index |
Error
After calling the function if there are any errors the error variable (ErrorCode) takes the following values:
0 - No error
1 - Data not entered due to: full memory.
Example
Inserts the value of the reference count of a device ring buffer of each front of the “gfInsVal” flags
MAIN: IF gfInsVal gfInsVal = 0 NewElement = count:posit BC21PushBuf (Buffer, NewElement, ErrorCode, gl001, gl002) ENDIF
Note
-
Using this feature is linked to the BC21InitBuf function that initializes the memory.
-
Complementary to this function is the BC21PopBuf function that extracts a data from FIFO memory.