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: 

serial read; LabVIEW and my Keithley-6487 picoammeter

Hi,

I’ve got a problem with serial communication between LabVIEW on my PC and my Keithley-6487 picoammeter – I just want to source a voltage and measure a corresponding current; simple enough, but at the moment I can only source a voltage, I can’t retrieve the current from the Keithley. My code for this is here:-

http://www.ee.ucl.ac.uk/~pfrench/Download/Misc2.html*

[the code is crude but effective at the moment]

Thanks,

Paul French
 
*OR USE:-
0 Kudos
Message 1 of 10
(5,486 Views)
One problem is that you are not sending the control characters \r and \n. You are sending the thext "\","r","\", and "n". In order to send them, you need to right click on the string control and select "\" codes display. Your text will then change to \\r\\n. Replace it with\r\n and see if it works.
0 Kudos
Message 2 of 10
(5,482 Views)

Hi further to the last message I get either:

 

-1073807339 (Timeout expired before operation completed)

When using a constant number within “byte count” in the read operation, and this occurs regardless of the size of “byte count”

 

Or I get:-

 

1073676294 (a warning saying that “The Number of Bytes Transferred is Equal to the Input Count. More data might be available”)

When I use a property node.

 

 

I’ve found my code to be effective up to now, but I just can’t get data read from the serial port (the device I’m writing/reading to is the Keithley 6487 picoammeter)

 

 

Thanks for any help,

 

 

Paul

0 Kudos
Message 3 of 10
(5,468 Views)
Well, now the code you've posted only appends the carriage return. There should be information from the vendor as to what the required termination actually is. If you had modified the VI like I recomended, you would not need the concantanate string functions and you certainly can get rid of the sequence structure.
0 Kudos
Message 4 of 10
(5,459 Views)

Hi,

I did try that but it didn't work -- I'll have another go using old code again

thanks,

paul

0 Kudos
Message 5 of 10
(5,447 Views)

Hello,

 

I know this thread has not been replied to for a while, but it was the closest to answering my question.  Just to introduce my system and application, I have enclosed the following:

 

Dell Intel Dual Core 3.2 GHz

Labview 8.6

Keithley 6487 (the one with the voltage source built in)

USB-to-Serial adapter for communications

 

The Keithley 6487 is connected to a Faraday Cup, intended to measure small electron/ion currents in vacuum.  The voltage is meant to repel electrons below a specific energy, thus, measuring I vs. V and taking a point-wise numerical derivative, one can find dI/dV vs. V, which is leads to an energy distribution.  The mathematical part is something I believe I can do, I've experimented enough with LabView and math to do this last part.

 

I am unable to use GPIB, and even if I could, and I've been told that serial can acquire this data more quickly, so this thread was the best one with a VI written for the Keithley 6487 via serial.

 

Here is what I need:

 

I need to input: Start Voltage, Stop Voltage, Step Voltage, Delay Time

I need to read: Measured Current

 

Of course, I'd prefer a totally pre-written VI, but neither Keithley, nor NI seems to have one that does voltage sweeps communicating via serial.  If I'm wrong, please let me know.  I can use the VI in this thread as a starting point, but I do not understand what I need to do in order to make it work properly.  My knowledge of LabView is somewhat limited, but I can get by with the basics, modifying existing code as needed, etc.

 

Can you please be more specific as to the procedure for modifying this code to work, and, if you happen to have any other suggestions, how to get it closer to the final VI that I am trying to design.

 

Any and all help is most appreciated, thanks in advance,

 

bcmasters81

0 Kudos
Message 6 of 10
(5,144 Views)

Doing a sweep is a pretty simple task. There is a shipping example called Frequency Response that does a simulated frequency sweep with a start, stop, and number of steps. Below is a modification that uses a start, stop, and step size. You can modify the example to use actual instrument code. Keithley has a driver for the 6487.

 

There have been numerous posts on how to do sweeps. Some of them have code. You might try doing a search of the forum for 'sweep' or 'voltage sweep'.

0 Kudos
Message 7 of 10
(5,131 Views)

Hello, thanx so much for your quick response.  Perhaps I should have been more specific.  I am trying to figure out how to make jake2003's code work properly.  Something about changing the strings from \\r\\n to \r\n that I did not understand.  Really at this point I want to get the communication between LabView and the 6487 up, and I can build everything else around it, like the sweeps, etc.

 

Please let me know your thoughts.

 

Thanks

0 Kudos
Message 8 of 10
(5,111 Views)

Hello,

I see this thread is super old but I am also having the same problem with my code for the Keithley 6487 picoammeter.  I just want the computer to save resistance readings every 2 seconds for about 3 minutes.  I've been using the Keithley communicator and following the instructions in the manual but it won't seem to work consistently.  It will work occasionally but the majority of the time I am getting a message saying "Timeout expired."  Does anyone know what this message means?

0 Kudos
Message 9 of 10
(3,236 Views)

Timeout expired means something did not get expected result within specified time.

It can be anything - unstable instrument connection, you skipped data from instrument, you are reading incorrectly, instrument did not get request to send data, you have configured communication incorrectly, ...

We (at least I) can not be more specific: you did not attach your vi, you did not specify where the error happens

0 Kudos
Message 10 of 10
(3,227 Views)