Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Read S11 data from E5071C via TCP/IP

Sorry for my English. I have a problem here. I am trying to read S11 data(array of double) from E5071C,but it doesn't work.

Here is my code:

// Read ASCII data works fine
_status = viPrintf(_inStr, ":CALC1:DATA:SNP:PORT? 1,2;*WAI\n");
_status = viScanf(_inStr, "%t", szBuf);


// Read binary data doesn't work
ViInt32 cnt = 303;
ViReal64 datas[400] = {0.0};
_status = viPrintf(_inStr, "FORM:DATA REAL,64\n");
_status = viPrintf(_inStr, "CALC1:PAR:SEL S11\n"); 
_status = viPrintf(_inStr, ":CALC1:DATA:SNP:PORT? 1\n");
_status = viScanf(_inStr, "#%Zb", &cnt, datas);

 Anyone give me suggestions, many thanks in advance!

0 Kudos
Message 1 of 2
(4,165 Views)

@leajon wrote:

Sorry for my English. I have a problem here. I am trying to read S11 data(array of double) from E5071C,but it doesn't work.

Here is my code:

// Read ASCII data works fine
_status = viPrintf(_inStr, ":CALC1:DATA:SNP:PORT? 1,2;*WAI\n");
_status = viScanf(_inStr, "%t", szBuf);


// Read binary data doesn't work
ViInt32 cnt = 303;
ViReal64 datas[400] = {0.0};
_status = viPrintf(_inStr, "FORM:DATA REAL,64\n");
_status = viPrintf(_inStr, "CALC1:PAR:SEL S11\n"); 
_status = viPrintf(_inStr, ":CALC1:DATA:SNP:PORT? 1\n");
_status = viScanf(_inStr, "#%Zb", &cnt, datas);

 Anyone give me suggestions, many thanks in advance!


Strange as it may sound, Agilent's website is chockfull of example programs.

Perhaps, you should try looking there.

 

 

 

0 Kudos
Message 2 of 2
(4,146 Views)