LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

averaging a VEEEEERY BIG (10 MB) arrays` elements

You could replace the first loop with a while loop and stop it when a line no longer contains a ":". This seems to be a common tag for the header.
0 Kudos
Message 21 of 34
(1,216 Views)
hmmmm



Message Edited by blue silver on 11-28-2007 06:28 PM
0 Kudos
Message 22 of 34
(1,205 Views)
here is my code , please take a look , you will understand my prolem than...

I want header as you have did , as one string! but should stop when he no more has  " : " sing or sth , I can`T do it....   :(((((

the last loop I have to make a moving average , I guess I have work with arrays...adding 10 of them in a moment.

the last problem is "range" this muss be read from the header string , and used later in coming frames ( to plot chart , it is how many values should be plotted in one second , normally it is 10 but may vary)

PLEASEEEEEEEE , i will get crazy
0 Kudos
Message 23 of 34
(1,202 Views)
here is a picture after it runs:

0 Kudos
Message 24 of 34
(1,201 Views)
my question on your code:


0 Kudos
Message 25 of 34
(1,199 Views)
 
A FOR loop needs to know the total number of iterations before it runs (except for the new feature of "FOR loop with break"). This way it knows exactly how much memory to allocate for the output tunnels and it can run most efficiently.
 
If you would use a WHILE loop and spin it until you run out of data, the memory allocation will be much more problematic and it will take much more time to complete the task. LabVIEW cannot know how big the output arrays will be and will incremetally allocate bigger and bigger chunks whenever it runs out of its first guess.
0 Kudos
Message 26 of 34
(1,190 Views)


blue silver wrote:
here is my code , please take a look , you will understand my prolem than...

You did not include the two most important subVIs 1.vi and 2.vi.
 
Don't autoindex the arrays into a chart inside a FOR loop, just wire the arrays directly to a waveform graph. Much simpler and no loop needed. 🙂
0 Kudos
Message 27 of 34
(1,188 Views)
why dividing by 10 is because the plot/sec is 10 ?


Message Edited by blue silver on 11-28-2007 07:03 PM
0 Kudos
Message 28 of 34
(1,186 Views)


blue silver wrote:
why dividing by 10 is because the plot/sec is 10 ?


NO! We divide by 10 because we have 10 characters per line. This allows us to calculate the total number of lines! 🙂
 
The increment for the x-axis can be set manually or via a property node if it is obtained from one of the header lines.
 
If you have a variable number of header lines, you need to match the tags with the value. Here's a possible solution (LV 7.1), you just need an array with all possible tags.
 
 
 
 
Message 29 of 34
(1,174 Views)
(Sorry, the label is still U16, but I changed the representation of the diagram constant to I16 to allow negative numbers. Just change the label to I16 for clarity ;))
0 Kudos
Message 30 of 34
(1,169 Views)