LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read xl data and write 10 minute averages

Solved!
Go to solution

Hi all, i am new to this but am an avid researcher for vi help. Currently i use a vi to analyze csv data taken from a machine. The data is 1hz data. I am trying to make the vi take in the 1hz data--> analyze it--> then re-write to another spreadsheet, 10minute avg values. Basically i need to figure out how to tell the vi to isolate 10 minutes worth of data at a time, run it through the analysis vi and average each output of the vi. does this make sense? I am also having issues using the timestamp from the file in labview. I understand that it interprets the data a little different?

 

 

0 Kudos
Message 1 of 9
(3,853 Views)

Simple arithmetic says that 10 minutes worth of data is 600 samples. You could simply use the Array Subset function, setting the length to 600 and changing the Index each time you loop. Keep the index value in a shift register and increment by 600.

 

Having 'issues' is not very descriptive. What exactly are your problems and what do you mean by 'interprets the data a little different'?

 

If you could post what you have written with a sample file, it would go a long way in helping.

0 Kudos
Message 2 of 9
(3,850 Views)

Ok, so here are a few attachments. I have included an example of the XL sheet that i start with and have also attached an example of some 10 minuted average data. Also included is a read from XL vi which creates a 2D string array. The other vi is what i want to connect to the read from XL, problem there is that the vi (RCA98 rev3) needs a double 2D array.

 

As far as the timestamp goes, I was using csv format files (converted from XL) but every time i converted it to the csv format, it would compromise the value of the "device time stamp". I have no idea how to use "device time stamp" from the 1hz sheet (XL) for the x-axis, when i try, i get some crazy 1904 (date) value. I have been using a column labeled as "seconds" because it was a lot easier. Now, i have to reference the actual time stamp.

 

Does this help?

0 Kudos
Message 3 of 9
(3,844 Views)

Sorry, I don't have Excel installed here so I can't run the VI that uses it. If you want to save it as a text file, I can try that.

 

LabVIEW uses timestamps that start in 1904. Excel uses a different start date. You would have to add the difference. 

0 Kudos
Message 4 of 9
(3,827 Views)

Can I use a string double as an output and convert it to a 2D Double array? 

 

how do i find out what my Excel is using for its start date?

 

Thanks a lot by the way, so far you have help a great deal. I will have to try using your logic with the shift register.  

0 Kudos
Message 5 of 9
(3,821 Views)
Solution
Accepted by topic author TRAVO

Excel date.

 

On the String>String/Number Conversion  palette is Fract/Exp String to Number. You can wire an array to the input.

Message 6 of 9
(3,817 Views)
Thanks a million. That is great! I think I can pick up where i left off now. How do I give you any props? KUDOS? you deserve it for the help.  
0 Kudos
Message 7 of 9
(3,813 Views)
Click on the kudoes icon to the right side of Dennis' messages.
0 Kudos
Message 8 of 9
(3,809 Views)

Hi Dennis, I have been able to use the shift register for the index value of the sub array, and I have been using 300 as the length (samples where assumed to be 2 seconds apart). I have a new problem, the samples were not taken at exactly 2 second intervals. some have 1 some have 3 and most have 2, but not exactly. So I dont get exact results, real close but not exact. Is there a way that I could use a time value like 10 minutes (0:10:00) for indexing and length? If this were possible, then i could use the initial time stamp array and slice the whole array by the length of a time value. Is this possible?

 

Thanks 

0 Kudos
Message 9 of 9
(3,763 Views)