10-18-2010 10:43 PM
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
Solved! Go to Solution.
10-19-2010 03:46 AM
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
10-20-2010 10:17 PM
Thanks a lot! worked like a charm. Don't know why i didn't think of it earlier.
10-21-2010 12:24 AM
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. 😉
10-21-2010 12:39 AM
@ altenbach which inner loop are you referring to? the one on the far left? Can you explain why that would work? If I am correct, in Labview flow moves top left to bottom right correct? Would I have to put the yes diagram in the bottom right of that loop?
@ Yamaeda sorry I meant to mark your post as the solution however I accidently clicked on my post. oops... can I fix that?
10-21-2010 02:27 AM - edited 10-21-2010 02:29 AM
@Hova wrote:
altenbach which inner loop are you referring to?
There are only two while loops: the outer loop and the inner loop. Why are you confused?
@Hova wrote:
... in Labview flow moves top left to bottom right correct?
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?
10-21-2010 10:49 PM
@Hova wrote:
Yamaeda sorry I meant to mark your post as the solution however I accidently clicked on my post. oops... can I fix that?
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.