LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

future action

Good Afternoon All

 

I've been having a look at the time-related vi's such as "Get Date/Time String", "Get Date/Time in Seconds" etc. and find them confusing.

 

My application is this....

 

I have a datalogger taking data from a plant...voltage...current....kWh and so on.

 

The datalogger has just gone on stream, so there has not been much data collected. The collected data will eventually be used to calculated a performance ratio of the plant....is it operating at 100%...or is it operating at 60%...that type of thing.

 

The plant operating software is LV and is running 24/7....what I would like to do is set a future date within a vi so that when that date is reached and surpassed, the data will go through some massaging process....such as mean calculation etc.

 

My research leads me to believe that using the time function vi's, I could compare the current date with the goal date, and when the goal date arrives, a vi will be activated and from then on continue to massage incoming data. (sounds like an easter egg....but no.....it's purely legitimate)

 

First question.....does this seem a reasonable approach?

 

Second question (well...a short statement first)....my trolling of the forum shows that the consensus seems to be that a conversion of the date/time is better off being converted to seconds first and then the comparison made......is this the best approach?

 

Thanks for your ongoing patience with my questions

 

Regards

Ray

0 Kudos
Message 1 of 4
(2,751 Views)

Yes that sounds reasonable (x 2).

 

Use of seconds is better, it's by far the easiest way for doing comparisons.

0 Kudos
Message 2 of 4
(2,742 Views)

Hi ray,

Simple solution to your problem is, If you are using "Get Date And Time" function, you know string format of date.

Now say after one moth from today, you want to process data from your application. You can keep one text file in which you will write

the future date. Compare this date with current date always at the start of the Application.In this way you could always change future date without changing anything in code.Smiley Happy

 

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 3 of 4
(2,740 Views)

I find the ni date/time data primitive very useful, you can compare them or do addition/subtraction dirrectly using this data type.  A simple subtraction of (goal time) - (current time) returns a double float in seconds difference between the two values.  A simple action scheduler can be constructed in minutes.

Actions scheduled can be an array of goal times and action at the time, sorting this 1d array will sort by time since it it the first field.  Do a simple comparison to see if any action time is less than the the current time if so, use a queue to queue up that action for your process.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 4
(2,712 Views)