Syntax
Syntax
viClose(int vi);
Description
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. Failure to close VISA objects will result in memory and resource leaks.
Parameters
Name |
Dir |
Type |
Description |
vi |
IN |
int |
Unique logical identifier of a session, event, or find list. |
Return Values
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). |
C# Example
public void CloseSession(int session) { visa32.viClose(session); }
VB .NET Example
Public Sub CloseSession(ByVal session As Integer) visa32.viClose(session) End Sub