void main(void)
/* run the program */
{
clrscr();
/* clears screen (turbo C only) */
rst_clr();
/* reset the scanning multimeter */
scan_mult(); /* function to configure multimeter and take readings */
}
/
******************************************************************/
void scan_mult(void)
{
time_t T1, T2;
int c = 0, i = 0, j = 0, length = 0, swap = 0, bytes = 0;
float *rdgs, rdy;
char lf_remove[1];
/* dynamically allocate memory for readings */
rdgs = malloc(8000 * sizeof(float)); /* float = 32-bit real number */
/* set number of bytes placed in memory, and number of bytes read */
swap = size of (float);
/* place 4 bytes/reading in memory */
bytes = 8000 * swap;
/* read 32,000 bytes */
/* configure the scanning multimeter and wait for configuration to complete */
IOOUTPUTS(ADDR, "CONF:VOLT:DC
(@1(00:15),2(00:15),3(00:15),4(00:01))", 51);
IOOUTPUTS(ADDR, "VOLT:RANGE 10;:CAL:ZERO:AUTO
OFF;:VOLT:APERMIN",47 );
IOOUTPUTS(ADDR, "FORMAT REAL,32",14 );
IOOUTPUTS(ADDR, "*OPC?", 5);
/* wait for configuration to complete */
IOENTER(ADDR, &rdy);
/* enter *OPC? response from multimeter */
/* function call to check for multimeter configuration errors */
check_error("scan_mult");
T1 = time(NULL);
/* get start time */
/* program loop which set 4, 40 scan measurements */
for (c = 0; c 4; c++)
{
/* program loop which scans the 50 multiplexer channels 40 times */
for (i = 0; i 40; i++)
{
IOOUTPUTS(ADDR, "INIT", 4);
/* trigger multimeter */
IOOUTPUTS(ADDR, "FETCH?", 6);
/* fetch the readings */
IOENTERAB(ADDR, rdgs, &bytes, swap);
/* enter readings and remove
block header*/
/* remove line feed which trails the last data byte */
length = 1;
IOENTERS(ADDR, lf_remove, &length);
/* compare each reading to a set of limits */
for (j = 0; j 50; j++)
{
Continued on Next Page
Chapter 3
Using the HP E1326B/E1411B Multimeter 61
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com