11-16-2008
09:15 PM
- last edited on
11-17-2008
01:38 PM
by
Support
hey guys
after gathering lots of suggestiong from you, im almost done with my vi.
i need one more thing i havent been able to do so. i have a counter on my vi (the one from the FOR LOOP) that runs from 1 to 15 and starts over. i need my vi to completly stop when that counter gets to 15. i tried a while loop that compares the counter to 15 and returns a boolean value to stop the program but i couldnt get it to work.
here is a zip with my vi file and a measurement file to test it. i will really appreciate if someone could help me with this simple issue.
thanks!
Solved! Go to Solution.
11-16-2008 09:38 PM
11-16-2008 09:48 PM - edited 11-16-2008 09:51 PM
hello
thanks for your reply
im running the vi without the WHILE LOOP and indeed, the counter goes from 0 to 14. i was running it continously so thats why it never stopped. thanks for that one.
final question: is there any way to place a RUN ONCE button in the front panel and a reset button that zeros my 2 numeric indicators?
thanks!
11-16-2008 09:51 PM
You don't ever want to use the Run Continuously button unless you are doing something like debugging a VI.
Why don't you use the Run button that is on the toolbar???? (It is right next to Run Continuously)
11-16-2008 09:52 PM
Hi
If i get your question right, you wish to control the number of times the FOR loop iterates?
Might be you should change the constant wired to 'N' of the For Loop to a control, and run the counter.
If i got your question wrong, please explain what you mean by Run Once control on F.P
Good luck
11-16-2008 09:52 PM
11-16-2008 10:13 PM
indeed the RUN CONTINOUSLY is not recommended. from now on im gonna use the RUN ONCE from the toolbar. i was just wondering if theres any way to place a RUN button on my front panel.
regarding the numeric indicators im using, is there any way to reset them with a button or something??. the only way i know is to right click on each of them, go to data operations and click on reinitialize to default value.i was thinking in a button that could reset all of them.
thanks
11-16-2008 10:18 PM
You will still have to hit the run button on the toolbar, unless you set the properties to run automatically when opened.
You can create an initialization portion of your program (perhaps the 1st frame of a flat sequence,while your current code is in the next frame) that sets controls using local variables to whatever you want. You can also create a while loop with a small wait statement that ends once the "front panel run button" is pressed, then the rest of your code will follow. An event structure would be an even better choice.
11-16-2008 10:32 PM
thanks a lot!
will take your ideas into account