NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Comparing the actual time in teststand

I want to set a volume on my DUT based on the time of the day:

 I set a Locals.CurrentTime = Time()

Well if I put the if statement:

Locals.CurrentTime >= "6:00:00 AM" && Locals.CurrentTime <= "6:00:00 PM"

and the time is 7:00 AM - this statement returns false....

 

Can someone clarify how to do this?

 

 

0 Kudos
Message 1 of 2
(3,067 Views)

One way would be to get the hours and minutes of the day and then compare to the minutes since midnight.

Time(True,Locals.hour,Locals.minute)

Locals.MinutesSinceMidnight=Locals.hour*60+Locals.minute

Locals.TimeGood=Locals.MinutesSinceMidnight>=360 && Locals.MinutesSinceMidnight<=1080

 

You could change this to do seconds since midnight.

 

Pulido Technologies LLC

0 Kudos
Message 2 of 2
(3,051 Views)