Agilent Technologies 34420A User Manual page 241

Nano volt/micro ohm meter
Table of Contents

Advertisement

Chapter 6 Application Programs
C Language Programs
... continued
/**************************************************************************/
void meter_meas(void)
{
/* Configure the meter for dc voltage measurements on channel 1
(default channel). The measurement is set up on the 10 volt range
with an integration time of 10 PLCs. */
float readings[5];
int stat_cond, i, numvalues = 5;
static char *cmd_string[]=
{
"SENS:FUNC 'VOLT:DC'",
"SENS:VOLT:DC:RANG 10", /* Select 10 volt range */
"SENS:VOLT:DC:NPLC 10", /* Select 10 power line cycles */
"CALC:FUNC SCAL",
"CALC:STAT ON",
"CALC:SCAL:GAIN 0.001", /* Set the gain value (1 mV) */
"CALC:SCAL:OFFS 0.5",
"SAMP:COUN 5",
"TRIG:SOUR EXT"
};
/* Call the function to execute the command strings shown above */
command_exe(cmd_string, sizeof(cmd_string)/sizeof(char*));
/* Initiate the measurement, wait for the trigger, and then set bit 0
"Operation Complete" in the Standard Event Register when complete. */
IOOUTPUTS(ADDR, "INIT;*OPC", 9);
/* Loop until the SRQ line is asserted when operation complete */
do
IOSTATUS(ISC, 1, &stat_cond);
while (!stat_cond);
/* Transfer readings from internal memory to the output buffer */
IOOUTPUTS(ADDR, "FETC?", 5);
/* Enter readings and print */
IOENTERA(ADDR, readings, &numvalues);
for (i = 0; i numvalues; i++)
printf("%f \n", readings[i]);
/* Select dc volts on channel 1 */
/* Select math scaling function */
/* Turn math scaling on */
/* Set the offset value (50 mV) */
/* Take 5 readings per trigger */
/* Select external trigger source */
6
241

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents