Example Code
Main.cpp Application Code
368
Agilent 81250 Parallel Bit Error Ratio Tester, Programming Reference, March 2006
if (strcmp(aResult, “ANALYZER”) == 0)
{
if (strcmp(aAnalyzers, ““) != 0)
strcat(aAnalyzers, “,”);
strcat(aAnalyzers, aBuf);
a= 1;
}
else
{
if (strcmp(aGenerators, ““) != 0)
strcat(aGenerators, “,”);
strcat(aGenerators, aBuf);
a= 1;
}
}
}
}
// -----------------------------------------------------
// now connect analyzers and generators to one port each
// -----------------------------------------------------
if (aGenCnt > 0)
{
sprintf(aCmd, “sgen:pdat:app ‘INPUT_PORT’,%d,’input’”,
aGenCnt);
h.Call(aCmd);
aGenPort = 1;
sprintf(aCmd, “sgen:conn:pdat%d:term1 (@%s)”, aGenPort,
aGenerators);
h.Call(aCmd);
}
if (aAnaCnt > 0)
{
sprintf(aCmd, “sgen:pdat:app ‘OUTPUT_PORT’,%d,’output’”,
aAnaCnt);
h.Call(aCmd);
aAnaPort = aG 1;
sprintf(aCmd, “sgen:conn:pdat%d:term1 (@%s)”, aAnaPort,
aAnalyzers);
h.Call(aCmd);
}
// -----------------------------------------------
// switch on everything, apply levels / thresholds
// -----------------------------------------------
if (aGenPort > 0)
{
sprintf(aCmd, “sgen:pdat%d:outp on”, aGenPort);
h.Call(aCmd);
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com