From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data from Picoammeter to PC via RS232-USB cable

Solved!
Go to solution

Hi everyone,

I am a beginner of learning labview. I am trying to read current values from Keithley Picoammeter 6485 to my PC via RS232(6485)-USB(PC) cable, and then use labview to process and save the data. I have known how to process the data with labview; but I do not know how to obtain the data from 6485 to my PC via RS232(6485)-USB(PC). Could anyone give me some advice? Do I need some extra hardware besides the cable? Thanks!

Message 1 of 18
(7,452 Views)

Taking a quick look at the manual for the Keithley 6485, I read these sections:

 

The Model 6485/6487 supports two built-in remote interfaces: GPIB interface and RS-232 interface. You can use only one interface at a time. At the factory, the GPIB is selected. To select the interface, press COMM, select RS 232 or GPIB, then press ENTER. The Model 6485/6487 will reset with the new interface selected.

...

To configure the RS-232 interface, press CONFIG then COMM when the RS-232 interface is selected, then set baud rate, data bits, parity, terminator, and flow control. To assure proper operation, be sure that interface parameters are the same as those used by the controlling computer.

...

With the power off, connect the Model 6485/6487 RS-232 connector (Figure 7-1 or Figure 7-2) to the computer serial port using a straight through shielded RS-232 cable terminated with DB-9 connectors (Keithley Model 7009). Do not use a null modem cable.

 

So initially, a few key points.

  • Did you set the mode to RS232?
  • Do you know the parameters the device has configured? These should be used with the VISA Configure Serial Port node in LabVIEW
  • Make sure to use a straight-through cable (or equivalent). Sometimes I have difficulties when a USB to serial converter is 'null-modem' style - this means that it switches two of the cables inside the connector. If you have that kind of adaptor, you can use a null-modem adaptor to switch them back (or use a different usb adaptor...)

 

Assuming that you're already past all of that, then you should have something you can communicate with nicely. Once you've gotten it all wired up and you're pretty confident about your connections, you can try using the VISA Write and VISA Read primitive nodes in LabVIEW (they're under Data Communication > Protocols > Serial) to write the message '*IDN?' and hopefully read back the manufacturer, model number, ... to confirm you have working communications.

 

Then, you can just go ahead and use the commands as you need them from the manual, under the heading "Remote Commands".

 

It looks like you can set the device to set a LF (line feed) at the end of each transmission - use this with the terminator option in VISA Configure Serial Port to avoid having to read a specific number of bytes - instead you can read a large number of bytes (say 50) and know that it will stop when it hits a LF character. (I made up the number 50 - make sure none of the responses are longer than whatever you set!)

 

 


GCentral
Message 2 of 18
(7,409 Views)

Hi cbutcher, Thanks for your reply!

I plan to use a RS232-USB cable (https://www.sparkfun.com/products/11304). I do not know if it is the one you mentioned. I will try the steps your suggested. Thanks!

0 Kudos
Message 3 of 18
(7,396 Views)

Hi cbutcher, I set up everything like you told me but I have not finished it because I am busy with some other things. Thanks!

0 Kudos
Message 4 of 18
(7,330 Views)

@Max999 wrote:

Hi cbutcher, Thanks for your reply!

I plan to use a RS232-USB cable (https://www.sparkfun.com/products/11304). I do not know if it is the one you mentioned. I will try the steps your suggested. Thanks!


Get the cable Keithley provides.  It's special and will work.  Or, post back if the one you think will do does.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 18
(7,324 Views)
Hi cbutcher, I set up all the parameters as you suggested and used the VISA write and read access the information as you said with '*IDN?' but I did not get anything. There was a error out. For details, please see the picture I attached. Could you please help me to correct the program if something is wrong? Thanks!
0 Kudos
Message 6 of 18
(7,279 Views)

Hi Jeff·Þ·Bohrer,

Keithley did not provide the cable. In the manual, it requires to use a straight-through cable (RS-232). Instead I got a RS232- USB cable. It does not work. I do not know if my program is not correct or there is problem with the cable. 

0 Kudos
Message 7 of 18
(7,276 Views)

Perhaps you could try this VI? I haven't wired the inputs to the VISA Configure, because you've shown the defaults in your image - I'm sure you already checked but these should match the settings you have on the device - it doesn't seem to list defaults in the manual.

 

I suspect the problem is that you're not sending a termination character (LF) on the end of your query (at least that I can see). The display type of '\' for my string constant makes this easier to see. I can see how you would get the string you're sending from what I earlier posted - I apologise for the confusion, I used quotations to specify what you should send, but you don't need to send the apostrophes/quotation marks. Also, the termination character (IIRC) only affects Reads, not Writes, so you have to manually add the LF to your write commands. Usually, you can do this with Concatenate Strings, or similar.

 

I back-saved to 2012 just in case. If you need an earlier copy, just ask (or recreate from the snippet below).

 

VISA_Example.png


GCentral
0 Kudos
Message 8 of 18
(7,265 Views)
Solution
Accepted by topic author Max999

@Max999 wrote:

Hi Jeff·Þ·Bohrer,

Keithley did not provide the cable. In the manual, it requires to use a straight-through cable (RS-232). Instead I got a RS232- USB cable. It does not work. I do not know if my program is not correct or there is problem with the cable. 


  1. You have this RS232-USB cable as you mentioned: https://www.sparkfun.com/products/11304 This should work just fine, since it uses FTDI chip considered as reliable. Did you install the cable drivers under your Windows? Do you see an extra "COM" port (or a single one if you did not have physical port in your system before) which was created by this driver, when you open your Device Manager under Windows settings?
  2. Connect your cable's USB side to your PC, the 9-pin D-sub connector end to the Keithley picoamp unit.
  3. Open the main window of your LabVIEW IDE
  4. Go to Help --> Find Instruments Drivers...
  5. Select "Keithley" from the "Manufacturer" list, and type "6485" into the "Additional keywords" field. You should see this: keithleydriver.png
  6. Select Install
  7. Now you can access the VIs under the palette menu: "Instrument I/O" --> "Instr drivers" --> "Keithley 648X series"

 

 

 

 

 

 

You can make a simple VI to test your RS232 connection works fine. For example, a simple picoamp Read test:

 

keithley.png

 

Tell us if you get any error msg, so we can guide you further.

 

PS.: I am very happy that finally NI/Keithley provides us proper SCPI drivers for the Keithley 6485/6487 units! As I see this driver pack just got released last month 🙂 Last year we had to program our driver for these units, since we could not use the old (DLL based) drivers under LabVIEW Real Time systems...

 

drvier1.png

Message 9 of 18
(7,262 Views)

Some more things:

  1. I forgot to limit the speed of the While loop in my example, this is usually wise to do, see the snippet below where the reading set to 1 sec speed
  2. Discover the different configuration VIs for your unit. If you want to do a proper measurement, you need to keep several things in mind. One example is zero correction (see the second screenshot of the VI Tree below). Also read the manual for further info, like around page 49...

 

Keithley_read_test1.png

 

TREE.png

Message 10 of 18
(7,255 Views)