08-10-2009 04:27 AM
Solved! Go to Solution.
08-10-2009 04:33 AM
Hi ssteel,
i can't open your vi at the moment, but as you said you can use the i terminal. To know the iterations you should add 1 to it. I starts with 0.
Mike
08-11-2009 05:55 AM
Hi Ssteel,
Just some additional observations/tips on your code...
1. I notice that you have a standard stop button going into a "run if true" stop condition of the while loop. In this cercumstance it is common to have the stop condition set as "stop if true". You can change this by right clicking the stop terminal and enabling the "stop if true" property. Obviously, it somewhat depends on your design preferences.
2. If you have any issues with the application, perhaps you notice that it is taking over your processor resources, you should add some execution timing into the while loop. You will find the timing functions in the block diagrams functions palette (programming > timing). The Wait (or "wait until next ms") functions will provide your application with "down time", which means that the processor can execute other tasks.
3. To elaborate what MikeS81 correctly stated, insert an incriment before the numeric indicator as shown below to get the actual number of cycles (i.e. the count terminal of the "while" and "for" loops are 0 indexed). Also note that I have changed the representation of the count to interger (blue). You do not need floating point precion when displaying the inciment count, at a while loop can only execute a "whole number" of times.
I hope this has been useful to you Ssteel.
Thanks for your post,