Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

help talking to hp 4141

Hi all,

I am trying to talk to an HP 4141.  Unfortunately there are not any labview VI's available for it so I am on my own.  I have read through the manual and am stuck as to how to talk to this thing.  I am a newb, and am looking for some general help on this.  I am attaching the programming manual for the device, and would appreciate any help anyone can offer.  Thanks in advance.

0 Kudos
Message 1 of 22
(5,324 Views)

I haven't looked at the entire manual that you posted, so I assume you want to talk to it using GPIB? In that case, you can start by trying to communicate with the device using MAX. The instrument should appear in MAX, but it won't be identified since it's an ancient device and MAX uses the *IDN? command to identify instruments, which this one doesn't support. The basic reason for using MAX is to make sure you can talk to it and get data back. Sort of like using HyperTerminal on Windows for serial connections.

 

For LabVIEW you should look at the GPIB example that ships with LabVIEW. Help -> Find Examples, then search for "GPIB". Open the "GPIB-VISA" example. That shows you how to use VISA to talk to your device. (Make sure you have NI-VISA installed.)

 

You could also use the Instrument I/O Assistant if you really wanted to. That's an Express VI. The more experienced LabVIEW programmers tend to abhor the Express VIs, but it may be convenient for you to use.

 

For a general tutorial you can read Instrument Control in LabVIEW Tutorial.

 

 

Let us know how far you get.

0 Kudos
Message 2 of 22
(5,310 Views)

smercucio:

 

Thank I appreciate the advice!  Sorry I was not more specific yesterday, I was getting a little frusterated and left out some details.  So here is some more info:

 

I have used labview a bit in the past and have used the serial communication examples with much success.  I am using gpib, however, when I open the gpib example (that you mention) I am unclear what commands/strings to put in the write buffer, hence the reason i posted the manual.  I think that for the most part, my biggest problem is understanding what commands the hp4141 responds to.  I have tried putting DC1 in the write buffer (which is supposed to clear the device) but just get timeout errors.  Also, *IDN? does not seem to do anything (as you said it wouldnt).  Any one mind lending a quick hand helping me understand this communication protocol?

 

Thanks all!

0 Kudos
Message 3 of 22
(5,288 Views)

Old HP instruments typically used a semicolon to end commands, and as this one states on page 3-33 of the manual, a command must end with a line terminator, a semicolon, or a linefeed character. So, the correct string to send to the instrument would be "DC1;". However, DC1 is not a command, so I'm not sure why you are trying to send that. DC1 refers to "Device Clear", which is a GPIB operation, done using the GPIB functions. One simple command that you can try is the self-test command, "TS;".

 

Also, the example I pointed you to always performs a read operation. You will get a timeout if the command you send returns no data.  You'd want to case out the read part if the command you're sending doesn't return any data. Sort of like the way the "LabVIEW - GPIB" example does (although that examples uses the regular GPIB functions instead of VISA). 

 

My suggestion is to create individual VIs for the commands that you want to send. This way each command can handle the write and read (if required for that command).

0 Kudos
Message 4 of 22
(5,280 Views)

Eureka!

Small success, I opened the Labview-GPIB.vi example and sent the command ID; and was able to write and get a system/version response read back.  TS; however timed out. So I will continue to fumble through the commands (which i now see in table 3-4)

 

EDIT: 

Not all commands, such as CL; , seem to do anything other than timeout, it could just be me....

Message Edited by nmf138 on 06-08-2010 09:34 AM
0 Kudos
Message 5 of 22
(5,275 Views)

Bingo!

Just figured it all out, I will post my vi's when I am finished.  Thanks for the help!

0 Kudos
Message 6 of 22
(5,245 Views)

Well I thought I had it all figured out, here is where I am at:

 

The 4141 has 2 voltage sources (Vs1, Vs2), 2 voltage monitors (Vm1, Vm2), and 4 SMUs which can either supply or measure either current or voltages (SMU1, SMU2, SMU3, SMU4) and a GND.

 

With Labview's GPIB example, I can write "DS1,3:" or "DV5,0,3;" to the instrument and probe the instrument to supply a specific voltage across Vs1 and GND(in either command I listed here the output voltage was 3 volts).

 

Unfortunately, I am unable to get the SMU's to cooperate at all.  For instance, the command "DV1,0,3;" should instruct the instrument to output 3 volts from SMU1 (I am assuming the voltage potential would be across SMU1 and GND).

 

The self test is initiated when I boot the machine and passing the command "TR;" and both writing and reading returns "S10S20S30S40" which means no errors on any SMU

 

Anyone have any bright ideas?

Thanks!

0 Kudos
Message 7 of 22
(5,221 Views)

Does it come with any prebuilt software that you could use to make sure the SMUs are working properly?  Just because it passes the self test, I would not be 100% certain that it is working.  Also, if you could control it using pre-built software from HP, then you might be able to figure out the exact commands that it is sending and duplicate those. 

 

-Christina

0 Kudos
Message 8 of 22
(5,193 Views)

Well I made some progress.  Turns out that like the other 98% of the time it was a user error.  The hp4141 seems to be very picky about how it is initialized.  I have figured out how to fully communicate with the instrument and all seems well.  I am just now deciphering the code it spits back out when I ask it to measure something.  I will post my final vi's soon.  I am no pro so they are undoubtedly very crude, but they are pretty simple and get the job done somewhat nicely. 

Message 9 of 22
(5,191 Views)

Dear Kudos,

I am trying to talk to HP 4141 but have encountered a similar problem like you had could you please provide some tips or vis

thanks a lot

0 Kudos
Message 10 of 22
(4,763 Views)