Session Manager - LabVIEW
- Updated2025-03-28
- 2 minute(s) read
Purpose
This example demonstrates how to use NI Session Manager to share named instrument handles between LabVIEW code modules.
Example File
Location
<TestStand Public>\Examples\Interfacing with Hardware\Session Manager\LabVIEW\Session Manager.seq
Highlighted Features
- IVI
- NI Session Manager
Major API
None
Prerequisites
You must complete the following steps before you can run this example.
- Ensure that you have the LabVIEW development system installed and you configure the LabVIEW Adapter to use the LabVIEW development system.
- Install the following software:
- Measurement & Automation Explorer (MAX)
- IVI Compliance Package, including the LabVIEW Support portion of the IVI Class Drivers
- Complete the following steps to download and install an IVI-compliant instrument driver for the IVI DMM class that the example can use, such as hp34401a.
- Refer to the Instrument Driver Network at ni.com/idnet.
- Search for the manufacturer or the type of instrument you want to download. In MAX, the driver installer automatically creates a driver session entry under the Driver Sessions item and populates the software module information under the Instrument Driver Software Module item in the Advanced folder.
- Complete the following steps to create a logical name for the session.
- In MAX, expand the IVI Drivers category.
- Right-click the Logical Names item in the configuration tree and select Create New from the context menu.
- Complete the configuration panel for the new logical name, which is "SampleDMM". Logical names are case-sensitive. In the Driver Session control, specify the driver session you downloaded.
How to Use This Example
The Get DMM Session step obtains a reference to the session named "SampleDMM", which the Locals.logicalName local variable specifies. When the step creates the session, Session Manager initializes the instrument session and the step stores the reference in the DMM_Reference local variable so the session must continue to exist until the sequence completes.
The remaining steps in the sequence call code modules. Each code module calls Session Manager and obtains the instrument handle for the session the Locals.logicalName local variable specifies. Because the Get DMM Session step ensures that the session exists for the life of the sequence, each module uses the same session and the instrument initializes and closes only once.