Hi. I'm Bill Griffith, an application engineer with Agilent Technologies. And today I wanted
to show you a really easy way to program instruments using Excel. We have a new, free program called
Command Expert that allows us to create command sequences for our instruments. For example,
today I'm going to be using a 34411A Multimeter. Let's get started. So I've opened Microsoft Excel
and the first thing you'll notice is a new tab that's been added. The Command Expert
tab has been added. I'm going to go ahead and click on that tab. And from here I can
open my Sequence Task Pane. And we can go ahead and start editing our sequence.
So I want to select the multimeter, the 34411A. And the first thing I'm going to do is I'm
going to connect to the multimeter. And now that I've made the connection, you can see
all the different SCPI commands I can send to the multimeter. I'm going to start with
the *IDN? command and the reason for this is it's a really simple command and if you can
send that command and get the response back, you know that everything's working. So again,
it does bring back a response from the instruments. So what we'll want to do is we'll want to
load that response into a variable. So I'll go ahead and select a variable IDN, and it'll
load up the response into the IDN variable. So let's go ahead and add this step to our
sequence and this is it. This is our entire sequence for our example. So I'll go ahead
and say OK. And from here the next thing I want to do is I want to put in the instrument
address. So we'll put in our Visa address. And we'll put that into cell C1.
And then I want to bring back that response, the instrument ID, and so I'll put that into cell C4.
So I'm going to come over here and I'll put C4 for our response and I'll put C1 for our instrument
address. So we're ready to run our program. So go ahead and run it. So the program is
sending out the *IDN? command to the multimeter and it brought back the response from the
multimeter. It shows that it's Agilent Technologies 34411A along with its serial number and the
revision of the firmware. So, really a simple way to program in Excel. I want to
do a little bit more complex example now. What I'd like to do is bring back 10 readings
that are DC volt readings from the multimeter. So we'll set up the multimeter to make 10 readings
and then bring them back into Excel. So let me go ahead and open that file
and I've actually included an error in the program so you can see what that looks like. So let me
just go ahead and run the program with the error so you can see it. And whenever
you do programming you're going to make errors. It's just really a nice error capturing feature
that's included with the command sequence expert program. So you can see what comes
back is it says I was trying to turn off the AC peak measurement when in fact I was actually
setting up for DC volt. So clearly what I need to do is change that to be DC not AC.
So let's go ahead and make that correction to our sequence. So open our sequence and
we'll find that command. There it is. And let's go ahead and fix it. So I'll just go
ahead and use the backspace and we'll change it to be DC. And then as you can see it's
a wizard and it will tell us what's the next parameter of our command. So it's really easy
to fill out. And the last thing I need to do is enter a state. And in this particular
case I want to turn off the peak measurements to make those ten measurements as quickly
as possible. So we're done with the commands so let me go ahead and add it as a step.
And now that we've added a step, I want to move it up in our program to where our other statement is.
So now we've got it in our program in the right place. So I'll go ahead and remove
the bad one. So now we've made the correction to our program. I'm going to click OK. And
now we can run our program. Sets up the instrument for 10 measurements and brings them back to Excel.
So Command Expert is a really nice way to program from Excel. One last thing I wanted
to show you, I'm going to go back into the sequence pane, is you can actually export these
same commands into different languages. So, from Export Sequence you can see this is what
C# would look like. I can also export just the raw SCPI commands, the Visual Basic
commands, or even to Mat Lab. So as you can see the Agilent Command Expert is a free program
and it's really easy to create command sequences in Excel or many other languages.
So that's all I wanted to show you today. Thanks for watching.