From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i know if an IMAQdx session is open or not?

Solved!
Go to solution

I, me again. Smiley Very Happy

I would like to know if there is a way to know if an IMAQdx session is already open or not. I made a subVI that manages the imaging part of a more complex software. My problem is simple: I need to open and close the IMAQdx session. If I do this every time my VI is called i get a delay of a few seconds and I do not really like this. So I thought that I could open the session the first time that my VI is called, use it with the session already open the other times, and close it when the main program requires it, perhaps through a boolean flag.

 

Thank you,

 

Francesco.

0 Kudos
Message 1 of 4
(2,628 Views)

We have an application where we take intermittent videos (3-7 seconds at a time) several times per hour (triggered by an external event) for over two hours.  We open the IMAQdx session when the program starts, pass the Refnum around, and close it when the program exits.  Note that the camera is running all this time -- we just aren't saving the images except when we want to.  Makes the code much simpler.

 

BS

0 Kudos
Message 2 of 4
(2,611 Views)

Yes, i agree with you that the code is much more simpler and cleaner like you suggest. Unfortunately i do not decide the architecture of the application and i need to follow the specification.

 

Thank you anyway! Smiley Wink

0 Kudos
Message 3 of 4
(2,599 Views)
Solution
Accepted by topic author FM82

I found a solution. I used the "Not A Number/Path/Refnum?" function on the "Comparison" palette. If the session is not open yet the function return "true" else it return "false". Much simpler than what i thought!

Message 4 of 4
(2,592 Views)