labc Posted April 15, 2009 Report Share Posted April 15, 2009 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 Quote Link to comment
bbystrek Posted April 15, 2009 Report Share Posted April 15, 2009 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. Quote Link to comment
Neville D Posted April 15, 2009 Report Share Posted April 15, 2009 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. Quote Link to comment
crelf Posted April 15, 2009 Report Share Posted April 15, 2009 You should totally get a professional to write the driver for you to at least the level of an NI certified driver for you. Quote Link to comment
Jason H Posted April 15, 2009 Report Share Posted April 15, 2009 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. The first step is to locate the programmer's manual or something that tells you what commands are available for the instrument. 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. Do the measurement by hand with the instrument. Note which buttons you need to press. Look up which commands are the same as the buttons you press. Try sending these commands one at a time and get it working. 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. Quote Link to comment
labc Posted April 17, 2009 Author Report Share Posted April 17, 2009 Thanks for your detailed introduction. I'll try more. Labc Quote Link to comment
Phillip Brooks Posted April 17, 2009 Report Share Posted April 17, 2009 Brian Powell's blog contains some good thoughts on driver development. This entry discusses the API aspect of your driver. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.