If my PSA is at a low attenuation, say 0 dB, and I issue the SCPI command to set the reference level (it's embedded in a string of commands) high, say 20 dBm, I get no errors reported but (probably as expected) the PSA sets the reference level to -10 dBm.
I've since fixed the code to set the attenuation first but I would've thought that setting the reference level to something other than what is specified would produce an error.
I think it is the restriction of the max mixer input level of the E4440A, you can find it at AMPT/NEXT/NEXT/MAX MIXER LVL (normally is -10dBm).
You should make sure that the input level to the mixer is less than the max value, i.e. the RF Input Level - Int Att ≤ Max Mixer Level. The E4440A ensures this in top priority, so the reference level may be automaticly adjusted.
When you remotely set the analyzer to a value past its range for the current operating conditions, it will instead set the value to the maximum and will put an error in the error queue to the effect of: -222,”Data out of range;value clipped to upper limit.”
You can query the error queue by sending the command: syst:err?
I apologize, but only X-Series Analyzers report an error. PSA does not. For PSA the work around would be to query the value after you set it to make sure it is the value that you want and has not been clipped. Here is an example showing an N9030A actually returning an error after setting the reference level too high:
<- +0,"No error"
-> :POW:ATT 0
-> :DISP:WIND:TRAC:Y:RLEV 20 DBM
<- -222,"Data out of range;The value 20 was clipped to the maximum value of -20."