Chapter 6
NI-FBUS Function Reference
NI-FBUS Hardware and Software User Manual
6-2
ni.com
nifClose
Purpose
Closes an open descriptor.
Format
nifError_t
nifClose(
nifDesc_t ud);
Input
ud
The descriptor from an
nifOpen
call.
Output
Not applicable.
Context
Block, VFD, physical device, link, session.
Description
nifClose
closes the specified descriptor. The descriptor is invalid after it is closed. Ensure
that your application closes all of the descriptors it opens. Your application should always
close a descriptor if it no longer needs the descriptor.
If you close a descriptor with calls pending on it, the calls complete within the usual time,
but an error code is returned indicating that you closed the descriptor prematurely. If
you make more synchronous wait calls that wait on the closing descriptor, such as
,
, the
NI-FBUS Communications Manager aborts these functions and returns an error code
indicating that you closed the descriptor. Since calls that wait on a closed descriptor return an
error message, you should have a separate descriptor for these synchronous wait calls.
Note
A
session
is a connection between your application and an NI-FBUS entity. If you
close a session, you close the communication channel between your application and the
NI-FBUS entity associated with the session. Ensure that you close all descriptors opened
under this session before closing a session descriptor.