LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing DAQmx Task in a Functional Global variable

Happy New Year to everyone!
 
I got a nice little question hoping some of you might be able to help me....
 
After initializing an starting a DAQmx task (V7.5), I wanted to store the task out reference in a functional global variable, but it seems, it didn't work.
Everytime I tried to call a DAQmx VI with the opened reference, I get an error, the task would not be existing....
 
I already made a workaround, so everything works fine. I'm just curious what I made wrong....
 
Thanks in advance!
 
Cheers
Oli
0 Kudos
Message 1 of 2
(3,249 Views)
Helo Oli,

Normally, you should not have a problem storing a task reference in a variable. However, the vi that created the task has to stay in memory for it to work. Closing the vi will result in the destruction of all created hadles - that is why your reference might be regarded invalid if you use it in another vi.

That is why I can just assume that you are closing the VI that created the task before you are using the handle somewhere else. You can use variables to store the task ID, but as a workaround you have to keep the vi which reated the reference running.

Hope this explains the behaviour.
Regards


Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 2 of 2
(3,236 Views)