Chapter 6
NI-FBUS Function Reference
©
National Instruments Corporation
6-41
NI-FBUS Hardware and Software User Manual
For object codes
ODT_STRUCTTYPE
,
ODT_SIMPLEVAR
,
ODT_ARRAY
, and
ODT_RECORD
, the
list of elements in
allElements
contains the
typeIndex
and the size of each component
element. For example, the following fragment of pseudocode gets the type information for a
structured object and does something with the type information for each element:
nifObjTypeList_t typeInfo;
nifDesc_t aiBlock;
int loop;
...
nifGetObjectType(aiBlock, "OUT", &typeInfo);
for (loop=0; loop < typeInfo.numElems; loop++)
{
doSomethingWithElement(typeInfo.allElems[loop]);
}
For variable list objects (type
ODT_VARLIST
), you must call
nifGetObjectType
for each
element in the list of elements with the
typeIndex
of the element returned in the list with
the first
nifGetObjectType
call. The
typeIndex
of the element returned in the list in this
case is the relative index of the element within the block, whose name is returned by
blockTag
. These subsequent calls to
nifGetObjectType
should use the
NIFB_INDEX
macro to specify the
typeIndex
returned by the first call.
Table 6-3.
Object Codes for the
nifObjTypeList_t
Data Structure
Object
Object Code in
fbtypes.h
Domain
ODT_DOMAIN
Program Invocation
ODT_PI
Event
ODT_EVENT
Data Type
ODT_SIMPLETYPE
Data Type Structure Description
ODT_STRUCTTYPE
Simple Variable
ODT_SIMPLEVAR
Array
ODT_ARRAY
Record
ODT_RECORD
Variable List
ODT_VARLIST