![Agilent Technologies 81250 Скачать руководство пользователя страница 348](http://html.mh-extra.com/html/agilent-technologies/81250/81250_system-programming-manual-and-scpi-reference_2868601348.webp)
Main.cpp Application Code Using VXI Plug&Play
Example Code
Agilent 81250 Parallel Bit Error Ratio Tester, Programming Reference, March 2006
347
// Check if byte-aligned
if (lHexDigitCount%2)
// Byte-align
lHexDig+;
// Count is required for each trace
lHexDigitCount *= lWidth;
ViInt32 lBufferLength = lHexDig2+1;
ViPChar lpszPattern = (ViPChar)malloc(lBufferLength);
if (lpszPattern == NULL)
{
fprintf(fp, "Insufficient RAM - run aborted\n" );
return false;
}
// Take a sample (in hex)
lStatus = hp81200_segmentPatternData_Q(hInstrument,
lCaptureInspector, 0, 0, lWidth-1, lLength-1, lBufferLength,
lpszPattern);
errHandling(lStatus, "hp81200_PatternData_Q");
fprintf(fp, "Analyzer.%d: %s\n", lAnalyzerPortNumber,
lpszPattern);
// Convert data from Hex format to Binary format
// NOTE: Bits within a trace are "from left to right",
//
i.e. first bit is bit 7, then bit 6 and so on
//
for a 1 bit coding
// Display trace-wise
// Divide data into traces
ViInt32 lHexDigitsPerTrace = lHexDigitCount/lWidth;
// Process each trace
for (ViInt32 t = 0; t < lWidth; t++)
{
fprintf(fp, "Trace %d: ", t);
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com