LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run the program for specified time

Dear Friends,

 

I have a small problem, I want to run my labview program for specified amount of time, Say for example it might be 1 hour or 5 hours or 10 minutes or even milliseconds(The time will be specified by the user).

How to write programs for this

 

And I want to get the system time in an instance, how it can be achieved,

 

Could you please help me?

 

 

 

 

 

Regards,

Rathan

0 Kudos
Message 1 of 5
(3,448 Views)

Hi Rathan,

you can use the "Get Date/Time in Seconds" function to get the system time. How complex is your program? You can use a parallel running queue with a timeout connected which represents your run time. If the queue timed out you can quit all other tasks to exit your program.

 

Mike

Message 2 of 5
(3,442 Views)

Hello,

 

         Can you post a picture of your VI. You can use the timeout functions as my friend has said. there are yet other alternatives too... But it needs understanding of your VI .. 

 

Regards,

Nizy... 

0 Kudos
Message 3 of 5
(3,425 Views)

hi..

 u can use timestamp function to get the system time...

also to run a program for specified time u can use elaped time function which will give the output after the specified time will elapsed.it will be in boolean...

so that can be used to stop youe while loop if you are using it in program.

0 Kudos
Message 4 of 5
(3,417 Views)

Hi,

 

Herewith my screenshot attached. There are thre inputs thres, tempX, xValue, it is in side the while loop.'xValue' will be acquired every iteration, It will be saved through shift register and acquired to 'tempX' for the next iteration, 'thres' is a constant value. I'm doing some logic, and calculating the dvalue and convert it to a string and concatenate it with end of line character, then after writing it into a file.

In the logic, inside of the functional logic  I'm assigning some values dValue, if the logic is true or else dvalue will be 0

What I require is I don't want to write the dValue in to a file, if it is equal to zero. Could you please help me, how to tackle this problem?

 

 

Thanks.

 

 

Regards,

Rathan   

 

 

 

 

 

0 Kudos
Message 5 of 5
(3,369 Views)