Jump to content

How to develop one new driver for an instrument?


labc

Recommended Posts

Dear,

Could you pls give more suggestion?

I'm not good at develop driver for instrument, always I implement drivers which other body shared or NI support.

My understanding is:

First, get programmer's guide and user's manual;

Second, try to know how to configure it manually to finish a specific measurement.

...

Labc

Link to comment

It depends on the type of instrument and software/hardware interface. What manufacturer and model number are you working with? What sort of buss is involved (RS232/RS485/GPIB/Ethernet, etc)?

My advice to new LabVIEW programmers is to fully understand the behavior of all of the commands that are going to be used with the instrument before writing any significant software. Many times you can use Windows HyperTerminal or NI's VISA Interactive Control to experiment with commands. Otherwise, you can build some simple LabVIEW VIs to do the same thing.

In general...

Check to see that NI doesn't already have a LabVIEW driver for your instrument ("Tools>Instrumentation>Find Instrument Drivers"). You might also try contacting the manufacturer. Many don't post them directly to the NI site. Many times these drivers are a good starting point, even if they aren't complete or are not built exactly for your needs.

For message based instruments, you might have a look at some of the examples that are installed with labVIEW. For example the Agilent 34401 on the Instrument I/O function pallet. Many people simply start with some of these objects by creating modified version for their particular instrument.

Might also take a look at the wizard - "Tools>Instrumentation>Create Instrument Driver Project" from LabVIEW's pull-down menus. I'm not a huge fan of this method, but it works.

Link to comment

I would also look at similar instrument drivers from the same manufacturer as a good starting point to modify.

Many instrument classes from the same manufacturers share commands and have similar structures.

So try to find a driver of a similar instrument, try it out and go from there.

Neville.

Link to comment

labc,

There is nothing magical about making your own driver. I almost always write my own drivers because I find that the drivers from NI are more complicated and detailed than my simple needs require. The difficulty really depends on how detailed the programmers manual is. If there is no documentation, it may be very difficult to write a driver. If there are documented scpi commands, it may be very simple.

  1. The first step is to locate the programmer's manual or something that tells you what commands are available for the instrument.
  2. The second step is to make contact with the instrument. Is it a serial connection, GPIB, or ethernet? Make a simple vi that sends a command to the instrument and can read the result. Try to send the command "*IDN?" without quotation marks and read what the device sends back to you. It should tell you its model number.
  3. Do the measurement by hand with the instrument. Note which buttons you need to press.
  4. Look up which commands are the same as the buttons you press.
  5. Try sending these commands one at a time and get it working.
  6. Once everything is working a piece at a time, write a vi that does all the commands.

I'm assuming the equipment you are trying to control may be old and/or not well documented because otherwise it would likely have driver available in the first place. So I think finding good documentation may be the most difficult part for you.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.