Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to communicate with equipment using GPIB-USB-HS

Solved!
Go to solution

Hello Everyone,

 

I have to control two equipment using a IEEE488 bus and GPIB-USB-HS conector. One is a Power supply Delta SM 15-400 and the other is Keithely 181 nanovoltimeter. I'm using NI LabVIEW 17 (64bit)  and the NI-488.2 17.0.0 version for the GPIB communication. Using "Measurement & Automation Explorer" I can perfectly control the Power Supply  but for some reason I can't communicate with the nanovoltimeter using he same tool. Strange is that the "Measurement & Automation Explorer" recognizes the equipment (see figure "MAE_overview.png") but when I try to query or send a commands an error occurs (see figure "Query fail"). More puzzling is that testing in another computer with LabIVEW 11 and 3.0 version NI-488.2  using the same query and commands the communication with the nanovoltimeter works fine. I've already checked all (that I know) the communications default settings from the 17 version and the 3 version to match them but still no success. I also tried a third computer with LabVIEW 13 plugging in every USB port possible and the same problem occurs.

 

Does anyone have a clue of what is happening ? Why it only works in the 3.0 version  NI-488.2 ?

 

Thanks for the attention,

 

Download All
0 Kudos
Message 1 of 16
(5,816 Views)

From your picture, NI-MAX sees only one instrument at GPIB address 5.  You have 2 instruments, so you should see them both listed.  Are the addresses the same?  I'll assume that the PSU is at address 5 and its the one that is responding to the "*IDN?" querry correctly.

 

Now the Keithley 181 is old, and doesn't support IEEE 488.2 query command "*IDN?".  You will have to manually setup the gpib address by setting the dip switches on the back.  Once NI-MAX recognizes it, I'd bet if you try sending "R5\r\n" you'll notice the voltage range changes to 20VDC.

 

The 181 has its own very small set of commands, usually just 2 characters long.  You will need to learn them, and also how to setup the instrument for communications.  Read the manual here - https://doc.xdevs.com/doc/Keithley/181/32421A%28Model181%29.pdf

 

There is a LabWindows driver for the 181, you coud try converting that to LabVIEW using the conversion tools mention on the driver page..but its simple enough to learn the few commands you need and use VISA to read and write to the instrument.  If you run into problems with code, post the code here and we can help.

0 Kudos
Message 2 of 16
(5,773 Views)

Hi There,

