NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Open & Close a LabVIEW VISA Session in TestStand

Hi!

 

I am trying to possibly add the VISA Open Function/vi (& VISA Close Function/vi) as a LabVIEW Action Step in the file path of the step's Module tab in TestStand. I can't seem to find these functions as a stand-alone VI in any of the LabVIEW (2009) folders. I would think that they exist in their low-level form since you can access the icons in LabVIEW via the Functions palette in the Instrument I/O --> VISA --> VISA Advanced pane?

 

My goal is to simply Open & Close a VISA session in TestStand.

 

If someone knows the answer, it would be appreciated. 

 

 

0 Kudos
Message 1 of 6
(5,934 Views)

You can give these custom steps a try, use the session manager, or write your own steps that call the VISA functions. I did this a few years ago but cannot find the source code. It only did a generic read and write and did not have options to open and close since I did both each time. It's not a difficult task and you might like creating custom steps - that is all that I use.

Message 2 of 6
(5,931 Views)

Hi,

 

I think you can't call the LabVIEW VISA Open from a step because it is a LabVIEW primitive, not a VI.

 

Thanks to something Dennis Knutson told me years ago, I generally don't use VISA Open. I just use steps with LabVIEW VIs that contain VISA Reads and Writes. The Open happens automatically and there is zero extra execution time this way. I usually use VISA Close as a VI containing just the VISA Close at the end of the test, inside Cleanup, etc.

 

If you put a Close inside of each LabVIEW step, then when you pause the sequence you can connect to the instrument with a separate application for troubleshootig if needed. Once again, absolutely no time penalty for opening an closing within each step for VISA. There can be big penalties for some ActiveX and other types of Open-Close instruments.

cc

Message 3 of 6
(5,918 Views)
Thank you for code...I will check it out!
0 Kudos
Message 4 of 6
(5,904 Views)

dowNow,

 

I'm not sure how you "harness/extract" the VISA Close function (as a VI?) within a LabVIEW step in TestStand as you mention? As you say, the VISA Open is a LabVIEW primitive, so isn't the VISA Close also a primitive (not a VI)?

 

Thanks! 

0 Kudos
Message 5 of 6
(5,903 Views)

Fyi. The problem appears to be fixed. I inserted an "Easy VISA Write.vi" Action step inside Cleanup. I was using IVI and VISA sessions within the same Sequence file to communicate to a DMM. I sequentially opened & closed the IVI session and then proceeded to use the Easy VISA Write.vi to open & close the VISA session.

 

Thanks for your support! 

 

 

0 Kudos
Message 6 of 6
(5,893 Views)