![Agilent Technologies 81250 System Programming Manual And Scpi Reference Download Page 352](http://html.mh-extra.com/html/agilent-technologies/81250/81250_system-programming-manual-and-scpi-reference_2868601352.webp)
Lib.cpp Interface Class Library Code
Example Code
Agilent 81250 Parallel Bit Error Ratio Tester, Programming Reference, March 2006
351
Lib.cpp Interface Class Library
Code
The following code provides the library functions for initializing the
system, dealing with handles, executing the SCPI commands, and
logging errors.
//
// small interface class to the 81200A
//
// provides error logging, handle-handling
//
// This example is limited in functionality, because there
// are fixed command and response buffers.
//
#include <ctype.h>
#include <string.h>
#include <hp81200.h>
#include “lib.h”
// init
HP81200::HP81200()
: itsErrorFile(0), itsConnected(false)
{
strcpy(itsHandle, ““);
strcpy(itsResultBuffer, ““);
}
// make sure we released handle and disconnected from the system
HP81200::~HP81200()
{
// assure that handle is destroyed...
if (strcmp(itsHandle, ““) != 0)
(void)Exit();
}
// Connect to 81200 server on local machine or “theServerName”.
// Creates a handle for the system “theSystemName”.
// This handle is internally handled, so that we do not need
// to specify it with each command.
bool HP81200::Init(
const char* theServerName,
const char* theHandleSuggestion,
const char* theSystemName,
FILE* theErrorFile)
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com