... 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
Содержание 34420A
Страница 1: ......
Страница 2: ......
Страница 13: ...1 Quick Start ...
Страница 31: ...2 Front Panel Operation ...
Страница 55: ...3 Features and Functions ...
Страница 117: ...4 Remote Interface Reference ...
Страница 200: ...5 Error Messages ...
Страница 213: ...6 Application Programs ...
Страница 245: ...6 Chapter 6 Application Programs Microsoft Excel Macro Example 245 ...
Страница 246: ...Chapter 6 Application Programs Microsoft Excel Macro Example 246 ...
Страница 247: ...7 Measurement Tutorial ...
Страница 274: ...8 Specifications ...
Страница 279: ...Dimensions Chapter 8 Specifications 34420A Nano Volt Micro Ohm Meter 280 ...
Страница 294: ......