LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data to time stamp

Hi.


I have a problem, I have the time data in one excel file, one cell contains the value that correspond to the hours, another the minutes, another the seconds, I want to get this data in labview in this form 00:00:00:000. Is it possible to do? 

 

I tried to do with the tools in the timing menu, but I did not get it.

 

I attached some images from my excel file and my code.

 

Thanks.

 

 

Download All
0 Kudos
Message 1 of 10
(2,740 Views)

Hi Leon,

 

attaching real VIs instead of large picture is appreciated in the forum…

 

Once you have read your data from Excel worksheet you can convert it to LabVIEW timestamp:

Beispiel_VI_BD.png

You can configure the display format of the timestamp to your needs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(2,727 Views)

Hi Gerdw:

 

I tried that solution, but the problem is that the data from excel is being save in arrays of double 64 bits, when I create the cluster, the program indicate an error.

 

The type of the source is 2-D array of
    double [64-bit real (~15 digit precision)].
The type of the sink is double [64-bit real (~15 digit precision)].

0 Kudos
Message 3 of 10
(2,701 Views)

@Leon27 wrote:

Hi Gerdw:

 

I tried that solution, but the problem is that the data from excel is being save in arrays of double 64 bits, when I create the cluster, the program indicate an error.

 

The type of the source is 2-D array of
    double [64-bit real (~15 digit precision)].
The type of the sink is double [64-bit real (~15 digit precision)].


Again post a VI it will help.

 

Why do you have a 2D array anyway?  Is one or more dimension only have a single row/column?  If so how are the cells formatted?

Message 4 of 10
(2,693 Views)

I attached the vi and one excel example.

 

In this case, I obtained a Cluster with fractional seconds, secondd, minutes and hours but I did not obtain the time stamp.

 

In the Data/time to seconds appears a red point, Can someone explain me what it means?.

 

Thanks for your help.

 

 

 

Download All
0 Kudos
Message 5 of 10
(2,680 Views)

Look at the vi i think it will do what you want in formating the time stamp from your spreedsheets....

 

si tienes duda contactame...

 

CLAD, CTD
Message 6 of 10
(2,658 Views)

2012 version

CLAD, CTD
Message 7 of 10
(2,625 Views)

Hi buton,

 

your FOR loop can be cleaned up to this:

Data_BD.png

- Why don't you use IndexArray before the loop to index the needed row? (For columns you need to wire a constant.)

- Why do you convert your data to a matrix to be able to index the upper left element? Why not use IndexArray instead?

- Why do you convert numbers to strings to be able to use FormatIntoString? Why not do all with FIS?

- Your concatenation of a full date & time string will only work for US-american regional settings…

- Why not put all relevant data (including day, month, year) into the timedate record?

 

Addition:

- By moving the indicators outside the loop you will receive arrays of timestamps. Seems more appropriate when reading full columns from Excel…

 

@Leon:

Those red dots are named Coercion Dots!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 10
(2,618 Views)

@GerW

 

The loop was already there when i opened the file.. i just helped him with the date thing.

 

theres a lot of improvement that could be done to that loop. and GerW  you did a great job explaining and redoing the code 🙂

CLAD, CTD
Message 9 of 10
(2,613 Views)

Hi,

 

Thanks a lot for your help.

 

Buton and Gerdw.

 

 

0 Kudos
Message 10 of 10
(2,607 Views)