10-24-2015 10:02 AM
Hello everyone
10-24-2015 12:01 PM - edited 10-24-2015 12:17 PM
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:
10-25-2015 04:07 AM
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".
10-25-2015 10:09 AM
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.
10-25-2015 12:39 PM
Crosspost from German LabVIEW Forum!
10-26-2015 03:52 AM - edited 10-26-2015 03:55 AM
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.
10-26-2015 10:45 AM
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).
10-27-2015 12:47 PM
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
10-27-2015 01:19 PM
10-27-2015 01:29 PM
Thanks Altenbach. I will try to change it