LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication with Keithley 2000

I want to set up a voltage measurement using a Keithley 2000 DMM via the serial port. I downloaded the Keithley 2000 instrument drivers from the NI website, but when I try to run 'Read Single Example', I get an error (at an unidentified location) that says that a timeout occurred while waiting for a service request from the Keithley.

I set the Instrument field to COM1 before running the vi since this is the alias of my serial port: are there any other hardwarde/software configuration steps I need to take so that the vi can run through? I assumed that since this vi was designed for the Keithley 2000 that it's defaults would correspond to those of the instrument. Any advice is greatly appreciated.

Thanks,
random
0 Kudos
Message 1 of 5
(5,437 Views)
I've never used a Keithley instrument remotely, but with a lot of remote controlled instruments, you have to manually switch them to "Remote" mode via a switch on the front or rear panel.

Another thing to consider would be something else might have the serial port open not allowing LabVIEW to access it. But this sounds less likely because of the error you describe.

Can't think of anything else right now. Let us know if either of help.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 5
(5,413 Views)
Hi
You could also try to use MAX to communicate with the DMM.
Benifit of MAX is that it will find if you have an instrument connected to serial  port.
if necessary use NI spy to 'debug' the code commands.

xseadog
0 Kudos
Message 3 of 5
(5,410 Views)
The safest thing to do is to not assume anything in the goofy world of serial communication. However, the error that you're getting indicates that the error occured when the VI was attempting to read the status byte. This would imply that the driver has successfully done the initialize and configured the measurement and trigger. An easy way to confirm this is to manually set the instrument to measure something other than volts and see if the instrument changes modes. This is also assuming that you set the front panel function control to volts. If it does, then there's a problem with the instrument setting SRQ or with the driver reading it.
0 Kudos
Message 4 of 5
(5,407 Views)
hey,

thanks for your suggestions. my problem was a little more simple than that--i figured it was. since the drivers i downloaded were for the specific device (Keithley 2000 DMM) i was working with, i didn't think that any hard programming would be necessary (i mean, shouldn't the drivers already do this?). turns out this was correct.

for those of you who are interested, Keithley has several example vi's included with their instrument drivers (available from ni.com with a 'Keithley 2000 instrument drivers' search). a few good ones are 'Read Single Example.vi' and 'Read Multiple Example.vi', etc., which use the more basic vi's to perform most measurements and you can expand these to your own applications quite easily. there is also a good bit (Visual C++, Basic, and older versions of LabVIEW) of documentation on the Keithley website for the 2000. these downloadable instrument drivers can save you A LOT of time: i have been working on this measurement using Visual C++ and LabVIEW versions 6.0 and 7.0 without the instrument drivers, and it is very trying--the instrument drivers are the basic building blocks you need to set up your measurements, and they take care of a lot of the little 'technical stuff' that would take you so long to figure out.

after the initial run of the program didn't work, i went through parts of the block diagram, and, in the 'Read Single Example' (for example), i noticed that the baud rate in one of the sub-vi's was given as 19 200, while on my instrument it was set to 9 600. i changed the rate in the sub-vi, but it still wouldn't work. i called NI and spoke with a technician for a while, but we were unable to isolate the problem.

a little later, i was explaining the problem to some one else, and i decided to set the instrument baud rate to 19 200 to follow the value that was in the 'Read Single Example. vi'. it worked! same for the 'Read Multiple Example.vi'.

i believe the problem originated because when i changed the baud rate in the vi, i only changed it in one place. there are a few sub-vi's running in this example vi, and i am pretty certain that the baud rate has to be set somewhere in some of them, too. since i didn't change ALL of the baud rates to follow the instrument, my program fizzled. however, when i changed the instrument baud rate to follow the vi, that wasn't a problem, because there was only one loose end to tie up.

hope this helps some one out--use the instrument drivers whenever possible, they will add years to your life. i did all of this for the serial port, but these example vi's have the option for GPIB too.

thanks again,
random
0 Kudos
Message 5 of 5
(5,388 Views)