Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Long measurements using Keithley 2450 SMU, USB Communication

Solved!
Go to solution

Hello everyone,

I am during my long term measurements using keithley as a part of my system. I perform VdP measurments using my Keithley as a voltage source and current meter. My measuremnets took long time ( hundreds of hours ). One VdP loop took about 30 sec. I wrote LabView control driver by myself using simple SCPI code. 

 

The problem is that my communication with Keithley randomly fail. It is never the same time. When it stops I recive an error with VISA Read ( always the same ). On the other hand communication with SMU stops, and  I have to turn off the device. 

 Can anyone help me with it? My OS is Win 7 Pro and LV is 2017 and communication is via USB. 

Please find attached Keithley control program. 

 

The communication open before main loop ( in VdP program ) and only "Output" , "Measurement" and "Reset" is inside the loop. 

 

If this problem is trivial please excuse me for that, but for now I can not find any solution. 

0 Kudos
Message 1 of 27
(8,098 Views)

Dear Miklo,

 

I briefly looked at your application and I noticed one part, which can be potential source of the problem with VISA Read block. You have VISA Write and VISA Read blocks in “Measurement” case. It is good practice to put some delay between those two blocks, because it can easily happen that you try to read information from VISA interface in time, when VISA is still in write mode. By putting some delay (250 ms) between those blocks, you will give driver some time to change mode from write to read. This implementation is shown in LabVIEW example called “Simple Serial.vi”.

 

Try to implement delay between VISA Write and VISA Read blocks and let me the result. If this will not solve your problem, write me please, what is the error number generated by LabVIEW. 

 

 

Kind Regards,

 

Michal 

Applications Engineering

National Instruments

Message 2 of 27
(8,063 Views)

The way that the SCPI syntax works is that a semicolon  ";" in the command line can be replaced with a newline "\n" terminating command character.  As such, in your "Config meas" case the Voltage range string does not have a terminating command character for the second line which can cause an issue over time. 

 

If you send an "*OPC?\n" query at the conclusion when performing only VISA Writes, it will allow you to synchronize the instrument knowing that it has completed processing all previous commands.  You should then perform a VISA Read which should always return a "1" if those commands have been processed properly.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 3 of 27
(8,041 Views)

Dear Michal,

I put delay 150 ms between Write and Read and after 27 h of measurement it failed again. The error number is -1073807305. Please find attached new control program. Should I put more delay time? 250 ms? 

0 Kudos
Message 4 of 27
(8,029 Views)

Hi

I never used the buffered mode so forgive me when I have a stupid question but

The error points to:

VISA:  (Hex 0xBFFF0037) Device reported an input protocol error during transfer.

so maybe your inputstring is too long or too fast via usb.

But only sometimes. So maybe also put a small wait (20 ms) between the two writes.

And are you sure that 20 bytes is all you need?

greetings from the Netherlands
Message 5 of 27
(8,023 Views)

Dear Ablert,

thank you for your suggestions. I put 20 ms of delay ( maybe you are right ). I am sure that I need only 20 bytes. I read only one value and it is around 14 bytes. The starnge thing is, that when I started to measure for the first time it failed after 100 h. Now it is around one night 10-20 h. 

0 Kudos
Message 6 of 27
(8,018 Views)

The earlier the better, unless you don't find the problem of course.

It is USB that maybe gives this problem. I only communicated with the 2450 via GPIB and that is a lot slower.

Another option is to catch the error and retry but maybe the instrument has to be reset in that case?

Or is it still communicating afterwards?

greetings from the Netherlands
0 Kudos
Message 7 of 27
(8,013 Views)

Hello,

I'm back. Unfortuantely the problem is still exist. I wrote a killer program for keithley to see if the number of "Measurements" is the same or almost the same. This is still a random thing. As you both said I add two delays between Write and Read. For now I do not really know where the problem is.

 

I attached my killer program "Test VI Keithley.vi" and control program for Keithley. 

 

The last error that I have recived is -1073807305.

Download All
0 Kudos
Message 8 of 27
(7,967 Views)
Solution
Accepted by MIKLO

What are you connecting the K2450 to the PC with?  GPIB, Serial, USB?

 

That error code isn't very useful.  Is there a message from the K2450 when it fails?  Have you sat with debug execution on and watched where it fails?  Maybe write a little log for each state in you drive that write to a text file with pass fail.

 

Some advice..

1) Your driver is looks nice, but have you looked at the Keithley driver?  Same error?  If not then your code is lacking something.  If so then look to phycal connection issues.

 

2) I avoid any use of delays in instrument code where possible. Your "Read?" triggers the measurement and you give it 100ms before asking for the data, then you have a 10s timeout.  Better to use the *OPC? to check that the measurement is complete and then, ask for the data after the K2450 says its finished measuring. 

 

3) You use a 10s timeout for the K2450.  Why not set it to 1000s and see what happens?  If your measurement is fast, loading the buffer is fast and transfer is fast then you should never actually wait the whole 1000s.  But if your code fails at this timeout then there's an issue with buffer or measurement that needs to be addressed.

 

4) In your rest you do a VISA CLR.  I'd avoid that. it shouldn't be necessary.

 

 

0 Kudos
Message 9 of 27
(7,855 Views)
0 Kudos
Message 10 of 27
(7,851 Views)