Assessing the Use of IVI Drivers in Your Test System: Determining When IVI Is the Right Choice Application Note
Total Page:16
File Type:pdf, Size:1020Kb
Assessing the use of IVI drivers in your test system: Determining when IVI is the right choice Application Note If software reuse and system “portability” are important to your organization, it may be to your advan- tage to use IVI drivers in present and future test systems. This is especially true if you are making the shift from GPIB-based control to LAN and LXI: All LXI-compliant instruments include an IVI driver. To help you decide if IVI drivers are • Choices in instrument control Much of the material in this applica- right for your system, this applica- • Why use an instrument driver? tion note has been leveraged from the tion note provides an overview of • Benefits of using an IVI driver IVI Foundation’s IVI Getting Started the technology, presents additional Guide. Sections taken directly from considerations, and describes the • IVI driver classes the Getting Started Guide are marked tradeoffs. The note includes eight • Requirements to use an IVI driver in italics. That document is available major sections: • Tradeoffs and limitations of IVI as a PDF from the IVI Foundation drivers Web site at www.ivifoundation.org. • Steps to getting started • Using IVI drivers in Visual Basic .NET or Visual C# Choices in instrument control There are four choices available for SCPI provides fine-level instrument providing computer-based control of control through a consistent, test- A quick look at SCPI most instruments: focused command set. However, it can be complicated to use with more Beginning in 1989, a group of • Standard Commands for complex instruments where it may instrument manufacturers devel- Programmable Instrumentation seem like programming a computer (SCPI) in assembly language. SCPI carries oped Standard Commands for • A program- or language-specific three other important considerations: Programmable Instrumentation driver (e.g., a LabVIEW driver) (SCPI). This defined a set of • It is not dependent on the operat- • A proprietary driver (supplied with ing system or programming lan- commands for controlling many vendors’ instruments) guage so is highly portable among instruments using ASCII test systems. • An open driver such as IVI characters, providing some basic • It defines common functions, so is Each of these carries a set of standardization and consistency generally portable among instru- tradeoffs. For example, choosing a to the commands used to control ments. proprietary or program-specific driver instruments. For example, when may result in very tight integration • It does not require a certain set of you want to measure a DC volt- with any provided tools or programs; functions, so some calls may not however, this comes at the expense be implemented on similar instru- age, the standard SCPI command of test system portability. You may ments. is “MEASURE:VOLTAGE:DC?.” also be confronted with a com- In many cases, SCPI is a suitable mon problem: the available set of and sufficient choice. However, instrument drivers doesn’t match drivers provide extended capabilities your desired (or required) list of that simplify instrument control and instruments. We’ll talk about the reduce programming time. tradeoffs in using an IVI driver in a later section. SCPI control is one of the most popular methods of programmatically controlling instruments. These com- mands work on instruments that have implemented an appropriate SCPI command set and also contain an on-board command parser, typically implemented through a microproces- sor or state machine. This specifically means that SCPI control will not work on most register-based devices housed in a cardcage (e.g., neither VXI nor PXI architectures). 2 Why use an Benefi ts of using an instrument driver? IVI driver To understand the benefits of IVI Before IVI drivers, there was a stan- This level of commonality—or drivers, we need to start by defining dard framework called VXIplug&play interoperability—was the motivation instrument drivers in general and drivers. This specification defined a behind the development of IVI drivers. describing why they are useful. An standard dynamic-link library (.dll) The specifications define an open instrument driver is a set of software interface; however, did not provide driver architecture, a set of instru- routines that controls a program- for interchangeability among similar ment classes, and shared software mable instrument. Each routine cor- types of instruments. In fact, the nor- components. Together these provide responds to a programmatic operation mal syntax of a VXIplug&play driver consistency and ease of use, as such as configuring, writing to, read- discouraged inter-vendor operability well as the crucial elements needed ing from, or triggering the instrument. because the keywords contained ven- for advanced features. IVI drivers Instrument drivers simplify instrument dor names. Furthermore, the standard also support instrument simulation, control and reduce test program did not define standard keywords for automatic range checking and state development time by eliminating common actions. For instance, one caching. These capabilities provide the need to learn the programming vendor may use “read” while another several benefits: protocol for each instrument. may use “get” as the syntax for acquiring a measured value from an • Instrument simulation enables Although you must be syntactically instrument. program development and debug- correct in all calls to an instrument ging even when an instrument is driver, making calls to a subroutine in In contrast, the IVI standard defines not available. This is particularly your preferred programming language the concept of an “instrument class.” useful when you are waiting for the is less error prone. This is especially For any type or “class” of instru- test hardware to arrive or if several true if you are using a language that ment, common functions have been people must share expensive test supports the Intellisense capabil- defined. Using digital multimeters resources. ity, which presents valid syntax (DMMs) as an example, the IVI driver • Automatic range checking can choices as you type each command. for every DMM from any vendor eliminate unnecessary program- An instrument driver such as IVI uses the measurement command ming errors. integrates more tightly with your IviDmmMeasurement.Read. Once you programming language than will SCPI learn to program the IVI-specified • State caching is optionally imple- calls through the VISA I/O library. commands for the instrument class, mented within the driver. This you can use any vendor’s instrument capability can accelerate the exe- If you’ve been programming instru- without relearning the commands. cution of certain test programs by ments without using a driver, then Commands that are common to all making only the minimum changes you are probably well acquainted drivers, such as Initialize and Close, to the state of an instrument. with the chore of hunting through are identical for every instrument Eliminating unnecessary instrument the programming guide while looking class. This commonality ensures resets, range changes or other similar for the right SCPI command and its portability across test systems and functions can further accelerate the exact syntax. You’ve also been deal- lets you spend less time searching execution of measurement functions. ing with an I/O library to format and through help files or programming an send strings, and then embedding instrument—and leaves more time response strings into variables. Let’s for your primary job. take a look at some advantages of IVI drivers. 3 IVI driver classes Tradeoffs and limitations of IVI drivers The IVI Foundation has created IVI provide the same consistency and The various companies that defined class specifications that define a benefits described above for an IVI the IVI standard tried to minimize the common set of capabilities for drivers driver, but are specific to a device tradeoffs in using an IVI driver. Even for eight instrument classes (Table 1). so lack interchangeability across so, there five key considerations you vendors. should keep in mind: Class IVI driver • An IVI driver may or may not Digital multimeter IviDmm take full advantage of the speed Oscilloscope IviScope capabilities of an instrument. Arbitrary waveform/ IviFgen Requirements to use function generator an IVI driver • An IVI driver will seldom imple- DC power supply IviDCPwr ment the entire feature set of an Switch IviSwitch The primary gating item is the avail- instrument. Power meter IviPwrMeter ability of a specific IVI driver for the • IVI drivers are not available Spectrum analyzer IviSpecAn instrument you want to control. If for all commercially available RF signal generator IviRFSigGen such a driver is available, it must be installed on the controlling computer instruments. Table 1. The IVI standard includes eight along with four other essential items: • The two types of IVI drivers, IVI-C instrument classes. and IVI-COM (Common Object ® • An appropriate Microsoft operat- Model) (see sidebar), mean that ing system and certain operating- you will need to choose one or the In addition to the existing class system services. drivers, there are six other classes in other. To make an informed choice, development as this paper is being • An appropriate programming it’s useful to understand the ben- written. The timer/counter and language. efits and tradeoffs of each type. AC power classes are directed at • An appropriate I/O library. • Your system must meet the general-purpose instruments while requirements