Example Code
Main.cpp Application Code
366
Agilent 81250 Parallel Bit Error Ratio Tester, Programming Reference, March 2006
return true;
}
// Call 81200, handle is automatically supplied by the class.
// Errors are logged to the logfile.
// In case of an error, false is returned.
// Results are returned as a pointer to an internal buffer,
// so before calling Call again, the results must be otherwise
// saved.
bool HP81200::Call(const char* theCmd, const char*& theResult)
{
theResult = itsResultBuffer;
return Call(theCmd);
}
int main()
{
bool b;
HP81200 a;
FILE* fp;
//fp = fopen(“c:\\temp\\sample_4.txt”, “w”);
fp = stdout;
// init access to local 81200 firmware server, system “DSRA”
// Errors are logged to a file (which may be stdout).
b = a.Init(““, “a”, SYSTEM_NAME1, fp);
if (b) {
fprintf(fp, “System %s:\n”, SYSTEM_NAME1);
b = doIt(a, fp);
}
// release handle, disconnect from server
(void)a.Exit();
// wait, so that user could see the results
if ((fp == stdout) || (fp == stderr))
{
printf(“press any key to continue\n”);
(void)getchar();
}
else
fclose(fp);
return 0;
}
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com