AnsweredAssumed Answered

PNA-X 5242A using VB/SCPI to setup and return S21 data, trace flatlines.

Question asked by jeramy on Sep 24, 2012
Latest reply on Sep 24, 2012 by daras
I am using VB to to collect data from my PNA using SCPI commands.  I want to be able to retrieve the trace data into an array in VB so that it can be formatted and saved to a file.  Here are the commands that I am using, in order of use:

*RST

DISP:WIND1:TRAC1:DEL

CALC1:PAR:DEF:EXT ‘s21_1’, S21

CALC1:PAR:SEL ‘s21_1’

DISP:WIND1:TRAC1:FEED ‘s21_1’

SENS1:FREQ:STAR 1ghz

SENS1:FREQ:STOP 4ghz

SENS1:SWE:POIN 801

SENS1:SWE:MODE SING

CALC1:DATA:SNP? 1 

The first problem is that even though I have the current window set up for S21 I still get S11 data.  I then tried using the CAL:DATA:SWP:PORT:SAVE '1,2', 'filename.s2p' to see if I could even save a file with the correct data.  This is what I get:

!Agilent Technologies,N5242A,SG48420105,A.09.50.13
!Agilent N5242A: A.09.50.13
!Date: Monday, September 24, 2012 11:56:01
!Correction: S11(Off) 
!S21(Off) 
!S12(Off) 
!S22(Off) 
!S2P File: Measurements: S11, S21, S12, S22:
# Hz S  dB   R 50
8250000000 -24.731014 -73.900871 -200 45 -200 45 -200 45
8650000000 -23.449444 177.01767 -200 45 -200 45 -200 45
9050000000 -20.864315 33.254925 -200 45 -200 45 -200 45
9450000000 -27.105957 -137.45641 -200 45 -200 45 -200 45
9850000000 -21.587301 -43.66655 -200 45 -200 45 -200 45
10250000000 -16.823956 153.81203 -200 45 -200 45 -200 45
10650000000 -14.65541 -9.3751211 -200 45 -200 45 -200 45
11050000000 -15.921999 -160.85413 -200 45 -200 45 -200 45
11450000000 -20.617804 48.296314 -200 45 -200 45 -200 45
11850000000 -28.508892 -105.61721 -200 45 -200 45 -200 45
12250000000 -23.955696 -65.993332 -200 45 -200 45 -200 45


I get the S11 data correctly but not the S21 data, all the other channels are not active.  The S21 trace looks correct on the screen but the data does not save properly.  Not sure what I am doing wrong.

Thanks

Jeramy  

Outcomes