03-20-2014 03:18 PM
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.
03-20-2014 03:25 PM
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:
You can configure the display format of the timestamp to your needs…
03-20-2014 05:41 PM
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)].
03-20-2014 05:53 PM
@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?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-20-2014 06:51 PM
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.
03-20-2014 10:09 PM
Look at the vi i think it will do what you want in formating the time stamp from your spreedsheets....
si tienes duda contactame...
03-21-2014 09:46 AM
2012 version
03-21-2014 10:08 AM - edited 03-21-2014 10:09 AM
Hi buton,
your FOR loop can be cleaned up to this:
- 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!
03-21-2014 10:13 AM
@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 🙂
03-21-2014 11:16 AM
Hi,
Thanks a lot for your help.
Buton and Gerdw.