LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with existing code

Hello!

 

I have asked quite a few questions about my problem here lately. However, after using severals of severals of hours, I still haven't been able do finish my code. I am therefore putting out my code here, and hoping that some clever brains out there can help me finish it.

 

What I want the code to do:

 

I want my code to take time 1 from the table, and add the corresponding data measurement to an array (or something).

Then I want the code to take the corresponding data measurement from time 2 an add that to the same array (or something).

I then want the code to continue doing this untill time n is above a specified upper time limit (upper time limit = time 1 + a user defined horizon)

When this is done, the program should calculate the mean for the whole array (and save that to a new array as well).

 

Then the code starts all over again, but this time from time 2.

This should continue all the way until the time from the new start time and till the last measurement is less than the specified horizon.

 

Really really hoping that someone can help me out on this one, as I really needs to finish this code soon.

If there is any questions about my existing code, or anything else, just ask.

 

Greetings

Kristoffer

 

Download All
0 Kudos
Message 1 of 8
(2,385 Views)

Am I to understand you are unable to finish your course assignment, and you want someone else here to finish it for you?

 

 

0 Kudos
Message 2 of 8
(2,376 Views)
Nope, then you understand me wrong.

1. This is for private use, and is not part of any course etc
2. I am not asking anyone to finish my code, I am asking for help/tips/advices that can help me finish my code.
0 Kudos
Message 3 of 8
(2,363 Views)

Instead of telling us what you want your code to do and uploading a VI with a missing subVI such that we can't run it, you could be more specific about the problem you are having.  Have you used any sort of debugging, such as the execution highlighting, to examine what your code is doing?  Where does it fail?

0 Kudos
Message 4 of 8
(2,345 Views)

Sorry for the missing subVI, totally forgot about it. Have uploaded that one as well now.

 

When it comes to beeing more specific about the problem:

 

Right now, the program is just taking the data measurement that belongs to time t1, and taking the mean of that (which, of course, is the same number as the measurement itself). Then, the program takes the data measurement belonging to time t2 and takes the mean of that and so on. In the end, it returns an array that is the exact same as it gets in.

What I am struggeling with is to make the inner for-loop calculate the mean for the whole time intervall [t1,t1+n] and returning that, before moving on to time intervall [t2,t2+n] and calculating the mean of that and so on.

 

Hope that this clear things up a bit

 

Greetings

Kristoffer

0 Kudos
Message 5 of 8
(2,336 Views)

So are you looking to get an average from each colum of data?

Tim
GHSP
0 Kudos
Message 6 of 8
(2,327 Views)

I think your In range and coerce will always return true as you've wired the same wire to both lower and active input.

 

I think you overcomplicate things. Put the Mean outside the inner loop and you'll get the mean of the whole array. Isn't that the T1 and the next turn of the big while will result in T2?

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 8
(2,326 Views)

Well not quite for each column, as there is one column for time/date and one for the measurements. I want the average for each time intervall, like [t1,t1+n], [t2,t2+n] etc.. where n is some user defined horizon in minutes (i.e. 5 min).

 

I can't put the mean outside, because of different dimension of array it says. But, that would just return the mean of the whole array, and not for the time intervalls i guess?

 

Greetings

Kristoffer

0 Kudos
Message 8 of 8
(2,323 Views)