09-27-2017 11:15 PM
Since you are using USB, I should point out a problem I've found with several PCs.
I've had issues with USB ports on some PCs with Windows 7/8/10.
In newer windows versions there's a power saving options that allows USB ports to go into a low power "sleep" mode. I've found that going into low power mode the VISA sessions gets dropped and the instrument stop responding often with odd errors. Since it can happen at random times, the errors are often different.
If that's your problem the solution is to change the power saving plan to "always on", and also make sure that the USB power saving mode is disabled.
Hope this helps..easier than writing code to catch a instrument dropping out.
I was finally able to download the K2450 driver form their website. The code I posted should do exactly the same thing as your driver, just using their provided functions. If it drops out randomly the same way then the problem is not with the measurement and I'd look into the USB. Maybe try a GPIB or LAN connection.
09-28-2017 01:15 AM
Hello,
I think that I've solved the problem. Excuse me for so much delay in anwsering but I have to be sure that it will be working for long term. The problem was, as you mentioned with VISA Clear. When I removed VISA Clear everything is working pretty good. Now I have 3rd week of working my vi and it looks good.
I want to thank all of you for helping me with that.
Have a nice measurements !!
09-28-2017 08:24 AM
That's great. If you do try my code I'd be curious if it worked. I have lots of 2400, but not 2450 to test it on.
The other source of error that might come up in your code is that you try to read only 20 bytes. Look at the Keithley driver Read.vi, it uses something huge like 20k bytes. That way you never read too little. The end of line character will finish the read so setting extra space, 20k vs 20, doesn't matter just like setting a very long timeout.
Good luck.
10-19-2017 08:55 AM
I have the same problem. I tried to use your code but unfortunately I have Labview 11 and it doesn't open it. Could you please save it in such a way to open it with the v. 11?
Thanks in advance
10-19-2017 09:02 AM
Oh, sorry. I misssed your message. I will try your code as soon as I finished my current measurements.
10-19-2017 09:08 AM
Thank you very very much!
10-19-2017 09:48 AM
Hi MIKLO & SpainUcm,
So its working now? Which version of the code? If someone needs my code in LV2011 I can re-post, just let me know.
Craig
10-19-2017 10:06 AM
"Poor form Peter." from the movie Hook.
You marked yourself as the solution when another is the one who posted the idea that brought you to the solution. It sounds to me like cstorey from message 9 of this post should be marked as the solution if the issue was removing the VISA Clear. All other inputs that were of benefit at arriving at the solution should be given Kudos.
10-20-2017 02:41 AM
Is your code working for LV11? I'd like to try it, thanks!
10-20-2017 05:02 AM
Hi SpainUcm,
I attached my current Keithley driver and killer program saved for Lv11.