ARB demo 2

This demo shows how to download a waveform to the function generator.

Contents

Open function generator and scope

instr_open();
identification: AGILENT TECHNOLOGIES,MSO7012B,MY49520152,06.00.0004
identification: HEWLETT-PACKARD,33120A,0,8.0-5.0-1.0

Set fg output load

fprintf(fg,'Output:Load?');
disp(fscanf(fg));
fprintf(fg,'Output:Load INF');
+9.90000E+37

Read ARB catalog

fprintf(fg,'DATA:CATALOG?');
str = fscanf(fg);
disp(str);
"SINC","NEG_RAMP","EXP_RISE","EXP_FALL","CARDIAC","VOLATILE"

Increase OutputBufferSize

fclose(fg);
fg.OutputBufferSize = 4096;
fopen(fg);

Set function generator to ARB

N = 400;
x = linspace(0,1,N);
y = -cos(2*pi*x);
idx = find(y<0);
y(idx)=0;
y=2*y-1;
plot(x,y);
str = sprintf(',%g',y);
fprintf(fg,strcat('DATA VOLATILE',str,'\n'));
fprintf(fg,'FUNC:USER VOLATILE');

fprintf(fg,'APPLY:USER %d, 2, 0.5',N);

pause(0.5);

fprintf(os,'Autoscale');

Close down

instr_close();