en:software:qview:qview_6:qcl_library:bc21popbuf

This translation is older than the original page and might be outdated. See what has changed.

BC21PopBuf

B = Buffer

C = Calculation functions

The BC21PopBuf functionm extracts a value from a FIFO memory. FIFO memory is implemented using a variable of array type.

BC21PopBuf (array, Element, ErrorCode, head, tail)

Parameters:

IN/OUTVARIABLE TYPEEXAMPLE NAMEDIM
IN ARRGBL / ARRSYS Buffer B/W/L/S Array containing the Buffer
OUT GLOBAL Element L/S / W / B 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
IN GLOBAL / SYSTEM head L Internal index
IN GLOBAL / SYSTEM tail L Internal index

After calling the function if there are any errors the error (ErrorCode) variable takes the following values:
0 - No error, extract data
1 - The FIFO memory is empty

Example

Extracts a data by the buffer queue and places it in the variable “glDato” at every front of the “gfEstrai” variable

MAIN:                 
      IF gfExtract
             gfExtract = 0
             BC21PopBuf (Buffer, Element, ErrorCode, gl001, gl002)
               IF NOT ErrorCode
                   glDato = Element
               ENDIF
      ENDIF

Note

  • The use of this function is linked to the BC21InitBuf function that initializes the buffer and that must be called at least once before the BC20PushBuf function.
  • Complementary to this function is the BC21PushBuf function who places a data in the FIFO memory.
  • Last modified: 2019/08/29 17:01