LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading values a number of iterations and calculate average

Solved!
Go to solution

i have this code that configures an agilent N9010A ( that's connected to signal generator ) and reads peak value ( frequence and amplitude) im trying to make it so it reads this value a certain number of times with a time interval between them that's chosen by the user and then calculate the average value and shows it on the front panel . 

0 Kudos
Message 1 of 3
(179 Views)
Solution
Accepted by topic author Hetrx

You can use a for loop, inserting the Vi that makes teh measurement. In the end ti will get the Array and calculate the average of all elements of that 2D array

LVNinja_0-1715275886010.png

 

0 Kudos
Message 2 of 3
(118 Views)

Is there some reason you don't just use the averaging function in the N90101?  That's the easiest way to guarantee that your data stays properly aligned.  It's also the fastest way to average.

 

You can add Configure Measurement Averaging.vi to your code or check out the Agilent example Agilent MXA Series Acquire Measurement.vi that comes with the NI driver package.

 

EDIT:  I can't see an easy way to add a time delay between averages, so if you really need to do that you can actually do what LVNinja mentioned.  The averaging VI is polymorphic and will work on arrays of data.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 3 of 3
(107 Views)