NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I write the current date to a global using the date function

I'm trying to store the execution date of a calibration sequence into a global variable.  I'm using the following statement: Date()=SationGlobals.current_date, where current_date is a string.  It does not seem to be working. 
 
 
0 Kudos
Message 1 of 4
(3,471 Views)

Hey Bill,

flip the assignment like this: StationGlobals.current_date = Date()

In your example you are trying to store what's in the current_date to Date() which is not possible.  The left hand side gets assigned the value of the right hand side.

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 4
(3,464 Views)

Using this current date string variable I would like to set a limit on the date stamp to expire. ie if the date is longer than 14 days I would like to do something in my program. What would be the easiest way to do this using the date string variable obtained from  station_global_Date = Date(). How would this comparison be done in test stand.

Thanks 

0 Kudos
Message 3 of 4
(3,136 Views)

Hi Mdcoco,

 

I would recommend using the RunState.Root.Locals.StartDate function, set the StartDate to equal the date you want your 14-day count to begin, then you can set up an if then equation in which Teststand will compare the StartDate with the Station_global_Date you are referring to and if 14 days has passed, it will perform a certain action. Hope this helps!

 

Regards,

Jackie

DAQ Product Marketing Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,077 Views)