EasyManuals Logo

Pendulum CNT-90 Series Programmer's Handbook

Pendulum CNT-90 Series
264 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #59 background imageLoading...
Page #59 background image
for (i=0; i<Samples; i++) {
Val = *((double*)pBuf);
pBuf += 8;
if (i == 0 && _isnan(Val)) {
// Invalid value response.
printf("The instrument is apparently no longer
measuring.\n");
Failed = true;
break;
}
TSVal = *((__int64*)pBuf);
pBuf += 8;
// Do something with the fetched result. For this
// test just check that the measurement result seems
// reasonable and that the timestamps increase as
// they should.
if (CheckMeas(Val, Args))
printf("Bad result of measurement %lf: %g %s\n",
(double)Count, Val, (Args.bPeriod ? "s" : "Hz"));
// Check that the timestamps keep increasing during
// the test run.
if (TSVal <= PrevTSVal) {
printf("Invalid timestamp, sample %lf, prev =
%lf, Cur = %lf\n",
(double)Count, (double)PrevTSVal * 1e-12,
(double)TSVal * 1e-12);
}
// Check for gaps in the measurement data. This will
// happen if we try to measure faster than we can
// keep up with fetching.
if (Count != 0 &&
fabs((double)(TSVal - PrevTSVal) * 1e-12 -
Args.Pacing) >
1.5 * Args.Pacing) {
printf("Gap: %lf -> %lf\n",
(double)PrevTSVal * 1e-12,
(double)TSVal * 1e-12);
}
PrevTSVal = TSVal;
Count++;
// Display some progress.
if (Count % 10000 == 0) {
printf("Sample %.0lf, value %.8le, timestamp
%lf\n",
(double)Count, Val, (double)TSVal *
1e-12);
}
Programming Examples
Error Code 4-23

Table of Contents

Other manuals for Pendulum CNT-90 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Pendulum CNT-90 Series and is the answer not in the manual?

Pendulum CNT-90 Series Specifications

General IconGeneral
BrandPendulum
ModelCNT-90 Series
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals