LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keeping automation refs open

I have been trying to store some automation refs in LV6.1 globals, but when the VI is stopped then re-run the reference is no longer valid. It seems LabVIEW is destroying the objects between runs.

My VIs are going to be run in TestStand 2.1 and I plan to configure the instruments in one sequence then use them in another. I hope to keep various sub-refs (measurement objects etc) open between sequences, how can this be achieved? I tried adding more automation opens and setting the "open new instance" boolean input to FALSE on the consecutive automation opens, that does not work. I guess I could try holding the refs in TestStand, but to save time and head ache, has anyone worked around this before?

Any help much appreciated.

LV6.1, TS
2.1, NT4 - controlling Agilent PNA E8358A using 835x.tlb
Certified LabVIEW Architect
0 Kudos
Message 1 of 4
(2,749 Views)
Are you trying to keep open an automation ref to a VI or an instrument handle? Instrument handles need to be kept open by TestStand and there's an example - \Examples\SessionMgr\LV\LVDmm.seq that demonstrates this with an IVI instrument. Also, with the more recent versions of VISA, you don't need a VISA Open to create a reference. VISA Write and Read accept resource names (i.e. "GPIB::2" or an alias) and automatically create a reference if one doesn't exist. There's probably some time penalty but but it makes the coding easy.
0 Kudos
Message 2 of 4
(2,747 Views)
Yes I'm trying to keep an automation ref to an instrument open. I'll keep it open in TestStand and not LabVIEW, thanks for the guidance.
Certified LabVIEW Architect
0 Kudos
Message 3 of 4
(2,747 Views)
I'm running into the same problem, but I don't have the option of doing this through TestStand. I'm controlling a device in Labview 7.0 through a serial port using ActiveX automation and I want to keep the connection open while I open and close subvis. There is, indeed, a significant time penalty if I try it the way you suggest, and obviously there's a time penalty if I have to keep opening and closing the connection. Is there another way?
0 Kudos
Message 4 of 4
(2,747 Views)