Thread: Acquire multiple channels on a DSO-X-3034A


Permlink Replies: 5 - Pages: 1 - Last Post: May 22, 2012 6:57 AM Last Post By: algoss Threads: [ Previous | Next ]
FloJ

Posts: 9
Registered: 05/14/12
Acquire multiple channels on a DSO-X-3034A
Posted: May 14, 2012 4:17 AM
Click to report abuse...   Click to reply to this thread Reply
Hey there,

i am using the 4 analog channel DSO-X-3034A.

I want to acquire a signal on 3 channels. I connect to the oscilloscope via USB using VISA and SCPI-commands in MATLAB.
There is an example how to acquire data from one channel on http://www.mathworks.com/matlabcentral/fileexchange/28887-capturing-a-waveform-from-an-agilent-oscilloscope-over-a-standard-visa-interface

What do i have to take care of if i want to acquire 3 instead of only 1 channel? Will the data of the 3 channels be timesynchronous?

How does the samplerate behave in dependence of the number of samples? The maximum number of samples in the raw mode is 8000000. Is it a third of this value when capturing 3 channels?

Greetings
FloJ
algoss


Posts: 582
Registered: 11/03/06
Re: Acquire multiple channels on a DSO-X-3034A
Posted: May 14, 2012 6:59 AM   in response to: FloJ in response to: FloJ
Click to report abuse...   Click to reply to this thread Reply
I want to acquire a signal on 3 channels. I connect to the oscilloscope via USB using VISA and SCPI-commands in MATLAB.
There is an example how to acquire data from one channel on http://www.mathworks.com/matlabcentral/fileexchange/28887-capturing-a-waveform-from-an-agilent-oscilloscope-over-a-standard-visa-interface
I don't have my manual handy, but if I remember correctly, we tend to not use the 'DIGITIZE' command, so this may not be the best example to look at. There is a MATLAB example that I created in the 'Programs and Scripts' section of the forums, that mey be easier to understand.

What do i have to take care of if i want to acquire 3 instead of only 1 channel? Will the data of the 3 channels be timesynchronous?
You don't have to do anything special to capture and unload 3 channels, except tell the scope to send the data 3 times instead of 1.

The following is an approximation of the correct syntax for retrieving the data

fprintf(inst, 'WAV:SOURCE CH1');
fprintf(inst,':WAV:DATA?');
Get the data
fprintf(inst, 'WAV:SOURCE CH2');
fprintf(inst,':WAV:DATA?');
Get the data
fprintf(inst, 'WAV:SOURCE CH3');
fprintf(inst,':WAV:DATA?');
Get the data


How does the samplerate behave in dependence of the number of samples? The maximum number of samples in the raw mode is 8000000. Is it a third of this value when capturing 3 channels?
The maximum depth is only 4M and that gets cut in half and that gets cut in half when you turn on the third channel. I'm not sure what you mean by 'raw mode'. You may be getting 8M of data, since I think the scope outputs 16 bits per sample, but that may be only 4M samples.

Al
FloJ

Posts: 9
Registered: 05/14/12
Re: Acquire multiple channels on a DSO-X-3034A
Posted: May 15, 2012 12:25 AM   in response to: algoss in response to: algoss
Click to report abuse...   Click to reply to this thread Reply
Thank you for your reply.

I found your example where you use the trigger and wait for a trigger event to collect the data. In my manual the digitize command seems to be valid, at least it is not mentioned in the "Obsolete and Discontinued Commands" section.

After i wrote this post, i exactly tried the syntax you mentioned here. I was able to obtain the data of 3 channels.

By raw mode i mean the WAVEFORM:POINTS:MODE. In WAVEFORM:POINTS it says that you can only choose from 100 to 1000 samples in the NORMAL mode and from 100 to 8000000 samples in MAXIMUM or RAW mode.

