LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Date and time stamp in array

Solved!
Go to solution

Hello,

 

I am using Labview 8.0 and I would like to include a date and time stamp each time data is collected and include this as a 5th column in the final array.  I inserted a random number generator instead of devices so it would be easier to understand and test.  I am new to Labview and have never created a date/time stamp before.  Any help or advice would be appreciated.

 

Dave

0 Kudos
Message 1 of 19
(6,835 Views)
What format do you want the date time stamp. Is second since 1904 ok or do you actually want the date?
Tim
GHSP
0 Kudos
Message 2 of 19
(6,827 Views)
Here is a simple example.
Tim
GHSP
0 Kudos
Message 3 of 19
(6,820 Views)

Either format is fine, whichever is the easiest to understand would be best.  I couldn't open the example with version 8.0.  It must have been created with a later version.

 

Dave

0 Kudos
Message 4 of 19
(6,808 Views)
Solution
Accepted by topic author Dave01
Here is an 8.0 version
Tim
GHSP
Message 5 of 19
(6,800 Views)

while we are on this topic.

what does it mean by date or seconds since 1904?

why does labview uses this date?

 

Best regards,
Krispiekream
0 Kudos
Message 6 of 19
(6,795 Views)

Everyone has to pick a standard. Microsoft uses seconds since 1901. It is just a starting point but it is very important to know the differences between systems.

 

As far as the date vs. seconds since 1904, I would store the date as a string so that I could convert it to what ever I need it to be. It makes saving the data a little more difficult.

Tim
GHSP
Message 7 of 19
(6,789 Views)

The 1904 date was used by Apple.  Since LV was originally developed on the Macintosh, NI used Apple's convention.

 

Lynn 

Message 8 of 19
(6,779 Views)

This solution worked fine for saving seconds since 1904, but now that I have been using the program I would prefer to save the time as HH:MM:SS.  From what I have read, I think I need to convert to a string, but I'm just not sure how to do that.  Here is a simple version of my program.  Thank you for any suggestions or examples.

 

Dave

Version: Labview 8.0

0 Kudos
Message 9 of 19
(6,548 Views)

Yes you need to convert all to strings since the timestamp in HH:MM:SS is a string.  In the string palette, there is a sub-palette full of numeric to string conversion tools.  Use the Number to Fractional String to convert all numerical data to strings.  Use the Format/Date Time String function (found in Timing palette) to convert the timestamp to HH:MM:SS.  See the format string in my example.

 

TimeStampAssistance.png

- tbob

Inventor of the WORM Global
0 Kudos
Message 10 of 19
(6,521 Views)