136 Chapter3
Programming Examples
Saving and Recalling Instrument State Data
Saving and Recalling Instrument State Data
This C programming example (HPE4406State.c):
• uses the VISA library for input/output, opens a session to a GP-IB
device at address 18 and presets the instrument
• sets the input to the internal 50 MHz reference source and tunes the
instrument to the signal
• selects a resolution bandwidth, display scaling, and reference level
• initiates a spectrum measurement and waits for the operation to
complete
• saves the current state to register 10, replacing anything that is
currently in register 10
• displays a message and waits for a key press before resetting the
instrument
• displays a message and waits for a key press before recalling the
instrument stored in register 10
• zooms the spectrum display and again displays a message waiting
for a key press before resetting the instrument