NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass a reference or instrument handle to Subvi in Teststand

I would like to pass an insturment handle from an initialzation vi to other vis in my sequence. I am also curious on how to get a reference passed around like from a switch using switch executive.

I also have an issue where I cannot do switching in a sub vi if I initialize switching in my step in the sequence. Is there a way to get the reference for that switch initialization in order to use it in the sub vi?
0 Kudos
Message 1 of 5
(3,467 Views)
Hi,

There is a example here.

I think there is an example in the TestStand example folder.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 5
(3,460 Views)
eeWill -
Very few instument drivers can truely allow you to open separate sessions in two different processes for an instrument because each process contains information about the instrument state and this state is typically stored with the session in the DLLs memory space for each process. In addition, if you pass a session from one process to another, the session may not be valid in the second process. As instrument drivers attempt to boost performance by caching state information and protect hardware, the drivers may become for strict. I believe the NI switch drivers prevent you from getting into this problematic state by limiting the access to a driver to a single process, so when you attempt to open a session using a TestStand step and then attempt to open or use an instrument from a LabVIEW VI running in the LabVIEW development environment, you are now using two processes.

Your best options are:
1) Select either TestStand or LabVIEW to do your switching operations, not both.
2) Use both TestStand and LabVIEW to do switching operations, but ensure that you close a process session before attempting to open a session in another process.
3) Use TestStand switching, but in LabVIEW you can use TestStand's switching by passing a sequence context to LabVIEW VIs, and execute TestStand expressions against the context, i.e. context.AsPropertyObject.EvaluateEx(). The expression language supports basic switching operations like SwitchConnect, SwitchDisconnect, SwitchFindRoute, etc. Even though these function are called from LabVIEW, the operations actual occur in the TestStand process because it it executed using the TestStand API.
4) I do not suggest this one, but you can mix both TestStand and LabVIEW if you only use the LabVIEW 7.x or later runtime when performing switching operations. This works because the LabVIEW runtime is loaded under the TestStand process, however this prevents you from performing mixed switching operations when debugging TestStand called VIs in the LabVIEW developement environment.

Hope that this clarifies the issue.

Message Edited by Scott Richardson on 06-13-2005 09:44 AM

Scott Richardson
0 Kudos
Message 3 of 5
(3,442 Views)
Thank you this works well for the instrument communication that I am trying to do.
0 Kudos
Message 4 of 5
(3,434 Views)
Thank you this definitely makes sense. I had chosen to use LABview to do all of my switching and that solution works well. If I have a chance I will try to use the seqence context as you mentioned. Thank you for the information.
0 Kudos
Message 5 of 5
(3,433 Views)