LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Message box stops VI running in Background

Hello everyone

I'm working on a project and  I wants to boot a valve. The process takes 10 seconds and the user shall get a message that the valve starts and show message box.
1. Now I have a problem after I press start button a message box but the valve moves only high after the box goes away. Can i programm the displays a message box and parallel valve starts up?
2. I wish that the process start from starting and so many time how much number i put?
 
Many thanks
0 Kudos
Message 1 of 11
(3,986 Views)

I see a lot of very questionable code (deeply stacked structures, too many local variables, serious race conditions, greedy loops, unneeded sequences etc*), but I don't see the code for any message box. Can you point us to it? (Or are you talking about error popups generated inside the system VIs?).

 

Popups are typically modal, so you simply need to ensure that they are called in parallel (or complete immediately while leaving the panel open, for example) so the code can continue. Maybe an informational string indicator on the main panel is preferrable over a popup?


@Rashkrash wrote:

2. I wish that the process start from starting and so many time how much number i put?

 

Sorry, I don't understand your second question at all. Can you explain. Everything typically starts from starting, whatever that means. Where do you put a number?

 


* examples of code problems:

  • "Dritte": If you would eliminate the delta_P_Q_i local and would wire from the indicator wire nearby, you could eliminate the sequence structure because execution order will be determined by dataflow
  • "Dritte": Race onditions with stoppp2: most likely the one guiding the state selection in the right will be read before the inner FOR loop event starts, so if the code is stopped while the inner code is executing, you'll go to the wrong state afterwards. same problem in "Erste" and "zweite". Delete the outer local and wire from the one inside the loop to enforce proper order.
  • The lone outside sequence at the bottom makes no sense.
  • The inner loop in "zweite" uses 100% CPU doing nothing relly useful. Slow it down!
  • Why is "i 6" double instead of I32?
  • ...

 

 

0 Kudos
Message 2 of 11
(3,952 Views)

Thanks Altenbach for your answer.

The problem is by "State-Machine" "Erste" there i want that the user should get a popup message and in background the valve shoild drive up. But in my case  if i put the popup window should close after 10 sec and valve shoild go up for 15 sec. Than what happen is the window close after 10 sec and than after the valve move up only 5 sec.

 

To my second point

"Dritte" should run "i6" time. "i6" is been asked in "erste".

 

 

0 Kudos
Message 3 of 11
(3,910 Views)

Are you talking about "Warten_VI_Neu.vi"? You did not include that so we don't know if it is a popup or not or what it does. Maybe you could simply place the contents of that case structure outside the inner while loop so both can run in parallel. It still guarantees that the main code cannot proceed to "zweite" before both the inner while loop and the popup have finished.

 

We need to see the code of the subVI to decide. Why are you calling it multiple times, once per iteration of the inner loop (or as long as "start Ventil" is true). Since the "erste" state cannot be reached unless "start ventil" is true, and your switch has "switch until released" boolean actiion, the outcome is very unpredictable. When "Erste" is reached, it could (1) already be FALSE the first time the local variable is read or (2) it could be TRUE for a few iterations, making the code very unpredictable. Of course if there is a popup, the user needs to release the boolean, but it all seems very fragile. "Switch until released" is very rarely the right choice, so don't use that!

 

Yes, the function of "I 6" is clear, it is just not clear why it is not an integer.

 

You still need to address all other serious code flaws as already explained.

 

 

0 Kudos
Message 4 of 11
(3,867 Views)

Crosspost from German LabVIEW Forum!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 11
(3,850 Views)

Hello Rashkrash

 

attached a littel example in this i used a asynchronous call and forget function to call my dialog.

 

You have to implement such additional function to make a transfer between the dialog and the

state machine so the can talk and synchronice each other. For this a queue or a FGV can be used.

 

Hope it helps.

best regards
Alexander
0 Kudos
Message 6 of 11
(3,804 Views)

The way I understood it, the popup should just run in parallel to the code if the currest state. The next state requires the output of the subVI, so a completely asynchronous call would be problematic. I think it is sufficient to place the popup outside the inner while loop of that state.

 

(Sorry, currently don't have access to LabVIEW, so I cannot look at your suggestion).

0 Kudos
Message 7 of 11
(3,732 Views)

Thanks Altenbach for your help. But i used Producer and consumer. But now i am having some other problem.

- My stop Button doesent work and some time start button works and some time not.

Can someone find my mistake. 

Thanks

Download All
0 Kudos
Message 8 of 11
(3,684 Views)
  • You still have tons of serious race conditions.
  • Why are you now using value property nodes everywhere?
  • You have event structures inside case structures, so they are not guaranteed to be reachable by dataflow to service the event, yet they lock the front panel until the event completes. That's not good!
  • You still have serious architectural problems with loops inside cases, inside loops, etc. ad infinitum.
0 Kudos
Message 9 of 11
(3,663 Views)

Thanks Altenbach. I will try to change it

0 Kudos
Message 10 of 11
(3,657 Views)