Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming Keysight N5245A to Freq & Pwr Sweep and save S-parameters in mdif file

Good evening, I am looking for a little direction here. I am attempting to use LabView to frequency & power sweep an amplifier and save the resulting data as a mdif file.

I wiould like to the device to perform a frequency sweep at a power level and then step up to the next power level and sweep in frequency again. I would like to sweep from 6-10GHz and from -30 to -10dBm.

Attached is what I have come up with so far. I believe I am not on the right track. Is there anyone out there who can provide direction on the correct way to go about doing this?

 

Thank You,

Jemal

 

0 Kudos
Message 1 of 3
(4,630 Views)

Hi Jemal,

 

It sounds like you are going to want to try a nested for loop so you can iterate through both frequency and power.  Frequency would be the inner loop while power would be the outer.

Michael Keane
National Instruments
0 Kudos
Message 2 of 3
(4,607 Views)

Jemal,

 

It has been a long time since you posted the problem.  Hopefully you have learned a lot in the months since.

 

I had a look at the code.  One thing I can say is that the sequence structures in your code isn't buying you anything beneficial.  Data flow in LabVIEW is controlled by the flow of data through the VIs which require inputs to be satisfied before outputs can generate data.  I don't see a possibility of a race condition that requires a sequence structure. If you want to see for your self, turn on highlighting in the block diagram and run your VI.  Then remove your sequence frames and run the code and watch the flow.  Both ways should basically run the same.

 

A better method of controlling flow of a PNAX setup is to use what is traditionally called a "state machine".  You can find examples of state machines out there on the forums.  The State machine will allow you to break up your command sequence into pieces....set start/stop....set display....set power level.....apply calibration....sweep and measure, then iterate power increment and repeat in the loop....exit.

 

The top left corner of the FOR loop is meant to be wired to a numerical constant that will drive the loop for n times.   It seems as though you calculate the steps correctly.  But you are missing the drivers where you are setting power level for each sweep.  You also seem to be missing where you step to the next frequency point.  I have used the PNAX for several years.  Do you really need to store a single sweep point and calculate the difference for each point as the power is incremented?  Why not sweep the entire band, iterate power, sweep next power...etc till all levels are complete?  You can take the collected data and perform calculations on the final array of sweep data.

 

Mike B.

0 Kudos
Message 3 of 3
(4,238 Views)