Part 3 (you're there)
This is the part I was looking forward to the most.
Interfacing the device with LabVIEW is simple, and quick. In fact I think it took less time to get it talking to LabVIEW than it did to do the initial set-up (even discounting the previously mentioned fuse replacement).
Instructions here are for LabVIEW version 8.6, some points will require you to modify the instructions. These should be obvious.
First you'll want to get the LabVIEW drivers for the 61A. Go to http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=21589 download them, and extract the "Agilent 3446X Series" folder to your instr.lib folder (in my case it was C:\Program Files\National Instruments\LabVIEW 8.6\instr.lib). There are some examples in the "Examples" folder, which can be a good start if you want to just double click something and start using it, however that's not the purpose of this blog post.
So lets see how to get your new shiny toy going in LabVIEW.
I'll assume you know how to use LabVIEW at a workable level for this, and I'll be using Australian English for the most part, but US English when required for LabVIEW related functions.
So open up LabVIEW and open a blank VI and go to the block diagram.
In the pallets you'll want to navigate to Instrument I/O -> Instrument Drivers -> Agilent 3446X (it may be worth pinning this open).
The first thing you want to do is initialise the device, so drop the "Initialize" VI onto the block diagram. Create a control for the VISA resource name.
Next you'll want to configure the various aspects of the device.
Go to the configure pallette -> measurement and put the configure measurement VI onto the block diagram, and wire the resource and error connections from the initialize VI. Create controls for the other inputs if desired.
Now I'll assume you want to trigger measurements somehow so drop the configure trigger VI onto the block diagram, wire in the resource and error connections and create controls for the others (if desired).
I left the inputs for autorange and autodelay as constants, as well as the trigger source as a constant (set to software).
At this point I have a configure multipoint VI. My VI is set to allow you to set the number of measurements you wish to average to determine each point.
That VI is in the "low level" pallette. I set a trigger count of 1, and used a control to set the number of points (called Sample Count).
At this point I'll pause to say that the VI being created will kind of emulate the "trend" function built into the 61A, but the refresh rate is likely to be slower.
So create a while loop and create a control attached to the loop condition.
Feed the VISA resource and error into the loop (you are keeping these going right?).
For the moment we'll revert back out of the loop to clean things up. Place the Error Query and Close VIs from the 6X palette and then a simple error handler.
Back inside the loop now. We have the device set up and roaring to go (not literally roaring of course, it's actually more of a quiet purr).
In the 6X data palette -> Low level, place in order, Initiate, Send Software Trigger and Fetch Multiple Points VIs. Wire the resource and error connections through, and then to the error handling stuff added previously.
If you were to run it now, it'd run fine, but you wouldn't get any data shown.
The data that you get out of the Fetch Multiple Points VI is 1D array. We'll find the average of this array and use that as the data output.
In the Numeric Palette, place the add array elements VI on your block diagram, and wire into it the output of the Fetch Mulitple Points VI.
Then just divide that by the sample count to get the array (this is left as an exercise for the reader [or just look at the screenshot]).
Add a chart to the front panel, place it's block diagram variable in the loop and connect it to your average value.
Connect up your 61A to the computer, turn it on, select the correct front panel settings, and hit run.
It’s also possible to modify your newly minted VI so that you can change the samples per point without having to stop the VI and rerun it through the use of an event loop .
You may also decide that you wish to log the data too. Well you can, and it's as simple as adding the bog standard write to spreadsheet file block and deciding exactly what it is you want to log.
In the example shown below (that I used for the testing in blog post 2) I am logging the set point, the "average value", and the individual readings. I am using %f as the string formatting so that I don't need to worry about the number of decimal places etc. I'm using comma as a separator to make the written file a CSV, and the filename is chosen at the start of the program, I'm also appending rather than overwriting.
So that's it everyone. You should now have a functioning LabVIEW interface for recording data from your Agilent 34461A.
I hope you enjoyed this series of blog posts.