NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass a VISA session handle to a Sub sequence

I'm having issuse passing session handles to sub sequences.    When I initize the SMU200A through the GPIB using their VIs, everthing is fine.  The sub sequence complete the other vi calls.  When I use a parent sequence to initize, and store the session as a Global, I get invaild session handle errors  

0 Kudos
Message 1 of 5
(3,065 Views)

Instead of using VISA, you can use string instead of VISA session. I'm not sure which global you use, but if you use fileglobals, you need to write to it via ActiveX, https://decibel.ni.com/content/docs/DOC-5501.

0 Kudos
Message 2 of 5
(3,055 Views)

Is it possible for you to attach your sequence so we can see what you're doing?

0 Kudos
Message 3 of 5
(3,048 Views)

My philosophy is that everything for the LabVIEW iterfaces should stay in LabVIEW.  To accomplish this, I make all of my drivers Action Engines.  This way you don't have to pass your VISA session around TestStand.  You just have your VIs get the reference from the functional global variable or have the Action Engine do all of the work.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(3,036 Views)

@crossrulz wrote:

My philosophy is that everything for the LabVIEW iterfaces should stay in LabVIEW.  To accomplish this, I make all of my drivers Action Engines.  This way you don't have to pass your VISA session around TestStand.  You just have your VIs get the reference from the functional global variable or have the Action Engine do all of the work.


Be a bit cautious with that.  I WHOLELY agree that TestStand should not know the slightest thing about the IO Session to any hardware.  In fact using a AE to encapsulate every call to any specific device is often a tremendous advantage when it comes time to integrate the code or troubleshoot a test system that is missbehaving (Got broken)  Just open up your AE's (Resource Modules in my lexicon) and establish any static system state while you stick your meter wherever as needed (or run yor measurement method.)

 

The point you need to be careful on is keeping the SR in memory!  So, w a t c h your load and unload options.  Some places love to play with the TS models and make life hard on integrators and techs by unloading modules in the Pre-UUT Loop (Where any sane developer will put the init methods to the equipment)  I've even had to resort to including this snip in "Initialize everything.vi" to keep the private data in the memory of the application instance the sequence executes in.  (Grrrr.... that can get annoying).  especially when you remember that you need to explicitly CLOSE those FP's too to exit politely

!0.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(3,003 Views)