From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

average for time period

Hello!

 

I have been asking quite a few questions here lately, and I must say that the help that I have got has been excellent! I was therefore hoping that you guys could help me out with this one as well!

 

The problem:

I'm importing a dataset from Notepad and to an array in LabView. The dataset contains three columns: one for date, one for time and one for speed (see picture). I then need to find the lowest average, not for the enitre speed column, but for the speed column during a given time period. The time period should be specified by the user from the front panel (see picture 2), using a numeric control (should only be possible to specify whole hours). From picture 2 this will mean that I want to find the two-hour period that gives the lowest average for the speed column.

 

Just to clearify: The time between the samples are not evenly distributed, so its not possible to loop through a certain number of data points.

 

Greetings

Kristoffer

Download All
0 Kudos
Message 1 of 6
(2,395 Views)

I think this could help you.

if you shared some data maybe i could run it to test it (?) or try it yourself 😉 

good luck. file is in LV 2010

Message 2 of 6
(2,376 Views)

Thanks!

 

I guess that gives me a push in the right direction!:)) I have attatched a short sample data, and would really appriciate it if you could do some testing (I'll do some on my own too)!

 

Just a few quick questions: I get a problem when trying to connect the "lower data limit" to the "less or equal" block in the for-loop, as well as the "upper date limit" to the "greater" block in the same loop. My data is originally a string, but i have converted it to number (with the "decimal string to number" block), and apparently this will not work. Any workaround for this problem?:)

 

Greetings

Kristoffer

0 Kudos
Message 3 of 6
(2,363 Views)

Of course, forgot to upload the data!:p

Message 4 of 6
(2,362 Views)

Don't want to push you, but have you got it working? Because I haven't yet..

0 Kudos
Message 5 of 6
(2,327 Views)

no, not really, i cant promise i will have time for it either.

 

0 Kudos
Message 6 of 6
(2,325 Views)