LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubVI Front Panel flashes instead of staying up

Solved!
Go to solution

Hey all,

 

I'm reading data from a scale in a producer/consumer structure. In the consumer loop I have the data feeding into a subVI with a special front panel.

 

I want the front panel to show when I run the program and to stay up until I'm done. However, it flashes on and off with each loop iteration. Can someone tell me what I'm doing wrong?

 

For my subVI node setup, I just have "Open front panel when loaded" checked.

 

Here's my code:

Scale_to_sub_vi.PNG

_____________________________

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

What is in the sub-vi ?

Is there a while loop?


If there is nothing in the while that will keep code runing in the sub-vi, then the sub-vi will close once the code is finished executing.

 

One thing you can do, is to take the while loop and the queue function inside the sub-vi.

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

Yeah, there's no loop inside the subVI. When I put a loop in it, the numerical indicator wouldn't update for some reason.

 

When you say take the queue and the loop inside the function, what do you mean?

_____________________________

0 Kudos
Message 3 of 5
(2,116 Views)
Solution
Accepted by topic author Matub

In your main vi you have two loops, one of them calling the sub-vi.

If you take that loop, and instead place it in the sub-vi plus the dequeue function.

So that your sub-vi will have its current code in the while with the dequeue function.

And the connector pane will only have a queue reference as a input.

The you can call your modified sub-vi directly in you main vi, without a while loop around it, connect the queue refence to the sub-vi, and you are good to go.

Message 4 of 5
(2,112 Views)

That worked! Thank you. I could kiss you, but instead here's some Kudos. 😄

_____________________________

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