VI High 13: How to Use and Install Instrument Drivers in LabVIEW (part 2)

In this continuation of VI High #12, we look at the structure and programming methodology of a LabVIEW instrument driver. Who develops instrument drivers and how can we find the resources to help us understand and implement them well? Finally, we look at how to install the instrument driver when not using the Instrument Driver Finder.

For more on learning LabVIEW, check out the LabVIEW Fundamentals Course offered by Sixclear: sixclear.com.

Experience Level: Basic

(start transcription)

“By now, you’ve worn your F5 key to a nub refreshing VI High, waiting for the second part of our instrument driver session. It is here.

Last time, we looked how to use the Instrument Driver Finder to locate and install our instrument driver. Let’s take a closer look at that instrument driver: the Textronix AFG 3000 Series. The most helpful place to start is at the VI tree. This is a non-executing VI purely used for documentation. I go to the block diagram and I can see the programming flow for this instrument, so I’ll use VIs in this order in order to build my code. First, I’ll initialize communication to the device, then I’ll use one or more of these VIs to configure the waveform I’ll be outputting. Context Help is especially valuable, I see that I can configure a standard waveform to output, I can configure the output impedance, and so on. I have a couple VIs that fall into the Action/Status category, like enabling output and clearing the arbitrary waveform, and then a few optional Utility VIs, like performing self-tests and resetting the instrument. Finally, I’ll close communication with this Close VI.

How about some examples on how to use this instrument? Where the examples are located really depends on who built the instrument driver. Some instrument drivers are developed by the instrument manufacturer, some by third parties, essentially anyone can develop an instrument driver and submit it on ni.com/idnet. As such, they do vary in quality and technique. The instrument driver can place the examples in the LabVIEW Example Finder, sometimes you’ll find the examples right in the palette or here in the VI Tree. As you can see, this instrument driver places the examples in the Example Finder so let’s look there. I’ll go to Help»Find Examples. Under the Browse tab I’ll go to Hardware Input and Output»Instrument Drivers»LabVIEW Plug and Play and here I see all installed examples. Here are the examples for the Tektronix AFG 3000. I’ll grab a simple one to generate a standard waveform. Go to the block diagram, we see that these VIs follow the same programming flow as I saw in the VI Tree. Initialize, Configure, Action/Status, and Close. Delightful.

Now what if somebody tells me they have an instrument driver they’ve developed, or what if I download one directly from the manufacturer’s website, or ni.com/idnet. How do I get that instrument driver into LabVIEW? The first thing to do is shut down LabVIEW, then I’ll navigate to the LabVIEW folder in my computer’s program files. By default, this is stored in C:\Program Files, I have a 64 bit machine and install 32 bit LabVIEW - along with all the rest of my 32 bit applications - in this (x86) folder, then \National Instruments\LabVIEW 2010\ then the instrument library or instr.lib. Here I would place the driver. So, for instance, let’s say someone developed a driver for a MAS-345 DMM and they handed it to me on a USB drive. Here it is. I can drag it into here, and then restart LabVIEW. Once LabVIEW is restarted, I can navigate to the same place in the instrument driver palette and there it is.

That’s it for instrument drivers. As always, check out sixclear.com for more on LabVIEW training and check out VI High for the full video transcripts.”

(end transcription)

  1. vihigh posted this