hi,
I want to measure the current on channel 3!
The time across the screen should be 10ms, resolution is 10us/DIV. I need to record 1000 samples therefore.
10us/DIV * 1000 = 10ms screen.
Does the following configuration work therefore? How to set :WAVEFORM:POINTS and :ACQuire:POINts?? what :WAVEFORM:POINTS:MODE will i need??
...
fprintf (oszi, ':TIMebase:RANGe 10.00E-03');
...
fprintf (oszi, ':CHANnel3:UNITs AMPere');
...
fprintf (oszi, ':TRIGger:EDGE:SOURce CHANnel1;SLOPe POSitive');
...
fprintf (oszi, ':STOP'); % is this necessary???
fprintf (oszi, ':ACQuire:MODE RTIMe;AVERage OFF;POINts 2000');
fprintf (oszi, ':WAVEFORM:SOURCE CHANnel3');
fprintf (oszi, ':WAVEFORM:POINTS:MODE BINary');
fprintf (oszi, ':WAVEFORM:BYTeorder LSBFirst');
fprintf (oszi, ':WAVEFORM:POINTS 1000');
fprintf (oszi, ':WAVeform:DATA?');
how can i plot the measurement data?
Bye
I want to measure the current on channel 3!
The time across the screen should be 10ms, resolution is 10us/DIV. I need to record 1000 samples therefore.
10us/DIV * 1000 = 10ms screen.
Does the following configuration work therefore? How to set :WAVEFORM:POINTS and :ACQuire:POINts?? what :WAVEFORM:POINTS:MODE will i need??
...
fprintf (oszi, ':TIMebase:RANGe 10.00E-03');
...
fprintf (oszi, ':CHANnel3:UNITs AMPere');
...
fprintf (oszi, ':TRIGger:EDGE:SOURce CHANnel1;SLOPe POSitive');
...
fprintf (oszi, ':STOP'); % is this necessary???
fprintf (oszi, ':ACQuire:MODE RTIMe;AVERage OFF;POINts 2000');
fprintf (oszi, ':WAVEFORM:SOURCE CHANnel3');
fprintf (oszi, ':WAVEFORM:POINTS:MODE BINary');
fprintf (oszi, ':WAVEFORM:BYTeorder LSBFirst');
fprintf (oszi, ':WAVEFORM:POINTS 1000');
fprintf (oszi, ':WAVeform:DATA?');
how can i plot the measurement data?
Bye
% Set the initial instrument parameters
Always stop the scope
fwrite(inst, ':stop;:cdis');
fprintf(inst, ':acquire:points %i', depth);
fprintf(inst, ':acquire:srate %d', sampleRate);
fwrite(inst, ':waveform:view all');
fwrite(inst, ':acquire:interpolate off');
fwrite(inst, 'WAV:SOUR CHAN1');
fwrite(inst, '*cls');
fwrite(inst, ':single');
This works if you are in triggered mode, not in auto mode. It makes sure that the scope is ready to give you data
ter = 0;
while(ter ~= 1)
fwrite(inst, ':ter?');
stringTer = fscanf(inst, '%s');
ter = str2double(stringTer);
end
fprintf(inst, ':wav:format WORD');
fprintf(inst,':WAVEFORM:BYTEORDER LSBFirst');
fwrite(inst, sprintf(':wav:data?'));
data(1:depth) = binblockread(inst, precision);
% read last character, this is a dummy read.
C = fread(inst,1);
% Get the vertical parameters
fwrite(inst, ':wav:yor?');
yor = str2double(fscanf(inst))
fwrite(inst,':wav:yinc?');
yinc = str2double(fscanf(inst))
% Convert the data into actual vertical (voltage) values
data = data * yinc + yor;
There are similar commands to get the Horizontal information. Plotting is left as an exercise to the user, but I know from experience that plot(data) should work, at least to verify that you have the correct data