06-13-2011 02:24 PM
I am trying to control my HP3325A sweep generator with labview.
http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=646
I am using the driver available via the link above (the one for labview, not labwindows).
On the actual device itself (the HP3325A) there is a button on the front to "Reset/Start" the sweep function. It will start the sweep once the values are set, or it will restart the sweep from the beginning if it is already in progress. This button is not available in the driver, and I am looking for a way to add this button via a simple boolean control in the block diagram of the driver. The driver itself is fairly simple, but I am new to labview and don't really understand how the drivers actually work. This may be an easy task to accomplish, it may not be. I am just not sure.
Solved! Go to Solution.
06-14-2011 07:00 PM
Hi Lars,
The Plug and Play instrument drivers available on the Instrument Driver Network simplify how to control and communicate with your instrument. The VI's that are in your LabVIEW version of this driver are simply there to provide you an easier way to communicate with the instrument. In order to have this functionality in your VI that the Start/Reset button gives you on the instrument, if there is a GPIB command equivalent to the Start/Reset button, you could use either the NI-VISA or GPIB command VI's to communicate the command that corresponds to that button. There are examples of how to communicate to a GPIB instrument in the NI Example Finder, which can be found from LabVIEW by going to Help»Find Examples. In there, from the Browse tab, go to Hardware Input and Output»GPIB to see examples of using both VISA and GPIB. These examples show how to use these functions to properly communicate with an instrument using GPIB.
You could then simulate the button that you have on the instrument from the front panel in a number of different ways. You could use a case structure and wait for the button press, or you could base your design on the Producer/Consumer Design Pattern (Events) template and have a button press queue an event to call the communication. There are a number of different ways this could be accomplished.
I have also attached links that have some more information about the instrument drivers available on the Instrument Driver Network as well as the Producer/Consumer design pattern. I hope this helps, Lars! Have a great day!
Application Design Patterns: Producer/Consumer