08-05-2015 11:37 PM
Hello all,
I am a little bit new to LabView, so maybe this question is trivial, but is giving me a lot of pain.
I want to continuously save a given string at two different rates; in the example provided these rates are at every 500 ms and 50 ms, in two different text files (one for each rate). I tried to use while structured loops for this purpose. When I use only one, it works fine, but when I use both of them at the same time, it seems Labview limits both paths to the lowest speed, which in this case is obviously 500 ms, and eventually I obtain two exact files with the string saved at 500 ms period.
How can I make it work?
Thanks in advance.
Solved! Go to Solution.
08-06-2015 01:29 AM
Your loops both stop after one iteration. Maybe you should keep them running until you want to stop the program. Add a proper stop condition to each.
(It almost seems that you are using "continuous run" mode where the program starts over once all code has finished. Don't! That's only a debugging tool. Use the plain run button instead.)
08-06-2015 01:46 AM
God! I knew it was simple! I did that change and everything worked magically. Thanks a lot!
08-06-2015 09:56 AM
You still have ways to go for a more reasonable code.
For example, typically you want to open the files before the loop, keep appending inside the loops, and close the files after the loop, when the program stops. Now you don't even need to set the file position inside the loops because it will automatically keep writing right after the previous write position. This is much more efficient than to open and close the file with each iteration.