TestStand 2019 Help
»View Product Info
This example demonstrates how to use NI Session Manager to share named instrument handles between LabVIEW code modules. Refer to the NI Session Manager Help. located in <Program Files>\National Instruments\Shared\Session Manager, for more information about how to use Session Manager.
Example File Location
<TestStand Public>\Examples\Interfacing with Hardware\Session Manager\LabVIEW\Session Manager.seq
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 from the National Instruments Device Driver DVD that comes with TestStand:
- 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.
||Note Class drivers launch simulation dialog boxes if interactive simulation is enabled. These dialog boxes might not have taskbar items and can go behind the sequence editor. In addition, the IVI soft front panels remain visible until you close the Execution window.
Effectively Using LabVIEW with TestStand
Session Manager Support for 64-bit TestStand