DNx-SL-514 Synchronous Serial Interface Board
Chapter 3
25
Programming with the Low-Level API
May 2018
www.ueidaq.com
508.921.4600
© Copyright 2018
United Electronic Industries, Inc.
3.3.5
Reading
Received
Master Data
Each master port on the SL-514 has a 2048 FIFO for holding data that was
received and for optionally holding timestamps associated with each piece of
data.
The FIFO can be read using the
DqAdv514ReadFIFO()
API.
DqAdv514ReadFIFO(
int hd,
// Handle to IOM received from DqOpenIOM()
int devn,
// Board device # inside the IOM chassis
int chan,
// Channel to be configured
int flags,
// <Reserved>
int size,
// maximum receive buffer size
uint32* buffer,
// Pointer to the array for receive data
int* retrieved,
// Number of data words retrieved from the FIFO
int* available,
// Amount of free space in FIFO
uint32* status);
// Status of board
The
size
parameter limits the number of samples that will be copied into the
receive
buffer.
The maximum allowed value is
DQ_PL_601_LISTSZ
(350),
which is the maximum number allowed in a packet.
The status parameter that is returned represents the status of the one channel
programmed with this function (
chan
).
Alternatively, the
DqAdv514Status()
API reads status conditions from all
channels listed in a bitmask of channels. Refer to Section 3.3.6 for more
information about reading status and for a list of status conditions that can be
read from channels.
3.3.6
Reading
Status
The
DqAdv514Status()
API is used to read channel status. This API allows
you to read status information from one or more channels at a time.
DqAdv514Status(
int hd,
// Handle to IOM received from DqOpenIOM()
int devn,
// Board device # inside the IOM chassis
int channel_mask, // Bitmask of channels:
// “1” to capture status information,
// and “0” to ignore.
pL514_STATUS status);// Pointer to store array of L514_STATUS
// 1 for each channel enabled in channel_mask
The
channel_mask
parameter identifies which channels you will read. For
example,
channel_mask=0x9;
will read status on channel 0 and channel 3.
The returned
status
parameter is an array. For example, if your
channel_mask
indicates 2 channels, you will receive an array of 2.
for a list of status values returned, and refer to Section 1.7.4
on page 11 for additional descriptions of error conditions and status bits.
Status bits are returned as type
pL514_STATUS.
The
pL514_STATUS
structure consists of two elements:
// SSI channel status