1. Introduction to the 34970A Instrument DriverAn instrument driver is a set of software routines that control a programmable instrument. Thousands of instrument drivers, including the driver for the Agilent 34970A, are available for free download from ni.com.
Instrument drivers utilize a set of commands provided by the instrument vendor to communicate with the instrument, often through GPIB, Serial, Ethernet, or USB. Each routine that composes the driver corresponds to a programmatic operation such as configuring, reading from, writing to, or triggering the instrument. Instrument drivers simplify control and reduce test program development time by eliminating the need to learn the unique programming and communication protocol for the instrument.
LabVIEW itself is a graphical development environment for creating flexible and scalable test, measurement, and control applications rapidly and at minimal cost. Unlike other programming environments, all programming in LabVIEW is done graphically through intuitive flowchart-style coding and functional blocks. Hundreds of functional blocks for analysis, signal processing, and mathematics are built-in to the environment, making LabVIEW a smart choice for manipulating raw data collected with the 34970A. With LabVIEW, application development is fast and easy for all users, regardless of experience.
The LabVIEW instrument driver for the 34970A features six ready-to-run example programs. Of course, using the ready-to-run examples requires no LabVIEW coding. The driver also includes a full set of functional building blocks that can be used to create a completely custom 34970A application in LabVIEW.
2. Using the Instrument Driver Examples in LabVIEW
The most straightforward way to take advantage of the LabVIEW instrument driver is to run the example programs, which require only basic user configuration. Figure 1 shows the graphical user interface of one of the 34970A example programs, used to control the 34904A matrix switch module. To run this example, the user first sets the GPIB or serial communication parameters. Then, with the example running, the user can toggle any LED in the array to open or close a matrix cross point on the 34904A module.
Figure 1. User interface for 34970A Matrix Switch Example.
Six such ready-to-run examples are provided by National Instruments in the driver. These are:
- EZ Scan Example: Demonstrates basic current and frequency measurements on a multiplexer module
- Advanced Scan Example. Demonstrates voltage and resistance measurements on a multiplexer module, and shows how to create a single scan list with multiple types of readings.
- Switch Example. Demonstrates switching with the 34901A and 34903A modules, and toggles cross points with an LED matrix interface.
- Matrix Switch Example. Demonstrates matrix switching on the 34904A. (The user interface for this example is the one pictured in Figure 1.)
- RF Mux Example. Demonstrates RF switching on the 34905A and 34906A.
- Multifunction Example. Demonstrates use of the 34907A module, with capabilities for controlling analog output, counter (totalizer), and digital input/output channels.
Though all of these examples are intended to serve as a starting point for the creation of a custom application, they may be used without modification to immediately control the Agilent 34970A.
3. Creating Custom 34970 LabVIEW Applications
When you wish to extend the capabilities of the examples, or wish to start a new custom application, the set of LabVIEW functions installed with the instrument driver provide all the building blocks you will need. In LabVIEW, each of these programmatic building blocks is called a virtual instrument, commonly referred to as a VI. Any custom LabVIEW application you create will be composed of a front panel, which is the graphical user interface, and a block diagram, which is the flow chart-style code created with these functional blocks (VIs).
Creating a custom 34970A application in LabVIEW does require a basic familiarity with LabVIEW’s graphical programming. For resources that outline the fundamentals of this industry-standard development environment, please refer to the links at the end of this section.
When the LabVIEW instrument driver for the 34970A is installed, palettes containing high-, mid- and low level instrument driver VIs are made available to you in LabVIEW. Each palette represents a distinct category of instrument driver functions for programming the 34970A. Two instrument driver palettes are shown below, in Figure 2.
Figure 2. Two of the palettes installed with the 34970A LabVIEW instrument driver.
Use the instrument driver VIs to define your custom application. In Figure 3, we show the block diagram of a sample application created with these VIs. This application initializes communication with the 34970A, takes 10 voltage readings from each channel in the scan list, and finally ends communication and checks for errors. It displays the acquired data on a front panel indicator (not pictured).
Figure 3. Sample code created with instrument driver functions.
A significant advantage of customizing your LabVIEW application is that it enables you to combine the unique functions of the instrument driver with the standard functions built-in to LabVIEW. With these, you can quickly and easily take your application far beyond merely programming the instrument to create a completely user-defined solution.
Let’s suppose, for instance, that after acquiring data in the example above, we wished to detect the peak values in the data set and log those to file. Since peak detection is one of the analysis functions available in LabVIEW, we can easily add that functionality to our application. LabVIEW can also be used to interface with a data management system, whether that consists of a simple spreadsheet file or a relational database. The block diagram in Figure 4 extends the functionality of our previously created code to discover the peaks of the dataset and then log those values to a tab-delimited text file compatible with Excel.
Figure 4. Sample Code Showing Peak Detection and Saving to File.
Because creating crisp graphical user interfaces in LabVIEW is easy, we could have also chosen to visualize the data in a chart or graph. We could have even posted the application’s user interface to a web page for remote monitoring and control, using the built-in LabVIEW web server. For information on the features available in LabVIEW, or to immediately test drive LabVIEW free online, please refer to the links below.
LabVIEW Test Drive
4. Add Speed and Sensor Compatibility to Your Test and Measurement System
As outlined above, using the 34970A with a LabVIEW instrument driver creates a useful PC-based virtual instrumentation system for acquiring, analyzing, and presenting test data. If you are looking for an easy way to increase the speed, sensor support, and channel count of your test and measurement system then you may want consider adding NI CompactDAQ hardware to your setup. The ease of use and flexibility of LabVIEW programming will seamlessly integrate the NI CompactDAQ platform with your 34970A hardware. The built-in USB connectivity of NI CompactDAQ makes it a simple and portable addition to your system, while also providing higher acquisition rates and the bandwidth needed to add dynamic signal measurements to your LabVIEW programs. Figure 5 below shows how one additional VI in your LabVIEW program can incorporate NI CompactDAQ data, including measurements from microphone, accelerometer, and strain gauge sensors.
Figure 5. Showing the Simplicity of Adding NI CompactDAQ to Existing Programs.
The NI CompactDAQ platform is an excellent hardware option to consider when adding to or creating a user-defined, PC-based data logging or bench top automated test system. NI CompactDAQ combines USB device detection, built-in signal conditioning, direct sensor and signal connectivity, hot-swappable modules, and automatic module configuration to make a simple, complete, cost-effective data acquisition system all in one small platform. Figure 6 below shows the NI CompactDAQ platform along with an example of an individual module. The National Instruments cDAQ-9172 is an 8-slot chassis that accepts hot-swappable, autodetectable I/O modules capable of directly connecting to broad range of analog and digital I/O signals. Rates up to 400 kS/s per module (3.2 MS/s per chassis) are achievable through Hi-Speed USB plug-and-play connectivity to PC’s, and the NI CompactDAQ platform can provide up to 24-bit resolution and 256 channels per chassis. Setting up the hardware to achieve these high rates, resolutions, and channel counts has never been easier or quicker. With the time-saving features that the NI-DAQmx API provides, such as LabVIEW code generation and test panels, you can quickly begin logging and analyzing your measurements. NI CompactDAQ truly is the shortest distance from sensor to software.
Figure 6. NI cDAQ-9172 8-Slot Chassis (left) and NI-9233 IEPE Sensor Module (right).
The advantages of the NI CompactDAQ platform become even clearer when compared to the 34970A hardware solution for a typical test system. Table 1 below shows how both platforms meet the requirements for signal type and channel count. However, with this setup all 3 of the Agilent 34970A module slots are full, while the NI CompactDAQ has one slot still available for additional I/O functionality. For instance, another NI CompactDAQ module could be added to acquire dynamic signal data from various kinds of IEPE sensors. No hardware exists to measure these types of transducers using the 34970A. The most striking difference between the two systems is that the NI CompactDAQ solution provides a savings of nearly $400. This money could be better spent on expanding the NI CompactDAQ system. For example, $400 could upgrade one of the NI CompactDAQ analog input modules from 4 channels to 32 channels.
Table 1. Comparison of NI CompactDAQ and Agilent 34970A for a Typical Test System.
Though the 34970A has an appealing suite of capabilities including measurement flexibility and 6.5 digit accuracy, it lacks several other features that may be important for your application. These 34970A shortcomings include:
- Slow sampling speeds which are suitable for only slow-varying DC signals: 5 or 6 samples per second at the highest accuracy, and only 60 to 250 samples per second at the lowest accuracy
- Limited MIO capabilities, specifically in pattern analog output generation and digital pattern input and output
- Electromechanical relays that affect not only sampling speed but also maintenance costs and the life of the modules
- Cannot measure load cells or IEPE sensor (accelerometers, microphones)
- Only 60 differential/120 single-ended maximum channels per box
NI CompactDAQ Home
The Agilent 34970A is a good instrumentation solution for manual bench top testing. However, a better solution can be achieved using the NI CompactDAQ platform to create easy-to-use PC-based data logging and bench top measurement systems, often with better performance at a lower cost.