LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting date time string to double data

I have to plot a bar chart. The VI accepts only 2-d double data. My X- axis is date timestamp and Y- axis is the double data.

Bt I am unable to convert the timestamp value to double.

Anyone can suggest anything ?

 

 

 

Regards,

Runjhun.

0 Kudos
Message 1 of 15
(6,986 Views)

Hi Runjhun,

 

try this:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 15
(6,984 Views)

Hey I've already tried this method bt isn't working. The double value is "3.40116E+9" which is not I want.

Anything else.

 

 

Regards.

Runjhun

0 Kudos
Message 3 of 15
(6,977 Views)

Hi RJ,

 

so what do you want?

 

The timestamp stores it's value as seconds starting from 1.1.1904 (or so), so you can expect numbers above 3.4e9 nowadays...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(6,963 Views)

Bt I dnt want it in this format.

I want to plot my bar graph with X-axis as the timestamp value.

Now I can't give timestamp data as input, the input can only be in double format.

How do I do that ?

 

Runjhun.

0 Kudos
Message 5 of 15
(6,955 Views)

Hi RJ,

 

use the DBL value as given by above snippet. Format the x-axis to show time (absolute) and you're done.

Or read the help for the graph...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 15
(6,945 Views)

Thnx a lot.

Bt still I cudn't get any solution on this.

The thing is the graph I want to plot is in an Excel sheet.

 The Excel Plot Graph function (which is available in RGT) takes only 2-d double array as input data.

I cudn't figure out how to pass this timestamp as double data in the same format.

 

 

 

Runjhun.

0 Kudos
Message 7 of 15
(6,933 Views)

Hi Rj,

 

why don't you tell this in the first post?

 

Next hint:

Maybe you don't want "timestamp" as given by LabVIEW, but the elapsed time instead? And heck, there's a function with this name... (Or you simply store the first timestamp of your measurement und subtract it from all following timestamps to get the elapsed time...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 15
(6,919 Views)

I do not use Excel very often but let me point out two things.  Excel uses a different Epoch than LabVIEW (1900 versus 1904), and expects time to be in fractional days instead of fractional seconds.

 

So you can easily coerce the timestamp to DBL for fractional seconds, divide by 86400 for fractional days, and figure out the offset to handle the different epochs.  Pass this to your bar graph.  You will have to tell Excel to format the cells as time, for that you are on your own.

0 Kudos
Message 9 of 15
(6,907 Views)

Thnx a lot Darin.

Bt may be I should be more clear with my reqmts.

In the image attached the data to be plotted is stored in Excel from LabVIEW.

And the graph is plotted in Excel selecting the data.

Plotting of graph is maual.

I want that the graph plotting should be automatic.

In RGT der's a function Excel Plot Graph bt the problem is dat it takes only 2d double array as I mentioned earlier.

May be dis wil make my problem clearer.


Regards,

Runjhun A.

0 Kudos
Message 10 of 15
(6,892 Views)