LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems using automation refnum

Dear All
 
I am using a USB IO device called a "Phidget" this uses ActiveX.
 
I have a single VI which has 3 different cases depending on what I want to do with my IO device, either Open, Carry out IO or Close. My problem is that when using the "Automation Open" vi the "AutomatioN Refnum" generated only seems to be valid during that particular execution of theVI.
 
For instance say I run my vi to Open my device (and store the refnum to a local variable for later use), then later on I run my vi again to perform IO, the original automation refnum is no longer valid. I have read that this is because labview automatically closes the refnum when the vi has executed but the solution wasnt clear.
 
I really want to avoid running this vi in a loop because it handles the Open, IO and Close operations for a number of different IO devices I have in my system and my architecture menas I need to be able to use the same vi to selectivley open, close or perform IO on a given device at will.
 
Any help to get round this much appreciated.
 
thanks
 
ATE Man
 
 
0 Kudos
Message 1 of 3
(2,608 Views)
Hi ATEMan,
you can store your reference in a shift register of a loop if you use a loop you can do in the existing, if you don´t use a loop you can use an action engine (global functional variable).

Hope it helps.
Mike
0 Kudos
Message 2 of 3
(2,601 Views)

Thanks Mike

Pretty obvious now I think about it!

0 Kudos
Message 3 of 3
(2,581 Views)