Example Code
Main.cpp Application Code
370
Agilent 81250 Parallel Bit Error Ratio Tester, Programming Reference, March 2006
// ------------------------------------------------
// set meausurement mode
// compare and acquire around error
// ------------------------------------------------
if (aAnaPort > 0)
h.Call(“sgen:glob:conf:ecap”);
// ------------------------------------------------
// save setting for later use
// ------------------------------------------------
sprintf(aCmd, “mmem:sett:save ‘%s’”, SETTING_NAME);
h.Call(aCmd);
// ------------------------------------------------
// start measurement
// ------------------------------------------------
h.Call(“sgen:glob:init:cont on”);
// ------------------------------------------------
// poll measurement done
// THIS ONLY WORKS ONLINE!!!
// ------------------------------------------------
for (;;)
{
h.Call(“sgen:glob:syst:stat?”, aResult);
if (strncmp(aResult, “FIN”, 3) == 0)
break;
}
// -------------------------------------------------
// stop measurement
// -------------------------------------------------
h.Call(“sgen:glob:init:cont off”);
// -------------------------------------------------
// - demonstrate the edit subsystem how to deal with
// captured data
// - export the captured data and the error memory
// -------------------------------------------------
if (aAnaPort > 0)
{
sprintf(aCmd, “edit:segm:open? ‘Analyzer\\Capture.%d’”,
aAnaPort);
h.Call(aCmd, aResult);
int aCapture;
sscanf(aResult, “%d”, &aCapture);
sprintf(aCmd, “edit:segm:open? ‘Analyzer\\ErrMem.%d’”,
aAnaPort);
h.Call(aCmd, aResult);
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com