I am trying to figure out the SCPI command to get the current frequency from a N9040B Spectrum Analyzer.
I've tried the documentation but can't find it in there.
Center frequency is
SENSe is optional, so you can simplify it down to
or even simpler:
www.keysight.com/find/commandexpert can help you find the commands with its awesome search capability!
Thanks for the response but I'm not sure that's what I'm looking for. My requirements are (amongst others) to set the center frequency as well as to get the current frequency ("read back the frequency").
Not being familiar with Spectrum Analyzers, is the center frequency different from just reading back the frequency?
Are you expecting to get a "trace of spectrum data" (an array), or the center frequency value (a scalar)?
I'm not really sure. I given very little in the way of detail for my requirements. Basically, set center frequency, frequency span, resolution band auto on|off, video bandwidth auto on|off, peak search and read back frequency.
I would assume that since one of my requirements is to set the center frequency that I wouldn't then need to provide a way to retrieve it.
I'll see if I can find out any more detail about this requirement.
Ok, thanks for that description of your requirements, I think it helped:
--> set center frequency, frequency span, resolution band auto on|off, video bandwidth auto on|off, peak search and read back frequency.
In this context the "read back frequency" isn't reading back the center frequency that was set. The following steps are designed to setup the instrument to a specific frequency range and bandwidth (putting the instrument in the right ballpark for the signal):
"set center frequency, frequency span, resolution band auto on|off, video bandwidth auto on|off"
Then, you are telling the instrument to search for the peak of the signal.
CALC:MARK1:MAX <-- this will do the peak search using Marker 1
Finally, you want to read back that peak frequency. To do that, you want to use
CALC:MARK1:Y? <-- this will read back the amplitude (power) of the peak using Marker 1
CALC:MARK1:X? <-- this will read back the frequency of the peak using Marker 1
I'm sure that's what I'm looking for!
Retrieving data ...