Another question:
In the manual it is stated, that the sample rate equals the number of samples divided by the time of acquisition. So i expect a samplerate of 200kSa/s when i set up :WAVEFORM:POINTS 1000 and :TIMEBASE:RANGE 5e-3 (-> SR = 1000 / 5e-3 = 200k). But the shown value on the oscilloscope is 200MSa/s. I got 1000 sample values and the oscilloscope shows 500us/div (10div*500us/div = 5e-3s). Where is the error?

algoss


Posts: 582
Registered: 11/03/06
Re: Acquire multiple channels on a DSO-X-3034A
Posted: May 15, 2012 12:17 PM   in response to: FloJ in response to: FloJ
Click to report abuse...   Click to reply to this thread Reply

Another question:
In the manual it is stated, that the sample rate equals the number of samples divided by the time of acquisition. So i expect a samplerate of 200kSa/s when i set up :WAVEFORM:POINTS 1000 and :TIMEBASE:RANGE 5e-3 (-> SR = 1000 / 5e-3 = 200k). But the shown value on the oscilloscope is 200MSa/s. I got 1000 sample values and the oscilloscope shows 500us/div (10div*500us/div = 5e-3s). Where is the error?

You have to separate the number of points acquired (:ACQ:POIN?) and the number of points transferred with a :WAV:DATA? command(:WAV:POIN). They can be very different. What's shown on the screen is the number of points acquired.

Unlike many other scopes, the depth (number of points acquired) and the sample rate are not directly controllable. This is in the manual. The X-series scopes were designed to optimize the display, and thus, the depth and sample rate are controlled by the scope, and every attempt is made to capture as much data as possible, as fast as possible. Thus the sample rate and depth stay high and cannot be controlled programmatically.

Al
FloJ

Posts: 9
Registered: 05/14/12
Re: Acquire multiple channels on a DSO-X-3034A
Posted: May 21, 2012 12:37 AM   in response to: algoss in response to: algoss
Click to report abuse...   Click to reply to this thread Reply
Okay,
in the Programmer's Guide i found the statement "The :ACQuire:SRATe? query returns the current oscilloscope acquisition sample rate. The sample rate is not directly controllable.". I just thought i couldn't directly set the samplerate but indirectly by setting numer of samples and the time of acquisition. Because in the manual it is said "sample rate = number of samples / time of acquisition". So i thought setting :WAV:POIN and :TIMEBASE:RANGE would do the trick. Unfortunately not. I can only set the timebase and read out the actual sample rate (:ACQuire:SRATe?) or the acquired points (:ACQ:POIN?).

If i set the timebase to a fixed value, will the sample rate at least be constant in different measurments/runtimes? Because the samplerate/numer of samples can lead to different results in a FFT calculated afterwards. First of all i need the value of the samplerate and number of samples to calculate the FFT. I can read out these values, that's okay. But to get results, after doing some math on the signal, that are comparable to each other, i need a fixed samplerate.
algoss


Posts: 582
Registered: 11/03/06
Re: Acquire multiple channels on a DSO-X-3034A
Posted: May 22, 2012 6:57 AM   in response to: FloJ in response to: FloJ
Click to report abuse...   Click to reply to this thread Reply
If i set the timebase to a fixed value, will the sample rate at least be constant in different measurments/runtimes? Because the samplerate/numer of samples can lead to different results in a FFT calculated afterwards. First of all i need the value of the samplerate and number of samples to calculate the FFT. I can read out these values, that's okay. But to get results, after doing some math on the signal, that are comparable to each other, i need a fixed samplerate.

The scope will always try to use its maximum depth. If your time/division is 50usec/div or smaller, it will sample at 4GSa/sec. As you increase your time/division, the sample rate will drop so that samples/division will always be as close to Max depth/10 as possible without going over. In my case, my depth is 2M, so the samples/division stays at 200,000 as long as I don't switch to 'fine' mode.

If you need a fixed, or directly controllable, sample rate, you need a higher performance scope.

Al

Point your RSS reader here for a feed of the latest messages in all forums