Agilent Technologies 81250 System Programming Manual And Scpi Reference page 373

Parallel bit error ratio tester
Hide thumbs Also See for 81250:
Table of Contents

Advertisement

Example Code
372
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
// Example: #90000000012xxxxxxxxxxxx
// where x stands for any value between 0 and 255,
// it may not be a readable character!
memcpy(aBuf, &aResult[2], (size_t)(aResult[1] - '0'));
aBuf[aResult[1]] = '\0';
int aBytes = 0;
sscanf(aBuf, "%d", &aBytes);
memcpy(aBuf, &aResult[2+aResult[1]-'0'], (size_t)aBytes);
// print out the data trace-wise
// - each trace begins on a byte boundary
// - bits within a trace are "from left to right",
//
meaning that first bit is bit 7, than bit 6
//
and so on for a 1 bit coding.
for (int t = 0; t < aWidth; t++)
{
fprintf(fp, "Trace %d: ", t);
for (int l = 0; l < aLength; l++)
{
fprintf(fp, "%c", '0' +
((aBuf[t * ((aLength+7)/8) + l/8] >> (7 - l%8)) & 1)
);
}
fprintf(fp, "\n");
}
}
// save segments under a different name to the local setting
sprintf(aCmd,
"edit:segm%d:save 'LocalSegments\\prog_sample_capture'",
aCapture);
h.Call(aCmd);
sprintf(aCmd,
"edit:segm%d:save 'LocalSegments\\prog_sample_errmem'",
aErrMem);
h.Call(aCmd);
// export segments
// we do this now before the segments are closed, because
// they are now still in memory
sprintf(aCmd,
"mmem:segm:save 'c:\\temp\\prog_sample_capture.txt', '%s',
'prog_sample_capture'", SETTING_NAME);
h.Call(aCmd);
sprintf(aCmd,
"mmem:segm:save 'c:\\temp\\prog_sample_errmem.txt', '%s',
'prog_sample_errmem'", SETTING_NAME);
h.Call(aCmd);
Agilent 81250 Parallel Bit Error Ratio Tester, Programming Reference, March 2006
Main.cpp Application Code

Advertisement

Table of Contents
loading

Table of Contents