09-16-2013 05:34 PM
Hi,
How do we track counter in a loop?Isn't it the way I implemented.? Please suggest.
Regards.
Solved! Go to Solution.
09-16-2013 05:49 PM
You can accumulate the running sum in a scalar initialized shift regsiter. No need to build a large array just to sum it at the end.
09-16-2013 06:03 PM
thankx,
I am not familiar about such register ,its been a while since I started Labview.So this circuit is not optimized but should work?
regards
09-16-2013 08:02 PM
If you aren't familiar with shift registers, then I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
It might work in practice, but it would be nominated for the Rube Goldberg thread.
Is your question solved? If so, you should mark Altenbach's message as the solution to your question. If not, then you cerainly shouldn't mark your message as the solution. First you will need to go to the Options menu to the upper right of your "solved" message and unmark it as the solution.
09-17-2013 01:53 AM
Both loops have errors, if you try to do for(i=60;i<120;i++) you're only running 60 loops, not 120. 🙂
You should also disable the autoindexing on incoming arrays as you want some split array indexes (actually you can optimize it by extracting the constant a[30] before the 1st loop and the opposite on the 2nd. Now you're extracting 2 numbers from a 1D array instead of 1 from a 2D array ...
The number on the select/sum function should be integers, no need to calculate doubles.
The small array to sum it up is only max 170 numbers, it's ok although a sum in a shift register would be better.
/Y