Agilent Technologies 81250 System Programming Manual And Scpi Reference page 363

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

Advertisement

Example Code
362
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
//
// get vector data as definite length block
sprintf(aCmd, "edit:segm%d:patt:data? 0,0,%d,%d,BIN",
aCapture, aWidth-1, aLength-1);
h.Call(aCmd, aResult);
// extract raw data from definite length block
// a definite length block looks like
// #dlllllbbbbbbbb
// where d is the number of length digits l
// then length binary bytes b are following
// 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);
Agilent 81250 Parallel Bit Error Ratio Tester, Programming Reference, March 2006
Main.cpp Application Code

Advertisement

Table of Contents
loading

Table of Contents