05-08-2024 10:44 AM
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 .
Solved! Go to Solution.
05-09-2024 12:31 PM
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
05-09-2024 02:22 PM - edited 05-09-2024 02:29 PM
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.