Chapter 7 Application Programs

Example Programs for C and C++

do{ /* Stay in loop until the srqFlag goes negative */ index = 1;

for (count = 0; count <45; count++)

{

index = 0; printf(".");

}

printf(" srq flag = %d\n",srqFlag);

}

while (srqFlag>=0); /* A negative srqFlag indicates scan is done */ /* The instrument is done, so close the SRQ handler */

viDisableEvent(DataAcqu,VI_EVENT_SERVICE_REQ,VI_HNDLR); viUninstallHandler (DataAcqu,VI_EVENT_SERVICE_REQ,SRQ_handler,(ViAddr)10);

viPrintf (DataAcqu,"FETCH?\n"); /* Get all the readings */ viScanf(DataAcqu,"%,10lf",&volt); /* Put readings into an array */

for (index = 0;index<10;index++){ /* Print the readings */ printf("reading %d = %lf\n",index+1,volt[index]);

}

viClose (DataAcqu);

/* Close the communication port */

viClose (defaultRM);

 

}

 

/* This function will be called when the instrument interrupts the controller with an SRQ for alarm and/or Operation Complete */

ViStatus _VI_FUNCH SRQ_handler(ViSession DataAcqu, ViEventType eventType, ViEvent context,ViAddr userHdlr)

{

ViUInt16 statusByte;

viReadSTB(DataAcqu,&statusByte); /* Read status byte register and clear SRQ */ /* Bit 6 (64) indicates this SRQ is for our instrument, bit 1 (2) indicates

an alarm, and bit 5 (32) indicates the standard event register; so alarm 64+2=66; OPC 64+32=96; both 64+32+2=98 */

if ((statusByte==66)(statusByte==98)){

srqFlag = 1; /* Set flag to indicate this is an alarm */

viPrintf (DataAcqu,"STATUS:ALARM:EVENT?\n"); /* Check and clear alarm */ viScanf(DataAcqu,"%s",&reply_string);

printf("alarm event; bit = %s\n",reply_string);

}

if ((statusByte==96)(statusByte==98)){

srqFlag = -1; /* Set flag to indicate end of operation */ viPrintf (DataAcqu,"*ESR?\n"); /* Check and clear ESR bit */ viScanf(DataAcqu,"%s",&reply_string);

printf("Standard Event Register; bit %s\n",reply_string);

}

return VI_SUCCESS;

}

7

331

Page 333
Image 333
Agilent Technologies 34970A manual 331

34970A specifications

Agilent Technologies 34970A is a versatile data acquisition and measurement system that has gained popularity in various industries, including research and development, manufacturing, and education. The primary purpose of the 34970A is to offer an efficient solution for data collection, monitoring, and analysis, which can significantly enhance productivity and accuracy in testing applications.

One of the main features of the 34970A is its modular design, allowing users to customize the system according to their specific measurement needs. The mainframe can accommodate up to three plug-in measurement modules, which can include various types of measurements such as analog, digital, temperature, and frequency. This modularity provides flexibility for users to tailor the system to their requirements, making it highly adaptable to different applications.

Another notable characteristic of the Agilent 34970A is its impressive channel configuration. The system can support up to 120 measurement channels when fully configured, enabling extensive data acquisition without the need for multiple devices. This capability is essential for applications requiring simultaneous monitoring of multiple parameters or locations.

The 34970A utilizes advanced signal processing technologies to ensure high-accuracy measurements. The internal 6.5-digit resolution multimeter provides precise readings, while the device also supports various input types, such as thermocouples and RTDs for temperature measurements. The ability to perform mathematical functions, such as summation and averaging, on the acquired data further enhances its usability.

For data storage and management, the Agilent 34970A features built-in memory for storing up to 20,000 readings. Users can also easily transfer data to a PC through the RS-232 interface or GPIB (IEEE 488) for further analysis and reporting. Additionally, it offers the capability to program automatic data logging and scheduling of measurements, which streamlines the testing process and reduces manual intervention.

In terms of user interface, the 34970A is equipped with a large graphical display that provides clear visualization of measurement data and easy navigation through settings and options. The menu-driven interface makes it accessible for users of all skill levels, simplifying the setup and operation of the device.

Overall, the Agilent Technologies 34970A stands out for its modularity, high channel capacity, advanced measurement technologies, and user-friendly interface. As a reliable and efficient data acquisition system, it is well-suited for a wide range of applications, making it an essential tool for engineers and technicians looking to enhance measurement precision and efficiency.