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)

VI High 12: How to Find and Use Instrument Drivers in LabVIEW (part 1)

Controlling your instrument is one of the biggest reasons you may be learning LabVIEW. There’s a big difference between doing it with NI-VISA, the interface driver, and an instrument driver. In this episode we’ll see how to find an instrument driver in LabVIEW using the Instrument Driver Finder. Next time around, we’ll look at other ways, like using ni.com/idnet.

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

Experience Level: Basic

(start transcription)

“We teach people LabVIEW. One of the biggest things people want to be able to do is control their instruments with LabVIEW. Let’s learn how.

First off, which instruments are we talking about? Maybe a standalone DMM, perhaps a pump, a mixer, a lock-in amplifier, maybe a robotic arm, essentially anything that can be connected to a computer through some sort of standard interface can be controlled with LabVIEW.

Next, we should know that there are many layers of communication that go from LabVIEW to an instrument. Let’s look. At the bottom, we have the instrument with which we’re communicating. This communicates through our Operating System (Windows) to an interface driver. This interface driver is specific to the interface, so we would have a separate driver for serial, for 488.2 or GPIB, or Bluetooth, whatever. On top of that we have NI-VISA, which is one unifying or umbrella driver that can communicate with a variety of instruments with a common interface. On top of that we see instrument drivers. These drivers are specific to an instrument, say an Agilent 34401 DMM, or a Tektronix 7000 series oscilloscope. On top of these driver layers we have the applications which interface with them, namely LabVIEW and MAX or the Measurement and Automation Explorer. You can see that LabVIEW can typically interface with our instrument through any of these three methods: instrument driver, NI-VISA, and interface driver.

An instrument driver is a set of VIs already made in LabVIEW that communicates with a particular instrument model. So let’s say I have a Tektronix AFG 3252 Signal Generator connected through GPIB sitting here on my desktop and I want to know if there’s already an instrument driver available so that I don’t need to program low-level commands either through VISA or the interface driver. If I had this instrument driver already correctly installed, I’d go into LabVIEW and be able to see it in my Instrument IO»Instrument Drivers palette. Here I see all the instrument drivers I already have. So if I don’t see it here, I’ll go to Help»Find Instrument Drivers and this launches the Instrument Driver Finder. It’s first looking for my login information. It found me, and addresses me by name. I’m gratified. It’s just using my ni.com profile. If you don’t have an ni.com profile, it’s free, just go to National Instruments website and sign up so they can send you marketing material.

First, I’ll click on Manufacturer, browse through them until I find Tektronix, and then, in the Additional Keywords field, I’ll type in the model number: AFG 3252. Search, and there it is: the Tektronix AFG 3000 series instrument driver, and I’ll look over here to see that my model, the AFG 3252, is indeed supported through GPIB. What a relief. So let’s install it. I click install, LabVIEW thinks about it for a second. Notifies me of success, I’ll start using it. Go back to my Instrument Driver Finder. I see that I can explore the Instrument Driver a little further and look at examples here, but for now I’ll just close it, go back to my Instrument Driver palette and I find indeed the Tektronix AFG 3000 Series. Tack that down, bring it up here and now I’m going to be able to program my instrument.

That was easy, so next time around we’re going to take a closer look at the instrument driver and how to program an instrument with it and we’ll also look at how to install an instrument driver that isn’t found on ni.com or through the Instrument Driver Finder. Until then, please anxiously refresh our VI High blog at blog.sixclear.com.”

(end transcription)