LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I subset an array (from excel) by time values for length?

Is it possible to slice portions of an array by time value per iteration? I am looking for a way to take a data sheet (taken from Excel) put into an array and then portion out 10 minutes at a time. The data sheet does not have exact sequential time value otherwise I would just use sample size (i.e. 600 for 10minutes). Instead of sample size can I search and subset by a time delta? I appreciate all the help I can get.

 

Thanks

0 Kudos
Message 1 of 18
(3,403 Views)
Probably, but you'll need to provide an example of how your data has been stored in Excel.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 18
(3,397 Views)

Hi Travo,

 

yes, you can.

 

I would transform the time values into timestamps and then use standard comparison functions to search the correct data range...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 18
(3,394 Views)

Great GerdW, i am glad to hear that its possible. I was having a heck of a time trying to figure out how i would do that. Now I just have to figure out how to do what you are suggesting.Ha

 

I have attached my VI and a 20minute example. My VI is setup to subset by sample size right now.  

Download All
0 Kudos
Message 4 of 18
(3,386 Views)
There's a 'Seconds' column in the spreadsheet already.  It appears to be elapsed time.  It will be much easier to use that. 
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 5 of 18
(3,380 Views)

Hi NIquist,

 

that "Seconds" column is more of a counter when you compare it with those two timestamp columns...

Message Edited by GerdW on 03-16-2010 04:25 PM
Best regards,
GerdW


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

Hi NIquist and GerdW, yes the "seconds" column is sort of an "elapsed time" (total) since the machine's start date. I have used it previously but for different things, for this instance I am hoping to capture 10minutes at a time in sequential order, once the data is set aside, i want to run it through a set of subvi's to count cycles for that 10min period. I then wish to write each 10min value to another sheet to include ending time-stamp, so each value should have a time-stamp incremented by minutes from indexed stamp.

 

does that help a bit?

 

Regards,

Travo 

0 Kudos
Message 7 of 18
(3,374 Views)
They look equivalent to me.  I see the timestamps going for 20 minutes.  The Seconds column goes from 7847295 to 7848495 = 1200 seconds = 20 minutes.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 8 of 18
(3,370 Views)

Hi Travo,

 

could you please convert the "xlsx" to a more common xls - or even better a tab separated txt? At home I can't open your sheet...

 

Also all the subVIs are missing in your VI. From what I see I would suggest to use a different conversion as you have different datatype to convert (numbers, timestamps...)

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 18
(3,339 Views)

Hi GerdW,

 

 Let me know if this works. I have put the VI into a project and created a shared library too. Dont know if this will work but if it doesnt I can just send all of the VI's together instead. I also included the xls file.

 

What do you mean by different conversion?

 

Thanks 

 

 

0 Kudos
Message 10 of 18
(3,335 Views)