An instrument driver is a set of software routines that control programmable instruments. Each routine corresponds to a programmatic operation such as configuring, reading from, writing to, and triggering the instrument. Instrument drivers simplify instrument control and reduce test program development time by eliminating the need to learn the programming protocol for each instrument. NI-SCOPE, NI-FGEN, NI-DMM, and NI-HSDIO are examples of instrument drivers provided by National Instruments.

Instrument Driver Structure

All instrument drivers have the same basic hierarchy. Instrument drivers are written from low-level components that are used to program instruments. These component functions fit into six categories—Initialize, Configuration, Action/Status, Data, Utility, and Close.

Initialize

All instrument drivers have an Initialize function. It is the first instrument driver function called and establishes communication with instruments. Optionally, it can also perform instrument identification query and reset operations. Initialization also places instruments in a specific state, usually the default power on state.

Configuration

Configuration functions are collections of software routines that configure instruments to perform a desired operation. The number of Configuration functions depends on the complexity of the instruments. After the Configuration functions are called, the instruments are ready to take measurements.

Action/Status

The Action/Status category contains two types of functions. Action functions cause instruments to initiate or terminate test and measurement operations such as arming the triggering system or generating a stimulus. Action functions differ from Configuration functions in that they do not change instrument settings; instead, they order the instrument to carry out an action based on its current configuration settings. Status functions return the current status of instruments or of pending operations. Specific routines in this category and the actual operations they perform are at the discretion of the instrument driver developer, and are usually created as required by other functions.

Data

Data functions include calls to transfer data to or from instruments. Examples of Data function operations include reading a measured value or waveform from a measurement instrument, and downloading waveforms or digital patterns to a source instrument. Specific routines in this category depend on the instrument.

Utility

Utility functions perform a variety of operations auxiliary to the most-used instrument driver calls. These functions include the majority of the template instrument driver calls such as reset, self-test, revision, and error query, and may include other custom routines such as calibration or storing/recalling instrument configurations.

Close

All instrument drivers include a Close function. The Close function terminates the software connection to instruments and deallocates system resources used during that instrument session.