03-02-2013 07:35 AM
Hi!
I have built this vi to log data from two air velocity sensors and the analog signals that drive two actuators.My problem is: Whatever number of iterations I set at the second frame, the same number of iterations will occur at the third frame. At the example below I initially set the loop to run for 20 seconds and the second loop to run for 3 minutes. When I run the program both loops ryn for 20 seconds. Any hints?
Regards
Solved! Go to Solution.
03-02-2013 07:47 AM
03-02-2013 08:19 AM
Thanks, it works! I tried to run it also having removed the sequence but some things, such as the message output after data have been collected, pop up as soon as I press start. I have to do a bit of reading about order of execution. Thanks again.
03-02-2013 11:52 AM - edited 03-02-2013 04:47 PM
You have a lot of duplicate code, for example the two FOR loops only seem to differ by a few inputs. Using a state machine architecture, you should be able to use a single instance of the inner code (at the same time eliminating the local variables).
Use one while loop, one instance of the inner code and switch state according to the iteration. Start out with five states (write header|steady state|step up|show message|idle) and go from there. Have a look at the design templates.
03-03-2013 05:56 AM - edited 03-03-2013 05:56 AM
Hello altenbach and thank you for your advice! I will try this, it is definitely going to be useful for the one I'm logging data from numerous sensors!
Regards