
Chapter 6
NI-FBUS Function Reference
NI-FBUS Hardware and Software User Manual
6-10
ni.com
nifGetInterfaceList
Purpose
Reads the list of interface names from the NI-FBUS Communications Manager configuration.
Format
nifError_t
nifGetInterfaceList(
nifDesc_t ud,
int16 *numIntf,
nifInterfaceInfo_t *info)
Input
ud
A valid session descriptor.
numIntf
The number of buffers for interface information reserved in
info
.
Output
numIntf
The actual number of names returned.
info
An array of structures containing the interface name and device ID
for each interface.
Context
Not applicable.
Description
nifGetInterfaceList
returns the interface name and device ID of each Fieldbus interface.
The
numIntf
parameter is an IN/OUT parameter. On input, it must contain the number of
buffers that info allocates and points to, and on output it contains the total number of interface
information entries available. If enough buffers were not allocated, or if the
info
buffer is
NULL, the NI-FBUS Communications Manager returns an error and does not copy any data
to the buffers. In this case, the
numIntf
parameter is still valid.
To determine how many list items are to be returned in the call, call the function twice. The
first time you call the function, set the
numIntf
parameter to 0. The function will return an
error stating that there were not enough buffers configured, and it will return a new number
for
numIntf
. Use this new
numIntf
parameter to allocate memory for the data. When you
call the function the second time, use this new parameter. By doing so, you will allocate only
as much memory as necessary.