AnsweredAssumed Answered

Read s-parameters with CALC:DATA:SNP:PORTs?

Question asked by eabmo on Jul 26, 2010
Latest reply on Oct 28, 2010 by daras
Hi!

I am trying to read s-parameters from my PNA-X 5242A to Matlab using GPIB (Agilent USB-GPIB Adapter). I have managed to save the s-parameters in a file on the PNA-X with the 'CALC:DATA:SNP:PORTs:Save "1,2","C:/test/MyDatap.s2p"' command so the setup seems to work.

But when using 'CALC:DATA:SNP:PORTs? "1"' to transfer the data into Matlab I expected to get all the s-parameter data as a string but simply got output1 = "CH1_S11_1,S11" and output2 = #44824Ac Ð. It is output2 that confuses me!

Any help would be appreciated. Input buffersize maybe?

The complete code is given below.

obj5 = instrfind('Type', 'gpib', 'BoardIndex', 7, 'PrimaryAddress', 16, 'Tag', '');
   
    fopen(obj5);

    fprintf(obj5, ['SYST:PRES']);

    output1=query(obj5, ['CALC:PAR:CAT?']);
    output1

    fprintf(obj5, ['CALC:PAR:SEL "CH1_S11_1"']);   
    fprintf(obj5, ['CALC:DATA:SNP:PORTs:Save "1,2","C:/test/MyDatap.s2p"']);
   
    output2=query(obj5, ['CALC:DATA:SNP:PORTs? "1"']);
    output2
       
    fclose(obj5);
    delete(obj5);

/Daniel  

Outcomes