HP E8402A User And Service Manual page 53

Vxi c-size mainframe
Table of Contents

Advertisement

Chapter 3
/* Read and Print temperature TRACe data for slot OUTF5 */
/* Compute the number of elements in teh tracArray[] */
siz = sizeof(tracArray) / sizeof(tracArray[0]); /* siz is initially max data count */
/* Read TRACe raw data for slot 5 Front (OUTF5) into tracArray[] and get the actual
data count */
errStatus = viQueryf(en_mon, "TRAC:DATA? OUTF5\n", "%#hb%*t",
CHECKERR(errStatus, __LINE__);
/* Now read the PREamble that describes this trace data. Note that you
MUST read the TRAC data immediately prior to reading the PREamble. */
errStatus = viQueryf(en_mon, "TRAC:DATA:PRE? OUTF5\n", "%t", preamble);
CHECKERR(errStatus, __LINE__);
printf("PREamble: %s\n", preamble); /* For visual reference */
/* Extract the various fields of the PREamble. */
sscanf(preamble, "%hd,%hd,%hd,%hd,%hd,%ld,%hd,%f,%hd,%hd",
&format, &type, &points, &count, &xincrement, &xorigin,
&xreference, &yincrement, &yorigin, &yreference);
/* Print scaled Temperature trace data */
if (siz > 0) {
printf("Scaled times:temperatures for trace OUTF5\n");
/* Note that TRAC data for +2 (2 seconds after turn-on) is not valid.
Invalid (unacquired) data in TRAC is set to -1 (-0.1 degree) */
for (i=0; i<siz; i++) {
scaledTimes[i] = ((i-xreference) * xincrement) + xorigin;
scaledTemps[i] = ((tracArray[i]-yreference) * yincrement) + yorigin;
printf("%5d: %3.1f,
}
}
/* Read and print temperature HISTogram data for slot OUT5 into histArray[] */
/* Set units of returned data to seconds */
errStatus = viPrintf(en_mon, "HIST:UNIT:TIME SEC\n"); /* max precision */
CHECKERR(errStatus, __LINE__);
/* Get the array of histogram values */
errStatus = viQueryf(en_mon, "HIST:TEMP:HIST? OUT5\n", "%,10d", histArray);
CHECKERR(errStatus, __LINE__);
/* Get the array of histogram "buckets" minima */
errStatus = viQueryf(en_mon, "HIST:TEMP:HIST? OUT5,MIN\n", "%,10d",minArray);
CHECKERR(errStatus, __LINE__);
/* Get the array of histogram "buckets" maxima */
errStatus = viQueryf(en_mon, "HIST:TEMP:HIST? OUT5,MAX\n", "%,10d",maxArray);
CHECKERR(errStatus, __LINE__);
&siz, tracArray); /* siz receives actual data count */
/* we have some trace data */
/* scale it, store it, and display it. */
", scaledTimes[i], scaledTemps[i]);
Programming the Enhanced Monitor
55

Advertisement

Table of Contents
loading

This manual is also suitable for:

E8404a

Table of Contents