LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple V-i Measurements with a Keithley 2400 Sourcemeter on LabView

Solved!
Go to solution

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

0 Kudos
Message 1 of 16
(8,223 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 16
(8,198 Views)

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

Message 3 of 16
(8,191 Views)

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

0 Kudos
Message 4 of 16
(8,184 Views)

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

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

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 16
(8,172 Views)

Would I use the "VISAWrite" commands in a VI or using MAX?

0 Kudos
Message 7 of 16
(8,157 Views)

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?

Message 8 of 16
(8,143 Views)

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.

0 Kudos
Message 9 of 16
(8,128 Views)

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

Message 10 of 16
(8,124 Views)