AnsweredAssumed Answered

3458A continuous readings

Question asked by lhornburg Employee on Apr 19, 2013
People have asked how to continuously take readings on the 3458A.  Basically all you have to do is set TRIG to AUTO, and TARM to AUTO.

Attached is a Matlab program that continuously takes data with the 3458A.  I set the NRDGS to 1000, so basically I am taking 1000 readings per trigger, and I remove the data in chunks of 1000.

I made a simple FOR loop that basically takes 5 chunks of 1000 readings, as an example:

clear all; close all; clc;

dmm = visa('AGILENT','GPIB0::22::INSTR');
set (dmm,'InputBufferSize',400000);
set (dmm,'timeout', 25);  %set the bus timeout for 25 seconds
set (dmm, 'ByteOrder', 'bigEndian');
fprintf (dmm,'reset');
fprintf (dmm,'end always');  %sets up the correct EOL, use end on if using internal memory 
fprintf (dmm,'id?');
id = fscanf (dmm);
fprintf (dmm,'preset dig'); %presets DMM for DCV digitizing (see page 218)
fprintf (dmm,'mem fifo');
fprintf (dmm,'dcv 10');
fprintf (dmm,'trig auto');
fprintf (dmm,'timer 20e-6');  % set for approximately 50,000rdgs/sec

fprintf (dmm,'nrdgs 1000,timer'); %set for 1000 rdgs per trigger

fprintf (dmm,'iscale?');    %get scale factor for sint format 
scale = fscanf (dmm,'%f');

fprintf (dmm,'tarm auto'); %Begin triggering readings

alldata = [];     %create variable that will combine all loop data 
for S = 1: 1: 5     %Loop 5 times to get 5000 readings

[data] = fread(dmm,1000,'short');  %Read the data
alldata = [alldata data];          %store data in alldata


scaledreadings = scale*alldata;  %multiply alldata by proper scaling factor
plot(scaledreadings)  %plot the data
scaledreadings        %output to screen