Discussion:
Two timed loops separate but connected
(too old to reply)
wkamin
2008-08-13 17:10:07 UTC
Permalink
Hi, I have a simple Data Acquisition setup where I read 32 voltages, and write them to file.  I want my front panel to update the displayed voltages every 2 seconds, but only want the same values to be written to file every 5 minutes. I've tried nesting one timed loop in another, but the displayed values update at the same time interval as the write to file (Write-to-file loop nested in main timed loop).  I've also tried creating one timed loop for the display (2 second interval) and a separate timed loop for the write to file (5 min interval).  However, while the display updates, the write to file does not work. I just want two timers working simultaneously, but one gets data from the other after 5 minutes. Sorry if this is a repeat post, but I couldn't find answers elsewhere. Thanks in advance,Walter Kaminski
Robst
2008-08-13 17:40:08 UTC
Permalink
Hello: You can use a single while loop an a couple instances of the Elapsed Time Express VI. You configure it to send you a boolean true when the time you specify elapses. Then configure one of them for 2 seconds and the other one for 300 (5 minutes). Use the output "Elapsed Time?" to control the selector of a case structure so that when the time elapses, the action you want executes. I attached a small example. Let me know if it helps. Robst.


Time Intervals.vi:
http://forums.ni.com/ni/attachments/ni/170/349066/1/Time Intervals.vi


time invervals.JPG:
http://forums.ni.com/ni/attachments/ni/170/349066/2/time invervals.JPG
wkamin
2008-08-13 19:10:07 UTC
Permalink
Thanks a lot.  Got it working right away.

Continue reading on narkive:
Loading...