Overview
Driver software is usually overlooked when developing an instrument control system. It handles the communication layer between instruments and application software. While hardware specifications are important, poor driver software can greatly impact the development time and performance of your entire system. You can control your instruments in two different ways: through direct I/O commands or by using an instrument driver. Here are five questions to keep in mind when evaluating driver software for communicating with an instrument.
5 Questions to Ask When Choosing the Right Driver Software
- Do I Want to Use Direct I/O Commands or an Instrument Driver to Control My Instrument?
- Is the Driver Compatible With My OS?
- How Well Does the Driver Integrate With My Application Software?
- What Documentation Comes With the Driver?
- Does the Driver Include Any Setup or Diagnostic Utilities?
1. Do I Want to Use Direct I/O Commands or an Instrument Driver to Control My Instrument?
You can control your instruments through direct I/O commands or by using an instrument driver. Generally, an instrument driver is the preferred approach because it is more efficient and saves time.
Direct I/O Commands
If you can’t find an instrument driver for your particular instrument or if you don’t need to use an instrument driver, you can use interactive tools for direct I/O control and communication. Here are a few reasons why you wouldn’t use an instrument driver:
-
- You need to send only a few commands to your instrument
- An instrument driver doesn’t exist
- You don’t need to distribute a set of instrument commands to other developers
Instrument Driver
An instrument driver is a library that contains high-level functions to control a specific instrument or family of instruments. They are the key to rapidly developing test and measurement applications. By providing high-level and modular libraries for easy programming, they eliminate the need for you to learn complex, low-level programming protocols that may be specific to one instrument. An instrument driver is a set of software routines that correspond to a programmatic operation such as configuring, reading from, writing to, and triggering the instrument. In addition, because instrument drivers typically have a common structure and API for instruments in the same class, once you have used one instrument driver, it is easy to use another. Two types of instrument drivers meet the differing requirements of instrument control and test applications:
- Plug-and-play instrument drivers simplify controlling and communicating with your instrument through a standard and simple programming model for all drivers. They provide native source code that’s easily integrated into software programming environments and make interacting with hardware easier than with other instrument driver technologies.
- IVI instrument drivers feature increased performance and flexibility for more complex test applications that require interchangeability, state-caching, or instrument simulation. IVI drivers are most commonly used for applications that require advanced features; which is typically true for only a small subset of high-end applications.
2. Is the Driver Compatible With My OS?
You can choose from many OSs, such as Windows, Mac OS, and Linux, which offer different advantages for different tasks and operations. Each OS may also have different versions, distributions, or designs for specific processors. For example, releases of Windows range from Windows XP to Windows Vista to Windows 7, which feature different versions for 32-bit and 64-bit processors. Since Linux is open source, there are hundreds of varieties to choose from. Each type, release, and version of an OS functions differently and may or may not be cross-compatible.
- Plug-and-play instrument drivers are created to natively integrate into a particular application development environment (ADE), yielding support for all OSs in which the ADE offers support for.
- IVI instrument drivers are supported on only Windows OSs.
3. How Well Does the Driver Integrate With My Application Software?
There are varying degrees of driver integration with application software. At the core of every driver is a library (often a DLL) that manages the communication to the instrument. Normally, the library is provided with documentation and, in some cases, distributed with wrappers for various programming languages. These wrappers are thin layers of code that translate the library’s functions into a compatible interface for a particular programming language. In some cases, a wrapper may not be provided for your preferred language, or even at all, but you can use direct I/O to interface with your application software.
The best integration is when the provided driver natively integrates with your application software. In this case, the driver is written for the native language. This provides better performance and a more seamless experience because functions and documentation are directly built into the application software.
- Plug-and-play instrument drivers provide source code native to the application development environment (ADE). With access to source code, you can modify, customize, optimize, debug, and add functionality to the instrument driver. Source code also enables plug-and-play instrument drivers to be cross-platform compatible, so you can use them on any OS that the ADE offers support for.
- IVI instrument drivers are developed and made available based on two different architectures: IVI-C drivers based on ANSI C and IVI-COM drivers based on Microsoft Component Object Model (COM) technology. Both architectures are designed to coexist and are not mutually exclusive.
4. What Documentation Comes With the Driver?
Drivers feature many forms of documentation including user manuals, functions references, release notes, known issues, and example code. Navigating through poor documentation that is muddled and incomplete can be a huge waste of time. When a driver’s programming interface is poorly documented, you can spend an unnecessary and frustrating amount of time running trial-and-error tests on its functionality. Although trial and error can be a great way to learn the functions and syntax, you need to be able to refer back to the manual when necessary. Therefore, having well-organized, thorough documentation is extremely valuable.
The best driver software documentation is complete, easy to navigate, and simple to follow. Ideally, it offers example code specific to your preferred programming languages and provides detailed and useful error messages. Evaluate the driver software’s documentation ahead of time and save yourself potential headaches in the future.
5. Does the Driver Include Any Setup or Diagnostic Utilities?
In addition to documentation, setup and diagnostic utilities can help you get your application up and running quickly and diagnose problems. You should take advantage of interactive, direct I/O capabilities built into the many application development environments.
Next steps:
Download the complete guide to building an instrument control system
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
