ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Long term countdown timer

I am writing a test that will have an event occur six months from starting and they want a countdown to be displayed on the screen.

 

I have a simple count down timer and looked at some of the examples here but these seem to be geard fo hours and minutes.

 

I have always found workgin with time displays confusing in LV

 

I need a count down to display months, days, hours, minutes, and seconds.

 

 

 

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 33
(7,697 Views)

Something like this?  This just does a single calculation, without seconds, but it should be obvious how add in seconds and put it in a continuous loop.  It might have some issues around daylight savings time or leap years, I haven't checked thoroughly.

 

Message Edited by nathand on 04-16-2009 02:27 PM
Download All
Message 2 of 33
(7,677 Views)

Thank you that should get me going.

 

I have another question about working with time in LV

 

When you subtract time it coerces the time and outputs a double

 

But if you attempt to add time you get broken arrow?

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 33
(7,658 Views)

RTSLVU wrote:

When you subtract time it coerces the time and outputs a double

 

But if you attempt to add time you get broken arrow?

 


What meaning would it have to add April 14th to July 8th?

0 Kudos
Message 4 of 33
(7,656 Views)

nathand wrote:

RTSLVU wrote:

When you subtract time it coerces the time and outputs a double

 

But if you attempt to add time you get broken arrow?

 


What meaning would it have to add April 14th to July 8th?


Ok then how would I say add 6 months 4 hours to 1:02PM April 14 2009?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 33
(7,653 Views)

RTSLVU wrote:

Ok then how would I say add 6 months 4 hours to 1:02PM April 14 2009?


You would use a VI like this.  I just hacked this together based on my reply to a similar question in another thread, there might be some errors around leap years or daylight savings time or other corner cases that I haven't checked.

It's useful to know that a LabVIEW timestamp is essentially a count of seconds since some specific date (midnight January 4, 1904, if I remember correctly), so you can add seconds, hours and days easily.  Months are harder because they may have variable numbers of days.  In general you can treat a timestamp like any other numeric value.  LabVIEW's Date/Time to Seconds and Seconds to Date/Time functions, used in this VI, do the necessary conversion between a number of seconds and an actual date and time (taking into account leap years, daylight savings time, and local time zone).
Message Edited by nathand on 04-16-2009 04:29 PM
Message Edited by nathand on 04-16-2009 04:33 PM
Download All
0 Kudos
Message 6 of 33
(7,644 Views)

Sorry about the broken image, I swapped the hours and days on the first upload and just missed the message edit cut-off time to put in the new image, here it is:

 

0 Kudos
Message 7 of 33
(7,635 Views)

Hello everyone

 

i am doing a database using excel and labview.

I am able to get the updated date( like the date after 7 days maximum)

but now i want the status automatically

 

the excel file is like this

 

date of borrowal   time of borrowal    equipment info   student id    date of returned    status

                                                                                                                          this one i did

 

if it is already 7 days and the person dont cme to return the equipment, the status should be alarmed

i dont know how to do it. anybody can help please.

 

i really want help please.

 

0 Kudos
Message 8 of 33
(6,416 Views)

Are you looking for something like this?

time.png

0 Kudos
Message 9 of 33
(6,381 Views)

hmmmm  exactly. only like if that person didnt returned the equipment, it should be alarmed. .. i dont know how to add that to my VI

 

like i put in here as in the snapshot

 

date of borrowal: 24/03/2014

time of borrowal: 1.16

equipment specification:

Studnt ID : 

date of returned : ( i put a delay of 7). 31/03/2014

status: only this one i need help. how to make it automatic like when the date of 31 is reached.

it should be alarmed ( or put a notification)

 

0 Kudos
Message 10 of 33
(6,373 Views)