Académique Documents
Professionnel Documents
Culture Documents
White Paper
Abstract
The Interchangeable Virtual Instrument Foundation was formed with the purpose of
creating a standard that would allow engineers to use test equipment from different
manufacturers without having to change their instrument control software. While this
is an admirable goal, there's a little more to the story than this first blush would
suggest. In particular, there are several different flavors of IVI, and which of these
versions an engineer uses has implications for that engineer's flexibility. For
instance, IVI-C drivers meet the goal of hardware independence - allowing users to
swap instruments without rewriting software - but are supported only within a
particular vendor’s environment, whereas IVI-COM drivers are not restricted to one
framework. This article will educate the T&M user on the different types of IVI drivers
and examine tradeoffs in order to enable that engineer to make informed choices in
test development.
Background
It has been more than three years now since the IVI Foundation set out to create a
set of instrument driver software standards that would allow T&M engineers to
author test applications that were independent of the underlying test equipment.
Initially, the standardization effort focused on defining C-language interfaces. The
vision for these C-language drivers is that driver developers write conventional DLLs
(on the Windows platform) that expose a flat hierarchy of instrument-specific
functions. A separate component, termed a class driver, is then used to expose
generic functions for interchangeability. Much of the initial momentum for C-style
driver interfaces came from early work National Instruments had performed on C
drivers with their LabWindows/CVI development environment. However, not long
after the IVI Foundation’s public inception, a number of active member companies
began clamoring for a driver standard that would leverage Microsoft’s ubiquitous
component technology known as the Component Object Model (COM). After all,
many of the goals Microsoft pursued with COM seemed enticingly similar to those
sought by IVI. T&M developers want flexibility in their choice of integrated
development environment (IDE) as well as drivers that are easy to use in their IDE
of choice, drivers that perform in multithreaded environments, and drivers that
enable multi-process and multi-host applications. For their part, instrument vendors
need a true component standard – one that allows them to develop a single driver
for any IDE using standard Microsoft tools that leverage existing expertise, rather
than proprietary tools with specific requirements and vendor-specific peculiarities.
These motivations have culminated in a full suite of IVI standards for both C and
COM, termed IVI-C and IVI-COM, respectively. Understanding the differences
Agilent Developer Network White Paper 2 of 5
IVI Standards Tutorial
between these two distinct flavors of IVI is critical to a T&M engineer designing new
test applications. While both flavors of IVI simplify interchangeability, it is more
important to examine the specific technology in use, as this will dictate many of the
benefits of IVI, such as the productivity gains T&M engineers experience.
Along with the COM standardization effort, the IVI Foundation has labored vigorously
to develop architectural standards for IVI drivers. These standards place certain
minimum requirements on IVI drivers independent of the specific instrument class
the driver supports. The idea behind these architectural standards is that drivers
must do certain fundamental operations in a standard way if interchangeability can
be achieved in real-world applications. For instance, the architectural standards
dictate how drivers are installed and configured. Additionally, the IVI Foundation will
be developing, shipping, and maintaining specific software components for
performing configuration, event handling, and other common tasks in a standard
way. Though these architectural standards promise to enable interchangeability,
their greater benefit lies in the ease-of-use, productivity features, and familiarity
they bring to developing test applications with IVI drivers. Again, the driver
technology chosen, IVI-C or IVI-COM, is paramount in maximizing the benefits
derived from this architectural standardization effort. Indeed, many vendors and
users alike find more potential in the architectural standards combined with
standardized component technology, such as COM, than they find in the potential of
robust interchangeability itself. Nevertheless, the end result of the multi-pronged
IVI standardization effort is an entire suite of standards, the many permutations of
which are a persistent source of confusion for T&M users.
One of the most important things to note about IVI-C drivers is their reliance on
proprietary components. For instance, in IVI-C technology, instrument-specific
drivers are developed that expose instrument-specific interfaces. Each function call
exposed by the driver DLL is prefixed with the name of the instrument, so obviously,
these functions cannot be called directly in an application that wants to have
IVI-C drivers also rely upon another component from National Instruments for their
basic operation – the IVI Engine. The IVI Engine is a separate DLL that
communicates with drivers at runtime to provide such services as range checking,
state caching, and coercion. This means that IVI-C drivers cannot operate “stand-
alone”, unlike their IVI-COM counterparts, which provide the same capabilities within
the driver itself. Additionally, the presence of a single centralized component shared
by all IVI-C drivers in an application creates performance considerations. Since the
IVI Engine must service multiple IVI-C drivers, it is possible that these drivers could
contend for some resources or services provided by IVI Engine.
familiarity when dealing with drivers from different vendors, drivers of different
instrument classes, and even custom drivers with no IVI-defined instrument class
support at all.
So, with two choices for interface technology (C or COM) and two choices for
compliance level (class-compliant or custom), there are four distinct types of IVI
drivers:
1. IVI-COM class-compliant driver – exposes a COM interface; supports one
or more IVI-defined instrument classes; complies with architectural standards
2. IVI-C class-compliant driver – exposes a C interface; supports one or
more IVI-defined instrument classes; complies with architectural standards
3. IVI-COM custom driver – exposes a COM interface; complies with
architectural standards
4. IVI-C custom driver – exposes a C interface; complies with architectural
standards
By comparison, the technology .NET provides for integrating conventional DLLs such
as IVI-C drivers is far less appealing. In order to access an IVI-C driver from .NET
code, each .NET application must contain explicit code describing each function to be
used. The .NET application must declare in code a static reference to each function
exposed by the IVI-C driver and it must adorn each of these declarations with
detailed attributes to control such things as the calling convention and whether ANSI
or Unicode strings are in use. For IVI-C drivers, this would mean that each .NET
application would contain hundreds of lines of declarative code for each IVI-C driver
it needed. It is likely that this will prove to be simply intractable for most
developers. Contrast this with COM where a single utility needs to be run only once,
and no extra code in the application is required. Additionally, there is no equivalent
of the tlbexp utility for conventional C DLLs like IVI-C drivers. .NET components
cannot be exported to a conventional DLL. Thus, unlike the situation with IVI-COM
there is no way for a .NET component to seamlessly “impersonate” an IVI-C driver.
In general, T&M developers looking at .NET will find much richer support for IVI-COM
than for conventional DLLs like IVI-C drivers.
Conclusion
This article has examined the IVI Foundation’s standardization effort and the
different types of IVI drivers available. IVI-COM drivers leverage COM technology to
provide a host of benefits when compared to IVI-C. Most popular IDEs provide a
very rich experience for developers working with COM components, while IVI-C
drivers work well in a proprietary environment. Additionally, IVI-C drivers require
the use of secondary components like class drivers and the IVI Engine to perform
their work while delivering interchangeability. Both IVI-COM and IVI-C drivers can
be class-compliant by supporting one of the IVI-defined instrument classes. Or, both
interface types can be used for custom drivers that do not support an IVI-defined
instrument class but that do follow architectural standards that ensure
interoperability with other IVI drivers. Finally, users who may ultimately want to
utilize the new Microsoft .NET platform will have a much better experience doing so
with IVI-COM technology.
Kirk Fertitta is the Chief Technical Officer for Pacific MindWorks, a San Diego-based
consulting firm specializing in Windows application design and development, COM,
and Microsoft .NET. Kirk is an instructor for DevelopMentor where he delivers .NET
courses across the country. He also teaches and develops the .NET curriculum at the
University of California San Diego.
Product and company names mentioned herein are trademarks or trade names of their respective
companies.
Microsoft, Visual Basic, Visual C++, Visual Basic.NET, and .NET are either registered trademarks or
trademarks of Microsoft Corporation in the United States and/or other countries.
LabVIEW and LabWindows are trademarks of National Instruments Corporation.
Delphi is a trademark or registered trademark of Borland Software Corporation in the United States and
other countries.