Differences

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

Link to this comparison view

en:software:qview:qview_6:qcl_library:bc10pushbuf [2017/02/07 17:14] – created qem103en:software:qview:qview_6:qcl_library:bc10pushbuf [2019/08/29 17:01] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== BC10PushBuf ======
 +
 +**B = **//Buffer//
 +
 +**C = **//Calculation functions//
 +
 +The BC10PushBuf function __inserts a value into a circular buffer__. The function requires an input value in the '**NewElement**' variable and enters it in the buffer in a location that is unknown to the user and that is managed solely by the push function and complementary pop function.
 +
 +===== IMPLEMENTATION =====
 +
 +**BC10PushBuf (Buffer, NewElement, ErrorCode)**
 +
 +Parameters:
 +
 +^IN/OUT^VARIABLE TYPE^EXAMPLE NAME^DIM^^
 +|  IN  |  ARRSYS  |  Buffer  |  B/W/L/ |Array containing the Buffer|
 +|  IN  |  GLOBAL  |  NewElement  |  L/S  |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|
 +
 +==== Error ====
 +
 +After calling the function if there are any errors the error variable (ErrorCode) takes the following values:\\
 +0 - No error\\
 +1 - Full Buffer
 +
 +=== Example ===
 +
 +Inserts the value of the reference count of a device in the ring buffer in front of each "gfInsVal" flags
 +
 +<code QCL>
 +MAIN:                 
 +    IF gfInsVal
 +         gfInsVal = 0
 +         NewElement = count:posit
 +         BC10PushBuf (Buffer, NewElement, ErrorCode)**
 +    ENDIF
 +</code>
 +
 +=== Note ===
 +
 +  *Using this feature is linked to the function **BC10InitBuf** that initializes the buffer and that must be called at least once before the BC10PushBuf function. 
 +  *Complementary to this function is the **BC10PopBuf** function that extracts che estrae a data by the circular buffer queue.