55
7.47 Reading and Converting Data from the FIFO
Data packets are copied from the FIFO to the target memory and converted. The "cnt" parameter indicates the number of
entries to be copied from the FIFO. If the FIFO contains fewer data records, the entire content of the FIFO is copied. The
number of entries actually copied is returned via the "entries" parameter. The function waits until at least one data record has
been copied from the FIFO, though no longer than expiration of the timeout. In this case, zero is returned to "entries". Entire
data packets are always copied from the FIFO. The target memory must be at least big enough to take the indicated number
of FIFO entries. The content of an entry corresponds to the currently configured data packet without the appended "fill
bytes." All data words are saved in the standard format for 16-bit or 32-bit integers and the position values are converted to
the ENCODER_POSITION format.
Function
EIB7_ERR EIB7ReadFIFOData ( EIB7_HANDLE eib,
void* data,
unsigned long cnt,
unsigned long* entries,
long timeout
)
Parameters
eib EIB handle
data [return code] Pointer to target memory
cnt Number of entries to be read (>= 0)
entries [return code] Number of entries to be copied
timeout Timeout in milliseconds
timeout Description
0 Function returns immediately if no data is
present
>0 Function waits for data for x milliseconds
–1 Function waits indefinitely
Return code
The return code delivers a status for the function call. In addition to the standard return codes, the following error messages
can occur.
EIB7_FIFOEmpty No data in the FIFO
EIB7_ElementSizeInv Internal error
EIB7_FIFOOverflow FIFO overflow since the function was last called (data was lost)
7.48 Reading the Size of a FIFO Element Following Conversion
The size of a FIFO element is generated following conversion. This value corresponds to the size of a FIFO entry, which is
read using the EIB7ReadFIFOData() function. A FIFO element contains a data packet whose size depends on the present
configuration. The size is given without "fill bytes."
Function
EIB7_ERR EIB7SizeOfFIFOEntry ( EIB7_HANDLE eib,
unsigned long* size
)
Parameters
eib EIB handle
size [return code] Pointer to the variable for the size of a FIFO element in bytes
Return code
The return code delivers a status for the function call. All potential values are listed for the standard return codes.