I usually use the NI-MAX to make the first steps with any equipment. And with the Keithley 181 wasn't different. As you said the model is old and doesn't recognize the standard command "IDN?"(see figure IDN_fail.png). So went I hit "Communicate with instrument" I receive an error message right away or I receive a voltage measurement info (don't know why). I already have the manual and tried those two letters commands like "R5\r\n" (see figure R5_fail.png) with no success. The other instrument was a Arduíno that I forgot to disconnect. The NI-MAX sees the Keithley 181 in address 5, no doubt about it. I've also tried the VISA test Panel and no "Basic I/O" command worked only the "Line Control" commands work.

I believe there is a specific way to send the string to this equipment that I not able figure out yet. That's why I tried going directly to drivers. But since I can't find Labview drivers I'm stuck with the ones made in LabWindows. The switches behind the Keithley 181 are also in the correct position. I've double checked already. 

 

I downloaded the LabWindows/CVI driver (http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=1579) and I'm trying to use the Import Wizard to convert this to LabVIEW drivers but I keep receiving an error message (see the image attached) that I can't identify the source. 

0 Kudos
Message 3 of 16
(5,752 Views)

 

I already have the manual and tried those two letters commands like "R5\r\n" (see figure R5_fail.png) with no success. The other instrument was a Arduíno that I forgot to disconnect. The NI-MAX sees the Keithley 181 in address 5, no doubt about it. I've also tried the VISA test Panel and no "Basic I/O" command worked only the "Line Control" commands work.

I believe there is a specific way to send the string to this equipment that I not able figure out yet. That's why I tried going directly to drivers. But since I can't find Labview drivers I'm stuck with the ones made in LabWindows. I downloaded the LabWindows/CVI driver (http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=1579) and I'm trying to use the Import Wizard to convert this to LabVIEW drivers but I keep receiving an error message (see the image attached) that I can't identify the source. 

P.S: I also attached the drive files (with .DLL) to this messaege. 
The switches behind the Keithley 181 are also in the correct position. I've double checked already. 

0 Kudos
Message 4 of 16
(5,758 Views)
Solution
Accepted by topic author pedroks

The WizardProblem.png is telling you that the driver is just too old to be converted!  It was made in a version of LabWindows < v5.01 so it won't work.  You could ask to have it converted in the conversion forum, but its just as easy to look at the commands and implement them yourself.  Look at the kei181.c file for good clues on formatting the return strings...someone already did the hard work there.

 

 

Since its Friday I dusted off my old Keithley 181 and plugged it in.  You're correct, it  identifies in NI-MAX just like yours.  It accepts the "R5" command and returns a reading if I query, but it didn't change the setting. Hmm..

 

So looking at the manual there's an "X" command, which says Execute other commands.  So if you send a an X it executes all the commands it has just received.  So send "R4D1Z1P1B1X" and you effectively set R4 - range 2V, Damping ON, Zero ON, Filter OFF, Display Resolution 6.5 digits.

 

 

keithley181_IO.png

 

*Omit the "\r\n" in NI-Max Communicator as it will add the \r\n automatically if you have it configured that way.  You can change the termination characters using the button "Configure EOS".  

 

Craig

Message 5 of 16
(5,751 Views)
Solution
Accepted by topic author pedroks

Hi

I think the KE181 does not answer IDN or RST commands in max.

But you can use it, see here drivers I got from this forum.

N

0 Kudos
Message 6 of 16
(5,744 Views)

 

The Wizard problem I understand now. And I will look at the kei181.c file as you recommended. But what concerns me now is that even though you couldn't change the Range by writing "R5" from the NI-MAX, you were able to send successfully the command without receiving "timeout condition" erros messages. I'm trying now to change some settings in "Configure EOS" to see if I can at least sent the command (figure "Configure_EOS.png"). What were your settings? I'm starting to think there is something wrong with the equipment's socket or something inside it. 

 

Another thing that boggles me is that the message erros says: "EABO indicates that an I/O operation has been canceled, usually due to a timeout condition after a GPIB read." How come? I'm not sending Read commands yet. 

 

I also tried your LabVIEW block diagram sending commands with "X" and without. However as you can see from image "LabVIEW_BlockDiagFail.png", something is still not right. 

Download All
0 Kudos
Message 7 of 16
(5,739 Views)

Hi nitad54448,

 

That is not a driver for the Keithley 181!   

 

It looks more like a default driver template that could be used to create a driver for the K181.  It doesn't implement any commands the K181 uses, and it contains a bunch of SCPI commands that do not work for the K181! 

 

If you use the "181 Read Single.vi" example and set the initialize conditions to FALSE then you get communications...but its not a useful reading.  It simply resets the instrument to the default state and then the instrument responds to with a reading from the 1000V scale with 2 sig fig.  If you care about filtering, damping, autozeroing, measuring voltage in the nV - 200V range you will be sorely disappointed. 

 

Craig

0 Kudos
Message 8 of 16
(5,726 Views)

Hi Pedroks,

 

In NI-MAX are you using Query?  The K181 only sends a reading in reply to receiving a command.  So if you WRITE "R5X", then READ it will change the range and reply with reading correctly.  If you QUERY "R4X" likewise.  If you just hit READ, it will timeout.  If you want to just do measurements the QUERY "UX".

 

If that still doesn't work for you then this code and see what you get.  Use the GPIB commands and change the mode of GPIB write.  For me modes 0, 6 or 7 work with K181.  Others will fail to change anything, probably because the instrument is stuck waiting for the termination characters that never arrive.  

 

Note that VISA code works for me too, but sometimes I like the old GPIB status bit display when playing with old instruments.  Its the same thing you get in NI-MAX.

 

Hope that helps.

Craig

 

0 Kudos
Message 9 of 16
(5,725 Views)

Hi

I beg to differ. Maybe it's not a "real driver" but it works very well (I used for 10 years now, you just need to add simple VISA commands and we can do "filtering, damping, autozeroing, measuring voltage in the nV - 200V range" without being  "sorely disappointed".

If you want I can send examples to test with all of the above. 

I don't have the time to search but it was converted for me from a Labwindows driver, on this very forum.

N

0 Kudos
Message 10 of 16
(5,717 Views)