/* Create the command string which reads bit 1 */

sprintf(bit_str, "DIAG:PEEK? %ld, %d", base_addr+0x43,8);

/* Send DIAG:PEEK? to access the data register 20 times. */

while (loop < 2) /* two bursts (segments) */

{

for (i = index;i < readings; i++)

{

IOOUTPUTS(CMD_MOD, read_str, strlen(read_str)); IOENTER(CMD_MOD, &rdgs[i]);

}

/* Check bit 1 of offset register 43h before proceeding with */ /* the next segment. */

do /* decimal value of bit 1 */

{

IOOUTPUTS(CMD_MOD, bit_str, strlen(bit_str)); IOENTER(CMD_MOD, &bit);

} while ((int)bit & 2 == 0);

index +=20; /* increment index for next segment */ readings +=20; /* increment readings for next segment */

loop++;

/* increment loop */

}

/* Convert to voltages and print the readings */ for (i = 0;i < 20; i++)

{

rdgs[i] /= 16;

/* remove label from reading */

if (rdgs[i] >= 2047 rdgs[i] <= -2046) printf("Reading overrange");

else

printf ("%.6E", (rdgs[i] * 0.0025));

rdgs[i+20] /= 16;

if (rdgs[i+20] >= 2047 rdgs[i+20] <= -2046) printf("\t\tReading overrange\n");

else

printf("\t\t%.6E\n", (rdgs[i+20] * 0.0025));

}

Continued on Next Page

Chapter 2

Using the Digitizer 69

Page 69
Image 69
HP E1429A manual On Next