Technical data

Agilent Signal Generators Programming Guide 73
3 Programming Examples
NOTE For the N5161A/62A the softkey menus and features mentioned in this chapter are only
available through the Web- Enabled MXG or through SCPI commands. Refer to “Using the Web
Browser on page 11 and to the SCPI Command Reference.
Using the Programming Interface Examples on page 73
GPIB Programming Interface Examples on page 78
LAN Programming Interface Examples on page 116
RS- 232 Programming Interface Examples (ESG/PSG Only) on page 152
Using the Programming Interface Examples
The programming examples for remote control of the signal generator use the GPIB, LAN, and
RS- 232 interfaces and demonstrate instrument control using different IO libraries and programming
languages. Many of the example programs in this chapter are interactive; the user will be prompted
to perform certain actions or verify signal generator operation or functionality. Example programs are
written in the following languages:
These example programs are also available on the signal generator Documentation CD- ROM, enabling
you to cut and paste the examples into a text editor.
NOTE The example programs set the signal generator into remote mode; front panel keys, except
the Agilent MXG Local/Esc/Cancel or the ESG, and PSG Local key, are disabled. Press the
Agilent MXG Local/Esc/Cancel or the ESG, PSG Local key to revert to manual operation.
To have the signal generator’s front panel update with changes caused by remote operations, enable
the signal generator’s Update in Remote function.
NOTE The Update in Remote function will slow test execution. For faster test execution, disable the
HP Basic C#
C/C++ Microsoft Visual Basic 6.0
Java MATLAB
Perl