niModInst_OpenInstalledDevicesSession

ModInst

niModInst_OpenInstalledDevicesSession

Specific Function

C Function Prototype

ViStatus niModInst_OpenInstalledDevicesSession (ViConstString driver, ViSession* handle, ViInt32* deviceCount);

Description

Creates a handle to a list of installed devices supported by the specified driver. Call this function and pass in the name of a National Instruments instrument driver, such as "NI-SCOPE". This function searches the system and constructs a list of all the installed devices that are supported by that driver, and then returns both a handle to this list and the number of devices found. The handle is used with other functions to query for attributes such as device name and model, and to safely discard the list when finished.

Note   This handle reflects the system state when the handle is created (that is, when you call this function). If you remove devices from the system or rename them in Measurement & Automation Explorer (MAX), this handle may not refer to an accurate list of devices. You should destroy the handle using niModInst_CloseInstalledDevicesSession and create a new handle using this function.

Parameters

Name Type Description
driver ViConstString A string specifying the driver whose supported devices you want to find. This string is not case-sensitive. Some examples are:

NI-SCOPE
niScope

NI-FGEN
niFgen

NI-HSDIO
niHSDIO

NI-DMM
niDMM

NI-SWITCH
niSwitch

Note  If you use the empty string for this parameter, NI-ModInst creates a list of all Modular Instruments devices installed in the system.
handle ViSession* A pointer to a ViSession variable that receives the value of the NI-ModInst session handle. This value acts as a handle to the list of installed devices and is used in other NI-ModInst functions.
deviceCount ViInt32* A pointer to an integer variable that receives the number of devices found in the system that are supported by the driver specified in the driver parameter.

Return Value