Specifications

Remote Operation
Sample Programs 5
5-17
/* PRES:TOL 0.001 Set control tolerance to 0.001 %FS */
/* OUTP:MODE CONTROL Enter control mode */
/*-----------------------------------------------------------*/
write_7000_serial ("UNIT %FS;:PRES 20.0;TOL 0.001;:OUTP:MODE CONTROL\n");
if (check_errors ( ))
{ serial_close ( );
return;
}
/*-------------------------------------------------*/
/* Read pressure status until setpoint is reached. */
/* */
/* MEAS? Read pressure */
/* STAT:OPER:COND? Read status setpoint */
/*-------------------------------------------------*/
while (!kbhit ( ))
{ if (!request_7000_serial ("MEAS?;:STAT:OPER:COND?\n"))
{ printf ("Timeout\n");
continue;
}
pressure = strtod (buffer, &p);
status = atoi (++p);
if (check_errors ( ))
continue;
if (status & 0x10)
printf ("Pressure = %9.3lf\n", pressure);
if ((status & 2) == 0)
break;
}
/*-------------------------------------------*/
/* Reset 7250 to Measure mode */
/* */
/* OUTP:MODE MEASURE Enter Measure mode */
/*-------------------------------------------*/
write_7000_serial ("OUTP:MODE MEASURE\n");
check_errors ( );
/*------------------------*/
/* Reset Serial Interface */
/*------------------------*/
serial_close ( );
}
/*--------------------------------------------------------------------*/
/* check_errors : display all 7250 error messages */
/* return TRUE if any errors were found */
/*--------------------------------------------------------------------*/
int check_errors (void)
{
unsigned char status7;
int retval;
/*-----------------------*/
/* Check for 7250 Errors */
/*-----------------------*/
retval = 0;
while (!kbhit ( ))
{ if (!request_7000_serial ("*STB?\n"))
{ printf ("Timeout\n");
return TRUE;
}
status7 = atoi (buffer);
if ((status7 & 4) == 0) /* Check error bit */
break;
retval = 1;
request_7000_serial ("SYST:ERR?\n"); /* Get error message
*/
printf (buffer);
}
return retval;