viClose
Syntax
viClose(ViSession/ViEvent/ViFindList vi);
Description
This function closes the specified resource manager session, device session, find list (returned from the viFindRsrc function), or event context (returned from the viWaitOnEvent function, or passed to an event handler). In this process, all the data structures that had been allocated for the specified vi are freed.
Note: The viClose function should not be called from within an event handler. In VISA 1.1 and greater, viClose (VI_NULL) returns VI_WARN_NULL_OBJECT rather than an error.
Parameters
Name |
Dir |
Type |
Description |
vi |
IN |
ViSession |
Unique logical identifier to a session, event, or find list. |
Return Values
Type ViStatus |
This is the function return status. It returns either a completion code or an error code as follows. |
Completion Codes |
Description |
VI_SUCCESS |
Operation completed successfully. |
VI_WARN_NULL_OBJECT |
The specified object reference is uninitialized. |
Error Codes |
Description |
VI_ERROR_CLOSING_FAILED |
Unable to deallocate the previously allocated data structures corresponding to this session or object reference. |
VI_ERROR_INV_SESSION |
The given session or object reference is invalid (both are the same value). |
See Also
viOpen, viFindRsrc, viWaitOnEvent, viEventHandler