10-13-2018 09:56 PM
Hi!
I am pretty new to the world of LabView and I am very lost right now. I am trying to do some very basic measurements with a Keithley 2400 Sourcemeter on LabView. I am using a startech USB to RS232 Serial Adapter and I am running the newest version of LabView (not NXG). I have downloaded the keithley driver available on the NI website, as well as some additional drivers from startech for the adapter.
When I use the "search for instruments" function (under tools and instrument drivers), LabView does not detect the Keithley. However, under MAX, I found the COM it is connected to, and renamed it to"Keithley", so I can recognize it in the LabView program and set the VISA to the correct COM. When I run any simple example program from the Keithley driver (such as turn off display or measure resistance), the Keithley will "beep" and display the following "Error: ID -113 Undefined Header". After this, I get an error if I try running the program again on LabView and it seems the connection is lost. I have to restart the Keithley and LabView in order to try running the program again without the error.
I have no idea what to do or how to fix this. How do I get setup properly? Also, how do I go about verifying that the connection is there and correct? Any help would be very much appreciated because I have been trying to solve this for a week, with absolutely no luck.
Thanks,
Bavley
Solved! Go to Solution.
10-14-2018 04:12 AM
Hi bavley,
that error is given by your Keithley because the received message is malformed. You need to read the manual of the Keithley to learn about the expected message format and compare this with the data you send from your VI...
10-14-2018 08:11 AM
If the Keithley is beeping, then you have a physiical connection. What I suspect is happening is you have the default Keithley setup which is expecting GPIB communications. You need to set it to RS232 through the front panel menus. See section 14-18 of the manual for RS232 setup expected.
Craig
10-14-2018 10:34 AM
I've already set it up to an RS232 connection. When I changed it, the keithley restarted and then i was able to open the settings again to change some of the other options (ie parity, bits etc). I'll look into that part of the manual to see if i missed anything.
Thanks
10-14-2018 10:36 AM
Sorry, I'm really unfamiliar with this type of stuff (but I'm trying to learn!). How would I go about doing this? I though the driver was made to make it very easy for me to communicate with the Keithley. If not, then how would I see what message I am sending and compare that to what it is expecting?
Thanks
10-14-2018 01:58 PM
Hi Bavley,
How would I go about doing this?
That process is called debugging…
I though the driver was made to make it very easy for me to communicate with the Keithley.
Yes, but most often with GPIB in mind. RS232 usually needs some slightly changed messages: this should be described in the manual of your Keithley!
If not, then how would I see what message I am sending and compare that to what it is expecting?
Somewhere in that driver is a VI with a VISAWrite function to send the command/message to your device: place a probe here to see the sent message.
Using other debugging techniques like breakpoints or step-by-step execution might also help here…
10-14-2018 03:49 PM
Would I use the "VISAWrite" commands in a VI or using MAX?
10-14-2018 09:09 PM
The driver really does make it relatively easy. You still need to understand the instrument, the measurement you want to make, and learn a minimum about instrument communications and LabVIEW programming.
What example are you running? Have you udes debugging to identify what VI causes the error? Then look inside that VI for the SCPI commands its using.
You mention you changed RS232 setting? Is that in the software or on the instrument?
10-15-2018 10:47 AM
I changed the RS232 settings on the instrument since the default for a Keithley is GPIB. I will give what you said a shot and hopefully that works. What do I do if the SCPI command the VI is using wrong? I'm using some of the simple current/voltage/resistance measurement VIs.
10-15-2018 10:59 AM - edited 10-15-2018 11:00 AM
The SCPI commands the LabVIEW driver are not wrong. What's wrong is something in your setup of RS232 parameters or a change made to the instrument setup that results in commands not being received properly. So perhaps before you debug that make sure that the physcial setup is correct.
Go back to NI Max and look at the settings there for the communications, then look at the settings on the instrument and make sure they match. Then see if you can send a "*IDN?\r" to the instrument and get a response. If you get a response, then move on to LabVIEW driver. (Make sure you close NI MAX before trying LabVIEW!) If not then you need to investigate the connection setup further.
PS - What firmaware are you running on the K2400? I'd update to the newest version. Instruction for that are on the Tek site - https://www.tek.com/source-measure-units/2400-software/2400-series-firmware-revision-c33