AnsweredAssumed Answered

problem: "Using Raw Data to Create a Calibration (Simmcal)"

Question asked by srjmas on Jul 14, 2011
Latest reply on Sep 18, 2011 by srjmas
Hello,
I wonder, whether anyone managed to master this example, and could share it in some existing programming language.
I translated it to Matlab, and it works fine, with no errors or warnings in pc/VNA, except it wouldn't make a proper calibration. Not for full 2-port and not for a smaller S11 example, which I made because I suspect that a working full 2 port code should make use of OUTPRAW2-4, not only OUTPRAW4.

Here's my matlab code



na=visa('agilent','GPIB0::16::INSTR');
set(na,'InputBufferSize',1601*2*24*4);
set(na,'OutputBufferSize',1601*2*24*4);
fopen(na);

fprintf(na, 'opc?; pres');
while 1~= str2num(fscanf(na)), wait(0.1), end
fprintf(na, 'POIN1601;FORM4;');
fprintf(na, 'SWET5S;HOLD;');
fprintf(na, 'CALK35MD;');

fprintf(na, 's11');

uiwait(msgbox('Connect opens','Title','modal'));
fprintf(na,  'opc?;sing;');
while 1~= str2num(fscanf(na)), wait(0.1), end
fprintf(na, 'OUTPRAW1');
arr1= (fscanf(na));

uiwait(msgbox('shorts','Title','modal'));
fprintf(na,  'opc?;sing;');
while 1~= str2num(fscanf(na)), wait(0.1), end
fprintf(na, 'OUTPRAW1');
arr2= (fscanf(na));

uiwait(msgbox('loads','Title','modal'));
fprintf(na,  'opc?;sing;');
while 1~= str2num(fscanf(na)), wait(0.1), end
fprintf(na, 'OUTPRAW1');
arr3= (fscanf(na));


fprintf(na, 'calis111');
fprintf(na, 'BEEPDONEOFF');

fprintf(na, 'OPC?;CLASS11A;');
while 1~= str2num(fscanf(na)), wait(0.1), end
fprintf(na, ['INPUCALC01',arr1]);


fprintf(na, 'OPC?;CLASS11B;');     
while 1~= str2num(fscanf(na)), wait(0.1), end
fprintf(na, ['INPUCALC02',arr2]);

fprintf(na, 'CLASS11C;OPC?;STANA;');     
while 1~= str2num(fscanf(na)), wait(0.1), end
fprintf(na, ['INPUCALC03',arr3]);

fprintf(na,['opc?; DONE']);
while 1~= str2num(fscanf(na)), wait(0.1), end

fprintf(na,'opc?;sav1;');
while 1~= str2num(fscanf(na)), wait(0.1), end

fprintf(na, 'CONT');

fprintf(na, 'BEEPDONEON;');

fclose(na);  

Outcomes