NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How does Session Manager work?

Is anyone else using Session Manager? It is a relatively new tool. I think it came out with TestStand 2.0. It is used to manage instrument handles. At first I thought it would allow us to share handles between Labview and CVI (the documentation hints at this) but after reading the fine print I found that it cannot share handles that run in different processes (i.e. Labview and CVI). It is still useful because it keeps a handle open so that a new handle does not need to be opened everytime TestStand calls a Labview or CVI module. Unfortunately, the only documentation for Session Manager is a help file. There is no reference to it in the TestStand documentation, although there are a couple of examples in the TestStand\Examples directory. I
find that I need to experiment with Session Manager to figure out how it behaves. In particular, I'm trying to figure out how it works with a mix of Labview and CVI modules being called from TestStand. Does anyone know of any app notes or other documentation explaining the proper use of Session Manager?
0 Kudos
Message 1 of 4
(3,933 Views)
Mark,

Unfotunately the only help available is the help file of the Session Manager and the TS examples.

You mentioned that Session Manager cannot share handles between processes. In fact, Session Manager is capable of sharing handles between processes, it is the C DLL drivers that are not capable of sharing their handles between processes. There are some ActiveX instrument drivers out there that are capable of sharing their ActiveX session handles between processes, and more ActiveX instrument drivers are due for release. With these drivers, the Session Manager will be able to manage the instrument handles between different processes.

Because of the limitation of C style DLL drivers, you cannot create a instrument handle in a VI called by TS and use the handle in a DLL called by TestStand. The VI is executed in a LabVIEW process while the DLL is called in the Sequence Editor or you operator interface process. There are 2 solutions to overcome this limitation. Both are based in running the VI and DLL in the same process:

1) You can have your operator interface written in LabVIEW. When you build you operator interface into an executable, you can configure the LV adapter in TestStand to use the LV opeator interface to run the VIs that your sequence calls (see NIDZ document "Overview of Distributing TestStand when your Sequences use the LabVIEW Standard Prototype Adapter"). In this case both the DLLs and VIs called by your sequence will be executed in the same process and can share C DLL instrument handles.

2) You can build your VIs into DLLs using LV 6.0 or later. You can then configure your sequence to call these DLLs instead of calling the VIs. This means rewriting your sequence to use the DLL Flexible adapter to call the LV DLL instead of using the LV adapter to call your VIs. In this case your LV DLLs and other DLLs called by your sequence are executed in the same process and can share C DLL instrument handles.

Are there specific questions that you have regarding the Session Manager? Perhaps your questions can lead to examples and App Notes. There have not been very many questions regarding to the Session Manager so it is difficult to determine what customers need.
0 Kudos
Message 2 of 4
(3,933 Views)
One suggestion I have for Session Manager is to add something to MAX for editing VISA and VXIPNP logical names. I would like to use only logical names in my applications, but currently that means that I need to use MAX (or edit ivi.ini directly) to setup IVI logical names, then edit NISessionManager.ini for the VISA and VXIPNP logical names.
0 Kudos
Message 4 of 4
(3,933 Views)
The Session Manager server was created to assist in the development of the IVI step types that ship with TestStand 2.0. The server allows the step types to only reference the logical name and get returned the handle associated with it. The only available documentation is the help file.

The current support for IVI specification only allows for handles to be shared in process, so the session manager cannot go beyond this limitation. Because of this limitation you cannot use an out of process version of LabVIEW to run your tests that use IVI handles and share those handles with CVI modules called from the TestStand engine process. If and when in the future IVI supports COM, this limitation may go away and the Session Manager will support "multi-process" handles
.

You can share handles between LabVIEW and CVI modules if and only if the LabVIEW VIs executes in the same process as the CVI modules. This typically limits you to either running the LabVIEW Operator Interface under LabVIEW, or using any OI but you must create LabVIEW DLLs and calling them using the DLL Adapter.

Hope this helps...

Scott Richardson
scott.richardson@ni.com
Scott Richardson
0 Kudos
Message 3 of 4
(3,933 Views)