HP (Hewlett-Packard) B Network Router User Manual


 
/* ********************** Measure ********************* */
int Measure(E1429 *Dig) {
int Errors;
char Buf[BUFLEN+1], **Com;
static char *Commands[] = {
"*RST",
"CONF1:ARR:VOLT (20), 5, (@3)",
"CONF2:ARR:VOLT (20), 5, (@4)",
"ARM:STAR:SOUR IMM",
"ARM:STAR:COUN 2",
"TRIG:STAR:SOUR VME",
"SENS:SWE:OFFS:POIN -10",
"VINS:CONF:VME:MODE GEN",
"VINS:CONF:VME:FEED ’CONV:BOTH32’",
"INIT",
NULL
};
for (Com = Commands; *Com != NULL; Com++)
Dig->SendMessage(*Com);
Errors = 0;
while (Dig->GetErrorMessage(Buf,BUFLEN) != NULL) {
printf("%s\n",Buf);
Errors++;
}
return Errors;
}
/* ********************* ReadData ********************* */
int ReadData(E1429 *Dig) {
int SegCnt, ReadCnt;
LONG *Readings, *Reading, *Reading2;
const static NReadings = 20, NSegments = 2;
const static float Scale = 0.0025 / 16.0;
Reading = Readings = (LONG *)
malloc(NSegments * NReadings * sizeof(LONG));
for (SegCnt = 0; SegCnt < NSegments; SegCnt++) {
while ((Dig->bGet(67) & 2) == 0);
Dig->MGetLongDataReg((ULONG *) Reading,NReadings);
Reading += NReadings;
}
Continued on Next Page
76 Usin
g
the Di
g
itizer Chapter 2