Instrument drivers are a key development tool in LabWindows/CVI that can save you hours of development time. Instrument drivers replace low-level instrument commands with high-level, intuitive functions you can use to control your GPIB, VXI, and serial instruments. When you purchase LabWindows/CVI, you gain access to more than 500 instrument drivers you can use to control instruments from more than 40 different instrument manufacturers.
!
BEGIN_TEXT
!
Instrument Drivers
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DRIVERS.AVI
0
1
2655
3225
5745
2595
0
0
0
0
BEGIN_TEXT
When you control your instruments using an instrument driver, you can use intuitive functions such as Initialize, Configure, Measure, and ReadWaveform instead of using low-level GPIB commands, VXI messages, or register reads and writes. Instrument functions automatically build instrument commands that are based on the parameters that you pass. In addition, instrument driver functions read data from your devices, parse the data strings, and scale them to voltages for you.
!
BEGIN_TEXT
!
Instrument Drivers
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DRIVERS.AVI
0
2
2655
3225
5910
3450
0
0
0
0
BEGIN_TEXT
Each LabWindows/CVI instrument driver includes function panels for code-generation, online help, and interactive execution capabilities. With an instrument driver, you can interactively experiment with your instruments through the function panels before you begin writing a program. Therefore, you can easily test your instruments and interface boards before developing a program. In addition, the source code is included for all instrument drivers. Therefore, you can easily optimize, streamline, or add to an existing driver to meet the needs of your application. Or, you can easily convert an existing driver to work for a similar instrument that does not yet have a driver.
!
BEGIN_TEXT
!
Instrument Drivers
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DRIVERS.AVI
0
3
2655
3225
4605
2565
0
0
0
0
BEGIN_TEXT
Recently, the VXIplug&play Systems Alliance has standardized on LabWindows/CVI as a core technology for building instrument drivers under Windows. As a result, most new VXI instruments now ship with a LabWindows/CVI instrument driver complete with function panels, online help, and source code included.
!
BEGIN_TEXT
!
Instrument Drivers
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DRIVERS.AVI
0
4
2520
3150
5880
2400
0
0
0
0
BEGIN_TEXT
We have loaded two instrument drivers into the LabWindows/CVI programming environment. You access instrument drivers through the Instrument menu.
To learn more about instrument drivers, select the submenu item Sample Oscilloscope. Its function tree hierarchy appears.
!
BEGIN_TEXT
!
A Sample Instrument Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
6
3360
975
6300
1815
0
0
0
0
BEGIN_TEXT
As you can see, this is a very simple library for controlling a simulated oscilloscope. This driver follows a common model for most instrument drivers.
!
BEGIN_TEXT
!
A Sample Instrument Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
7
3360
975
6210
2685
0
0
0
0
BEGIN_TEXT
Before you can acquire data or control an instrument with an instrument driver, you must first run the Initialize function. The Initialize function finds the instrument on the GPIB or VXI bus, queries the device for identification, and ensures that communication with the instrument is functional. Once you have initialized the instrument, you can then configure or acquire data with it.
Click on the Select button to display the function panel for the Initialize function.
!
BEGIN_TEXT
!
The Initialize Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
9
3360
975
6195
2370
0
0
0
0
BEGIN_TEXT
As you can see, the instrument driver has the same function panel interface as all other LabWindows/CVI library functions. The simulated oscilloscope for this example is located at GPIB address 1, so you do not have to make any changes to the function panel controls.
Click on the Run Function Panel icon in the function panel toolbar to run the Initialize function.
!
BEGIN_TEXT
!
The Initialize Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
ARR_U1R.BMP
ARR_U1_.BMP
86
8
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
11
2895
705
4980
2190
0
0
0
0
BEGIN_TEXT
You know that the oscilloscope has been initialized, because the error returned was zero.
To return to the instrument driver function tree, click on the Current Tree icon in the toolbar.
!
BEGIN_TEXT
!
The Initialize Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
ARR_L1G.BMP
ARR_L1_.BMP
33
198
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
13
3360
975
6330
2220
0
0
0
0
BEGIN_TEXT
Now that you have initialized the oscilloscope, you can configure it for acquisition.
Click on the Configure function and click on the Select button to view the function panel for the Configure function.
!
BEGIN_TEXT
!
The Configure Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
17
3360
975
6375
2250
0
0
0
0
BEGIN_TEXT
Like all other LabWindows/CVI functions, instrument driver function panels have built-in online help.
To learn what the oscilloscope Configure function does, right-click anywhere on the function panel to display online help for the function.
!
BEGIN_TEXT
!
The Configure Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
19
5025
630
4890
1440
0
0
0
0
BEGIN_TEXT
Click on the Done button after you read the online help.
!
BEGIN_TEXT
!
The Configure Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
21
3690
3525
5445
2415
0
0
0
0
BEGIN_TEXT
As you can see from the function panel, you can use an instrument driver to configure an oscilloscope, making only a few selections from the function panel controls. The driver takes care of all the low-level command syntax for controlling the instrument.
Click on the Current Tree icon to return to the instrument driver function tree.
!
BEGIN_TEXT
!
The Configure Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
23
3360
2355
4965
1890
0
0
0
0
BEGIN_TEXT
Click on the Read Waveform function and click on the Select button to view the Read Waveform function panel.
!
BEGIN_TEXT
!
The Read Waveform Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
27
1275
5505
3180
3270
0
0
0
0
BEGIN_TEXT
The Read Waveform function queries the scope for a waveform array, reads the data string, parses the data, scales the data to volts, and places the data into a new array in memory. You only provide an array variable to the function.
Type 'wave' into the Waveform control on the function panel.
!
BEGIN_TEXT
!
The Read Waveform Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
31
3360
2355
6315
2130
0
0
0
0
BEGIN_TEXT
Before you can run the Read Waveform function, you must declare the array in memory.
Click on the Declare Variable icon to set up the wave array in memory.
!
BEGIN_TEXT
!
The Read Waveform Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
ARR_U1R.BMP
ARR_U1_.BMP
88
58
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
33
3360
2355
6210
1950
0
0
0
0
BEGIN_TEXT
The oscilloscope will return an array of 100 elements. Therefore, your array variable should be declared to have 100 elements.
Type '100' in the Number of Elements input and click on the OK button.
!
BEGIN_TEXT
!
The Read Waveform Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
38
3360
2355
6300
2040
0
0
0
0
BEGIN_TEXT
Now run the Read Waveform function to acquire a waveform from the simulated GPIB oscilloscope.
Click on the Run Function Panel to run the Read Waveform function.
!
BEGIN_TEXT
!
The Read Waveform Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
ARR_U1R.BMP
ARR_U1_.BMP
75
7
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
40
3360
2355
6300
2040
0
0
0
0
BEGIN_TEXT
The black boxes displayed in the Waveform control indicate that the array now contains data.
Double-click on the Waveform control to view the datapoints in the wave array.
!
BEGIN_TEXT
!
The Read Waveform Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
42
3960
3660
4665
1740
0
0
0
0
BEGIN_TEXT
As you can see, the Read Waveform function has acquired the data.
Click on the continue arrow to continue.
!
BEGIN_TEXT
!
The Read Waveform Function
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
-1
3
0
0
DRIVERS.AVI
0
44
2640
1680
4260
3075
0
0
0
0
BEGIN_TEXT
Remember, LabWindows/CVI instrument drivers give you access to their source code, so at any time you can modify a driver to work with other instruments. Also, you can easily view and step through the source code of a driver from within LabWindows/CVI.
Pull down on the Instrument menu and select Edit...
!
BEGIN_TEXT
!
Viewing the Source Code
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
48
3390
840
5295
1890
0
0
0
0
BEGIN_TEXT
Click on Attach and Edit Source to view the source code for the Sample Oscilloscope driver.
!
BEGIN_TEXT
!
Viewing the Source Code
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
50
3360
4095
4755
2250
0
0
0
0
BEGIN_TEXT
The source code for the Read Waveform function is shown here. You are free to enhance, reduce, or copy the source code to streamline the driver for your application or help create a new driver.
Click on the arrow to continue.
!
BEGIN_TEXT
!
Viewing the Source Code
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
51
4050
3060
4650
1980
0
0
0
0
BEGIN_TEXT
Now let's look at an instrument driver for a real oscilloscope.
Pull down on the Instrument menu.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
53
4335
3735
4470
1815
0
0
0
0
BEGIN_TEXT
Select Tektronix TDS300 Series Oscilloscope to view the function tree for that instrument driver.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
55
3870
660
4455
2805
0
0
0
0
BEGIN_TEXT
As you can see, the instrument driver for a real oscilloscope is much more complete than the simulated scope driver. However, the functions for the real oscilloscope are divided into a similar hierarchy -- configuration, measurement, and waveform functions.
Click on the Select button to view the Configuration functions.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
57
3870
660
4605
2445
0
0
0
0
BEGIN_TEXT
You can configure a number of different settings through the instrument driver, including the Vertical, Horizontal, Triggering, and Acquisition settings.
Click on the Up button to return to the main driver function tree.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
59
3870
660
4500
1635
0
0
0
0
BEGIN_TEXT
Click on the Select button to view the Measurement Operations functions.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
61
3375
1785
4815
1455
0
0
0
0
BEGIN_TEXT
Click on the Select button to view the Read Measurement function panel.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
63
3360
1155
4455
2160
0
0
0
0
BEGIN_TEXT
You can use the TDS300 instrument driver to take a variety of measurements on your data.
Click on the Measurement control to view the different measurements that you can take using this driver.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
ARR_U1Y.BMP
ARR_U1_.BMP
163
103
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
64
3330
3255
4215
2040
0
0
0
0
BEGIN_TEXT
To take a measurement with the instrument driver, you would simply select a type of measurement from this control and run the function panel.
Click on the arrow to continue.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
-1
3
0
0
DRIVERS.AVI
0
67
3840
1185
4560
1545
0
0
0
0
BEGIN_TEXT
Click on the Select button to view the Waveform Operations for the TDS300 driver.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
69
3990
210
4650
2145
0
0
0
0
BEGIN_TEXT
As you can see from the function tree, you can use this scope driver to perform a wide variety of operations on waveforms.
Click on the Up button to return to the TDS300 driver function tree.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DRIVERS.AVI
0
71
3525
435
4635
3240
0
0
0
0
BEGIN_TEXT
When you use an instrument driver, you can save valuable development time because you no longer have to worry about the low-level command syntax for controlling your GPIB or VXI instrument. Furthermore, LabWindows/CVI instrument drivers are delivered in ANSI C source so you have a consistent development model throughout your projects. At any level of your application, from user interface programming to instrument programming, you can view the source code and optimize it for your needs.
!
BEGIN_TEXT
!
An Oscilloscope Driver
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DRIVERS.AVI
0
72
3900
675
4800
2535
0
0
0
0
BEGIN_TEXT
The LabWindows/CVI Instrument Driver Library is continuously updated with more instruments and driver updates. Through the Instrument Library Developers Program and the VXIplug&play Systems Alliance, major instrument vendors are now beginning to deliver LabWindows/CVI instrument drivers as a standard component with their instruments.