LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run subvi in the background and be able to press buttons and change values on the main VI

Hello,

 

I am writing a program where I am reading out images from a camera. This is done by a SubVI. While I am doing that, I would like to be able to change parameters, which are located on the main VI. However as soon as I start the SubVi, the Main VI window is frozen and I can't change anything. I searched for a solution and I found that two parallel structures could be the solution. I tried this, but it does not seem to work (see attached picture). Can someone help me with this? Thanks!

 

Laurent 

0 Kudos
Message 1 of 5
(2,416 Views)

Why not run the camera in a second loop?

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 5
(2,401 Views)

Maybe try to play around with "Start Asynchronous Call"?

There is also a property node that allows similar behaviour but i forgot the name...

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

You should NOT have two event structures. Only one loop should have the event structure, handling the user interface. The other loop should be whatever needs to be running continuously. I would suggest looking at the producer-consumer and master-slave programming architectures so you learn what this means.

 

An alternative is to launch the VI dynamically using the VI server. And before you ask, this has been shown MANY times in this forum, so please search. You can also look at the LabVIEW examples.

0 Kudos
Message 4 of 5
(2,391 Views)

Hmmm... indeed... having two event structure can (not always though) be dangerous.

 

In you case, having 2 loops or launching the acquisition VI as a parallel process is possible but I'm not sure it is necessary, let me suggest this type of architecture (more simple than parallel processes, if it doesn't suite your needs then we'll talk about another architecture.

 

Example_VI_BD.png

 

This PNG is a snippet, you can download the PNG file onto your computer and drag it into you block diagram to have the code.

 

Hope this helps


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 5 of 5
(2,388 Views)