11-22-2013 08:43 AM
11-22-2013 09:27 AM
Hey Gabrielo91,
It sounds like the Mean PtByPt Vi is what you're looking for:
http://zone.ni.com/reference/en-XX/help/371361H-01/ptbypt/mean_ptbypt/
Let us know if that works for you.
-Sam K
LabVIEW Hacker
Join / Follow the LabVIEW Hacker Group on google+
11-22-2013 10:23 AM
Hi, that isn't enough. I really need take 64 samples, sum it and divide by 8. I need somewhat like a a buffer o a queue. But I can't implement it. That each 64 samples.
11-22-2013 10:39 AM
Do you want to do a running average or sum 64 samples, divide by 8, then start over?
-Sam K
LabVIEW Hacker
Join / Follow the LabVIEW Hacker Group on google+
11-22-2013 10:47 AM
If you want to reset after every 64 samples you can do something like this (VI attached):
Other case structure frame:
Let us know if that is what you were looking for.
-Sam K
LabVIEW Hacker
Join / Follow the LabVIEW Hacker Group on google+
11-22-2013 12:33 PM
Yes, I need reset it every 64 samples and start again... I'll try it! But I cant understand where is keeping the last 64 data. Could you explain me that part?
11-22-2013 01:11 PM
The code above uses the Quotent and Remainder vi to count 0-63 then repeat. If this count is less than 63 we don't have all of our samples yet so the false case of the case strcutre executes. In that case we add the current sample to the previous samples. A shift register (http://www.ni.com/gettingstarted/labviewbasics/shiftregisters.htm) is used to pass the information from one loop iteration to the next, so all we need to do in the case structure is add the new sample. When the iteration counter hits 63 the true case of the case structure executes. In this case we add the current sample to the shift register value and then divide that by 8 as you requested. A 0 is passed into the shift register so that the next loop iteration starts with with a fresh set of samples.
Let us know if that makes sense or if you have any more quesitons about this.
Thanks!
-Sam K
LabVIEW Hacker
Join / Follow the LabVIEW Hacker Group on google+
11-22-2013 02:26 PM
I understand. Thank you. I have one question more, when I put a numeric indicator to 'i' (iterations indicator). It is ever in zero '0'. Is that normal? Don't have to increase?
11-22-2013 03:48 PM
Can you post a screenshot of your code? If the inidcator is connected to the 'I' inside the loop it should update as the VI runs. If the indicator is outside the loop it will not update until the loop is finished.
Thanks!
-Sam K
LabVIEW Hacker
Join / Follow the LabVIEW Hacker Group on google+
11-22-2013 03:58 PM
I tested it, but it only take the last number, I mean, it takes a number each 64 samples. I need take 64 samples and sum all of them. Can you help me? (I fixied the previous problem, you can ingnore that). Whe I tested your vi, it worked fine. But in my schematic, the value of the sum is ever the same. (The counter is working, I can see how that increase.)