NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine current time

How can I determine the current time in Teststand?  After determining the time, I want to do a comparison to a time that I have saved as a StationGlobals variable and then execute a set of tasks.  Is there any function in Teststand to do this time comparison?

0 Kudos
Message 1 of 6
(11,021 Views)

Open the expression browser (click one of the f(x) buttons).

 

Goto the Operators/Functions tab and navigate to Function/Time. There is Time(), Date(), and Seconds(). You probably want Seconds().

 

You can also call a code module you write to obtain time values from your development environment specific libraries.

 

- James

 

Message 2 of 6
(11,015 Views)

Is there any function to compare the time you have entered with the system determined time from Time (), or do you have to compare user-entered time vs. system time from Time() as strings?

0 Kudos
Message 3 of 6
(11,011 Views)

Sorry, there isn't a comparison. You'll have to write your own or use time functions from your code module development libraries.

Message 4 of 6
(11,009 Views)

Can I extract the hours and minutes only from the Time () function? I don't want the seconds. 

0 Kudos
Message 5 of 6
(11,005 Views)

All the parameters to Time are optional, so you could just specify the first three and omit seconds, milliseconds, etc...

Message 6 of 6
(11,000 Views)