LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Working with excel table

Hi there. I need a help. I work with excel table. I have the task to get table .exsl in labview. I done it with this vi, but i have problem with date format. In table date (time) looks like dd/mm/yyyy hh:mm:ss.000 but when i getting table in labview i have different result. Help, thank you.

Download All
0 Kudos
Message 1 of 7
(3,048 Views)

Take a look at this article. Excel does not store the timestamp as text, but as the number of days from Jan 1, 1900. You will have to do some manipulation to convert it into LabVIEW time (seconds from Jan 1, 1904), or you can change your Excel settings. Then all you need to do is convert days to seconds, and use "Get Date/Time String" in LabVIEW.

0 Kudos
Message 2 of 7
(3,042 Views)

Thank you for your answer. I understan main idea now.  But can you help me with converting in my vi? what do i wrong? What format of string i have to choose?

( in vi i try to get date array in seconds)

Download All
0 Kudos
Message 3 of 7
(3,015 Views)

A couple of points:

  • Index array will automatically start at 0 and increment the index by 1 for each pulled down element. If you don't want to start at 0, you still only have to wire the index to the first input and it will increment. If you want to index out columns, you still only have to wire the first index to the column.
  • You can use Fract/Exp String to Number to convert strings / array of strings to DBL precision numbers.
  • Avoid dynamic data!

 

I think something like this should work for you... You will just have to change the time zone conversion.

 

Capture.PNG

Message 4 of 7
(3,011 Views)

Thank you so much  for teaching me this. And i have only one step now.How do this in my vi. I have bad knowledge about  string formats. I have subarray of date and then i make array of date, how make multiply and how choose format becouse subarray have  41731,3230308128 type and array have 41731,3. In result i should make plots in waveform graph. Thank you. 

0 Kudos
Message 5 of 7
(3,007 Views)

forgot

Download All
0 Kudos
Message 6 of 7
(3,006 Views)

@teslo wrote:

Thank you so much  for teaching me this. And i have only one step now.How do this in my vi. I have bad knowledge about  string formats. I have subarray of date and then i make array of date, how make multiply and how choose format becouse subarray have  41731,3230308128 type and array have 41731,3. In result i should make plots in waveform graph. Thank you. 


Hi Teslo,

1. For graphing purposes you will not want a string, you will want either DBL format (as you have it), or time stamp format.

2. The "To Time Stamp" function actually accepts arrays, so your wire will not be broken. If your data is evenly spaced, you can use a waveform graph and set the offset and dt appropriately. I actually prefer XY graph, because it handles unevenly spaced samples as well. XY graph takes many data types, (found in the help), but for your case you will want a cluster of timestamp and numeric data. For multiple plots, just create multiple clusters and build into array.

3. It never hurts to see if a function accepts an array (a lot of them do). But if they don't...

4. Just call the function inside a For Loop. The auto index tunnel with brackets [] means it will run the length of the array.

Capture.PNG

Message 7 of 7
(2,969 Views)