![Agilent Technologies 81250 Скачать руководство пользователя страница 41](http://html.mh-extra.com/html/agilent-technologies/81250/81250_system-programming-manual-and-scpi-reference_2868601041.webp)
Overview of the SCPI Command Structure
Example Programs
40
Agilent 81250 Parallel Bit Error Ratio Tester, Programming Reference, March 2006
Example C++ Program
This example is intended to show the more sophisticated steps of
analyzing the system configuration and setting up the system as
required, importing segment data, and running a measurement in
“compare and acquire around error” mode. Furthermore, the Edit
subsystem is used to handle the captured data.
The example program is divided into
“The main() Procedure” on
page 41
and
“The doIt() Procedure” on page 41
. The program uses a
small interface class (see
“The lib.cpp Interface Class Library” on
page 40
) that provides methods for initializing the system, dealing
with handles, executing the SCPI commands, and logging errors.
By default, the files with the example code (main.cpp, lib.cpp, and
lib.h) can be found in the Agilent 81250 installation directory:
C:\Program Files\Agilent\Agilent 81200\samples\ecap
The lib.cpp Interface Class Library
The file lib.cpp defines the HP 81200 class, which is an interface class
to the Agilent 81250 system. The class itself uses the
“Agilent 81250
String Interface Library” on page 22
.
For a complete listing, refer to
“Lib.cpp Interface Class Library Code”
on page 351
.
The class provides the following public methods:
• Init()
The
Init()
method connects to an Agilent 81250 server on the local
machine or to a specified server. It creates a handle for the specified
system. This handle is only used within the class. An extra
parameter specifies a file to be used for error logging.
• Exit()
The
Exit()
method releases the handle and disconnects from the
system.
• Call()
There are two
Call()
methods, distinguished by the number of
parameters: one to execute SCPI commands, one to execute SCPI
queries.
Both methods return “false” in case of an error. The query method
features an additional parameter to return the result of the query.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com