5-6 Automating Measurements
Automated Measurement Setup and Control
Setting the Instrument State
Using Learn Strings to Save and Recall
Instrument States
The IEEE 488 *LRN (“learn”) command can also be used to set or query a
complete set of instrument parameters. This can be used as a
programming convenience, eliminating the need for using disk files when
saving and recalling instrument states.
To obtain the learn string containing the instrument state, use the
command *LRN? as follows:
10 DIM State1$[4000]
20 OUTPUT @Rfna;"*LRN?"
30 ENTER @Rfna USING "-K";State1$
...
160 ! Put the learn string back
170 OUTPUT @Rfna;State1$
Since *LRN?, by IEEE definition, only contains the actual instrument
state, exclusive of data traces and calibration arrays, the network
analyzer provides the command
SYST:SET:LRNLong?
This command saves the data traces and calibration arrays if they are
enabled using  or by using the
MMEM:STOR:STATE SCPI commands. Using the *LRN command to set
the instrument settings takes about the same amount of time as
recalling a file from disk using MMEM:LOAD:STATe.
For more details on learn strings, refer to the Example Programs Guide.
SAVE RECALL