Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:software:qview:qview_6:qcl_library:bc21pushbuf [2017/02/07 17:42] – created qem103en:software:qview:qview_6:qcl_library:bc21pushbuf [2019/08/29 17:01] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== 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/ |Array containing the Buffer|
 +|  IN  |  GLOBAL  |  NewElement  |  L/S/W/ |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
 +
 +<code QCL>
 +MAIN:                 
 +      IF gfInsVal
 +            gfInsVal = 0
 +            NewElement = count:posit
 +            BC21PushBuf (Buffer, NewElement, ErrorCode, gl001, gl002)
 +      ENDIF
 +</code>
 +
 +=== 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.