EasyManuals Logo

Keysight 34972A User Manual

Keysight 34972A
353 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
Page #265 background imageLoading...
Page #265 background image
Application Programs 6
Keysight 34970A/34972A User’s Guide 265
C/C++ Example: stat_reg.c
/* stat_reg.c
/************************************************************************************
* Required: VISA library. *
* This program demonstrates the use of the 34970A Status Registers *
* for an alarm and Operation Complete (OPC) and for enabling and receiving *
* an SRQ interrupt. This program also shows how to configure a scan for *
* 10 readings on one channel. *
*************************************************************************************/
#include <visa.h>
#include <stdio.h>
#include <string.h>
ViSession defaultRM; /* Resource manager id */
ViSession DataAcqu; /* Variable to identify an instrument */
char reply_string [256]= {0}; /* string returned from instrument */
double volt [10];
int index, count;
int srqFlag = {0};
/* Function prototypes for SRQ handler */
ViStatus _VI_FUNCH SRQ_handler(ViSession DataAcqu, ViEventType eventType,
ViEvent context,ViAddr userHdlr);
void main ()
{
/* Open communication with DataAcqu using GPIB address "9" */
viOpenDefaultRM (&defaultRM);
viOpen (defaultRM,"GPIB0::9::INSTR",VI_NULL,VI_NULL, &DataAcqu);
/* Reset instrument to power-on and clear the Status Byte */
viPrintf (DataAcqu, "*RST;*CLS\n");
/* Configure the Status Registers to generate an interrupt whenever an alarm
is detected on Alarm 1 or when the operation is complete */
viPrintf (DataAcqu, "STATUS:ALARM:ENABLE 1\n"); /* Enable Alarm 1 */
viPrintf (DataAcqu, "*ESE 1\n"); /* Enable the Operation Complete bit */
/* Enable Status Byte Register bit 1 (2) and 5 (32) for SRQ */
viPrintf (DataAcqu, "*SRE 34\n");
/* Enable the interrupt handler for SRQ from the instrument */
viInstallHandler(DataAcqu, VI_EVENT_SERVICE_REQ, SRQ_handler, (ViAddr)10);
viEnableEvent(DataAcqu,VI_EVENT_SERVICE_REQ, VI_HNDLR, VI_NULL);
/* Configure the instrument to take 10 DC voltage readings on channel 103.
Set the alarm and set SRQ if the voltage is greater than 5 volts.*/
viPrintf (DataAcqu, "CONF:VOLT:DC 10,(@103)\n");
viPrintf (DataAcqu, "TRIG:SOURCE TIMER\n");
viPrintf (DataAcqu, "TRIG:TIMER 1\n");
viPrintf (DataAcqu, "TRIG:COUNT 10\n");
viPrintf (DataAcqu, "CALC:LIMIT:UPPER 5,(@103)\n");
viPrintf (DataAcqu, "CALC:LIMIT:UPPER:STATE ON,(@103)\n");
viPrintf (DataAcqu, "OUTPUT:ALARM1:SOURCE (@103)\n");
viPrintf (DataAcqu, "INIT;*OPC\n");

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Keysight 34972A and is the answer not in the manual?

Keysight 34972A Specifications

General IconGeneral
Model34972A
CategoryData Acquisition/Switch Unit
ManufacturerKeysight Technologies
Scan RateUp to 250 channels/sec
Voltage Measurement Range100 mV to 300 V
Resistance Measurement Range100 Ω to 100 MΩ
Operating Temperature0 °C to 55 °C
Storage Temperature-40 °C to 70 °C
Switching ModulesSupports plug-in modules
Current Measurement Range1 µA to 1 A
Temperature MeasurementThermocouples, RTDs, and Thermistors
InterfaceUSB, LAN
Memory50, 000 readings
Weight3.6 kg

Related product manuals