LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set up a While Loop that will execute for a precise number of minutes?

I am relatively new to LabVIEW and wondered what function / structure I should use to execute a section code for a pre selected number of minutes.
 
I need to create some software that reads data via the serial port of an Infusion device. I have set up the read/write section but without any time parameters. I want the user to be able to select the length of the test which will normally be 1-2 hours and so I need the read/write code to execute for exactly this time period.  At the moment it is in a normal Do While loop and executes until I press the stop button.
 
Any advice would be greatfully received 🙂
0 Kudos
Message 1 of 4
(2,772 Views)
Hi lizimunro
after read and write your data you can check the actual run time and compare with defined run time. see attached example.
Mike
0 Kudos
Message 2 of 4
(2,753 Views)
Hi,
You could use the elapsed time express vi. I have attached a simple VI which shows the operation.
Have fun!



Message Edited by Kabul on 02-14-2008 12:15 PM
0 Kudos
Message 3 of 4
(2,747 Views)

Thanks, I will try and see if checking the time at the end works. I did try the elapsed time function within the loop but I wanted it to countdown constantly on the front panel and I guess because I was reading and writing it was going slow and only updated the front panel every so often. It also seemed to run for several seconds longer than I had specified.

Of course it could just be me!

0 Kudos
Message 4 of 4
(2,740 Views)