... 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
Summary of Contents for 34420A
Page 1: ......
Page 2: ......
Page 13: ...1 Quick Start ...
Page 31: ...2 Front Panel Operation ...
Page 55: ...3 Features and Functions ...
Page 117: ...4 Remote Interface Reference ...
Page 200: ...5 Error Messages ...
Page 213: ...6 Application Programs ...
Page 245: ...6 Chapter 6 Application Programs Microsoft Excel Macro Example 245 ...
Page 246: ...Chapter 6 Application Programs Microsoft Excel Macro Example 246 ...
Page 247: ...7 Measurement Tutorial ...
Page 274: ...8 Specifications ...
Page 279: ...Dimensions Chapter 8 Specifications 34420A Nano Volt Micro Ohm Meter 280 ...
Page 294: ......