How to use Ratio_Mode_Average

Post general discussions on using our drivers to write your own software here
Post Reply
BSI
Newbie
Posts: 0
Joined: Wed May 12, 2010 3:15 pm
Location: Canada

How to use Ratio_Mode_Average

Post by BSI »

(a): So here, shouldn't an additional memory segment be reserved for the result of the averaging operation? or should ONLY 1 segment be reserved for the result of the averaging operation?
--> (b): the nbr of capture should remain the same as the nbr of waveforms I need to acquire.
4. Using ps5000aGetTimebase, select timebases until the required nanoseconds per sample is
located. This will indicate the number of samples per channel available for each segment.
5. Use the trigger setup function ps5000aSetSimpleTrigger to set up the trigger if required.
6. Start the oscilloscope running using ps5000aRunBlock.
7. Wait until the oscilloscope is ready using ps5000aIsReady.
8. Use ps5000aSetDataBuffer to tell the driver where your memory buffers are. Call the function
once for each channel/segment combination for which you require data
--> (c): Is it still required ? and what are the parameters for this call if I only want to retrieve the average? The mode if set to 4 would imply we are setting this up for average mode. So should only one segment index be reserved ? Or does this function have to be called as many times as there are waveforms to acquire (with downsampleratio mode = 0)? PLUS ONCE for the averaged waveform (with DownsampleRatioMode=4)?
9. Transfer the blocks of data from the oscilloscope using ps5000aGetValuesBulk
--> (d) I suppose this function should be called once to obtain the average value as returned by the driver. In any case, what is the value of the following parameters that should be used:
DownSampleRatio , fromSegmentIndex and ToSegmentIndex?

And finally: just to confirm: the averaging operation is done on-board the digitizer, correct?
Thx.
L.
-->
Hi,

I want to acquire multiple waveforms (incoming multiple triggers) in rapid block mode. So far so good, it works fine. Now I want to only retrieve the average of these waveforms. To do so, I have been trying to use the DownSampleRatioMode switch set to PS5000A_RATIO_MODE_AVERAGE = 4 and following the procedure described on page 12 and 13 of the API guide. No luck. Here are the steps and related questions:

1. Open the oscilloscope using ps5000aOpenUnit.
2. Select channel ranges and AC/DC coupling using ps5000aSetChannel.
2a. Set the digital port using ps5000aSetDigitalPort (mixed-signal scopes only).
3. Set the number of memory segments equal to or greater than the number of captures required using
ps5000aMemorySegments. Use ps5000aSetNoOfCaptures before each run to specify the
number of waveforms to capture.
--> (a): So here, shouldn't an additional memory segment be reserved for the result of the averaging operation? or should ONLY 1 segment be reserved for the result of the averaging operation?
--> (b): the nbr of capture should remain the same as the nbr of waveforms I need to acquire.
4. Using ps5000aGetTimebase, select timebases until the required nanoseconds per sample is
located. This will indicate the number of samples per channel available for each segment.
5. Use the trigger setup function ps5000aSetSimpleTrigger to set up the trigger if required.
6. Start the oscilloscope running using ps5000aRunBlock.
7. Wait until the oscilloscope is ready using ps5000aIsReady.
8. Use ps5000aSetDataBuffer to tell the driver where your memory buffers are. Call the function
once for each channel/segment combination for which you require data
--> (c): Is it still required ? and what are the parameters for this call if I only want to retrieve the average? The mode if set to 4 would imply we are setting this up for average mode. So should only one segment index be reserved ? Or does this function have to be called as many times as there are waveforms to acquire (with downsampleratio mode = 0)? PLUS ONCE for the averaged waveform (with DownsampleRatioMode=4)?
9. Transfer the blocks of data from the oscilloscope using ps5000aGetValuesBulk
--> (d) I suppose this function should be called once to obtain the average value as returned by the driver. In any case, what is the value of the following parameters that should be used:
DownSampleRatio , fromSegmentIndex and ToSegmentIndex?

And finally: just to confirm: the averaging operation is done on-board the digitizer, correct?
Thx.
L.