Prefix_close

IVI Library

Prefix_close

ViStatus Prefix_close (ViSession vi);

Purpose

When you are finished using an instrument driver session, you must call the Prefix_close function. Prefix_close performs the following actions.

  • Closes the instrument I/O session.
  • Destroys the IVI session and all of its attributes.
  • Deallocates any memory resources used by the IVI session.

You might also want to put the instrument into an idle state before closing the I/O session. For example, a switch driver might disconnect all switches.

Parameter

Input
Name Type Description
vi ViSession Unique identifier for an IVI session.

Implementation Requirements

First call Ivi_LockSession to lock the IVI session.

Call Prefix_IviClose.

Call Ivi_UnlockSession to unlock the IVI session.

Finally, call Ivi_Dispose on the IVI session. It is very important to unlock the IVI session before calling Ivi_Dispose.

Ivi_Dispose destroys the instrument driver session and all of its attributes. It also deallocates any memory blocks that you associated with the session when you called Ivi_Alloc or Ivi_RangeTableNew. Prefix_IviClose performs all the other clean-up operations.

Return Values

Contains the status code that the function call returns. IVI engine functions can return error and warning values from several sets of status codes. Some status codes are unique to the IVI engine. Other status codes are the same codes that VISA Library functions return. Still others are error or warning values that functions in specific instrument drivers return. Each set of status codes has its own numeric range.

Regardless of the source of the status code, 0 always indicates success, a positive value indicates a warning, and a negative value indicates an error.

Related Topic

IVI Status Codes