LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loops and saving problems

Solved!
Go to solution

Hey,

 

I am having a problem saving my data. I have a program that simulates a tap. Essentially a certain voltage will trigger the data to be collected. To present it to everyone in this forum I have just simulated this effect. If the button is turned on then it will pseudo randomly trigger the first inside loop. 

 

Here starts the problem. When the first inside loop is triggered the graphs show the resulting data and a box pops up asking if you want to save this data. Well everything time I click yes it won't save.Then the next time the first inside loop is triggered the save dialog box pops up to save the current data. It is really weird. If you want to see what I am talking aobut please run the program and click yes you want to save a couple times and I think you will start to understand my problem. 

 

Essentially I want to be able to see the results of the data and decide if I want to save it or not. If I choose yes then I would like to name the file path.

 

I have looked at this for hours and can't come to any conclusion why this is happening. Maybe a flow or loop issue?

 

Please note, the outside loop should always be on to keep the program continuous.

 

Thanks for any help on this

0 Kudos
Message 1 of 7
(3,087 Views)

Your query will pop up regardless of if the first loop has stopped or not. To make sure it waits for the first loop you'll need to place it in a small sequence frame which also wires the data through. That way it'll wait until the 1st loop is finished.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 7
(3,066 Views)
Solution
Accepted by topic author Hova

Thanks a lot! worked like a charm. Don't know why i didn't think of it earlier. 

0 Kudos
Message 3 of 7
(3,029 Views)

If you don't want to clutter your diagram with sequence frames, you could also place one of the inputs to the dialog (e.g. the "Yes" diagram constant)  inside the inner loop. This will also prevent it from executing until the inner loop is complete. 😉

Message 4 of 7
(3,019 Views)

 

 

 

0 Kudos
Message 5 of 7
(3,011 Views)

 


@Hova wrote:


 

There are only two while loops: the outer loop and the inner loop. Why are you confused?

@Hova wrote:


NOOO!!! You are incorrect. The execution order is completely independent of the diagram coordinates.
The important word is "data dependency". In your code, the dialog and the while loop can execute in parallel, because they do not depend on each other. If you would place any of the inputs to the dialog inside the inner loop (e.g. as in the picture), the dialog now depends on data from the while loop and thus cannot start until the loop has finished.
Play around with execution highlighting to get a better feel for all that. 😉

 

You can un-mark the solution via the options menu of the post. Have you tried?

0 Kudos
Message 6 of 7
(3,004 Views)

@Hova wrote:

 

 

 


Go to the Options menu to the upper right of your message that you marked as the solution and pick "Unmark as solution".  Then you can pick Yamaeda's message as the solution.

0 Kudos
Message 7 of 7
(2,957 Views)