From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing VISA resource names between steps

Solved!
Go to solution

If multiple calls to a piece of test equipment need to be made in multiple TestStand steps, what is the best practice for passing them?

1. close the resource after each step and reopen with a new INIT VI each time in later steps?

close resource.PNG

2. Pass out the resource:

pass out resource.PNG

and save it in two TestStand variables for use in later steps?

pass out resource TS.PNG

 

3. Anything else?

 

Thanks.

0 Kudos
Message 1 of 6
(4,313 Views)

Personally I like to initialize my instruments in the setup portion of the sequence and close the connection in cleanup section of the sequence. I keep my references in a variable as you have shown and use them throughout my sequence. 

 

I had a common problem with my operators where they would forget to turn on a required power supply and I would capture the error code in a LabVIEW step which would fire off a user dialog asking them if they had turned it on. If they had I would tell them to contact a technician for help. If they had forgot I would display a image showing them how-to and rerun the initialization step for the power supply. This saved me a bunch of time running back and forth to the test stations and saved my operators the embarrassment. 

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 2 of 6
(4,283 Views)

Having 2 variables to enter (device name and session number) for the VISA resource as an input to every single TestStand step in which it is needed is a bit of a pain. Can't I just pass in the VISA string to the step instead? I'll get the coercion dot...

 

VISA as string.PNG

0 Kudos
Message 3 of 6
(4,231 Views)

I am using "HAL in your (D)QMH" way. walkingthewires.com and delacor.com

It requires some time invest, but is worthy.

I control 3 PSs, 2 El Loads, 2 DAQs, 2 Telnet devices.

All modules started in Setup, and stopped in Cleanup, and hold their VISA resources by themselves.

You just send values and read values.

 

0 Kudos
Message 4 of 6
(4,226 Views)
Solution
Accepted by stephenb2

You don't need to pass two variables (device name and session number) for your code modules. You can pass VISA reference via LabVIEWIOControl variable tyope, which is indeed container of device name and session number. To create it, right-click (let's say, in FileGlobals field), select Insert File Global -> Type -> LabVIEW -> LabVIEWIOControl.

There you can write VISA reference directly from code module, and then pass it in. Then, fields Device Name, Session Number will be populated automatically. Please, check the screenshot.

LabVIEWIOControl Type.PNG

On your first screenshot, you've just removed value of the main field, and fields Device Name and Session Number became active.

 

Sincerely, kosist90

 

logos_middle.jpg

 

Check out new features and changes in LabVIEW 2017!

Message 5 of 6
(4,198 Views)

Thank you! That was exactly what I was looking for.

0 Kudos
Message 6 of 6
(4,176 Views)