EasyManua.ls Logo

Agilent Technologies 34420A - Page 241

Agilent Technologies 34420A
294 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
... 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’", /* Select dc volts on channel 1 */
"SENS:VOLT:DC:RANG 10", /* Select 10 volt range */
"SENS:VOLT:DC:NPLC 10", /* Select 10 power line cycles */
"CALC:FUNC SCAL", /* Select math scaling function */
"CALC:STAT ON", /* Turn math scaling on */
"CALC:SCAL:GAIN 0.001", /* Set the gain value (1 mV) */
"CALC:SCAL:OFFS 0.5", /* Set the offset value (50 mV) */
"SAMP:COUN 5", /* Take 5 readings per trigger */
"TRIG:SOUR EXT" /* Select external trigger source */
};
/* 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]);
6
Chapter 6 Application Programs
C Language Programs
241

Table of Contents

Related product manuals