11-12-2020 05:42 AM
Hi,
I am controlling a Keysight 34972A data logger and switch with LabVIEW and via an USB connection. Everything seems to work fine for most of the time, but at random intervals, the connection to the instrument is lost and all data is 0. Stopping and restarting the measurement with the same VISA resource ID fixes the problem.
Does anyone have an idea, what could cause the problem?
Cheers, Matthias
11-12-2020 05:49 AM
11-12-2020 06:34 AM
Yes, the USB suspend settings are disabled. The error occurs at random intervals, making it hard for me to troubleshoot...
11-12-2020 06:39 AM
And neither labview nor the instrument show an error message.
11-12-2020 06:40 AM
11-12-2020 06:47 AM
11-12-2020 06:55 AM
I understand! However, the program grew organically during the last years, so the block diagram is quite messy... however, previously, I was using the RS232 connection (with an Agilent 34972), and never had any problems. That's why I suspect the problem to be related with USB..
I'll try to make a simple data logging routine and let this run overnight, hoping to get the same problem.
11-12-2020 06:59 AM
11-12-2020 12:26 PM
This really does sound like a USB selective suspend issue with your computer/USB port. What OS and version are you using? To prevent the USB ports from going to sleep or low power, which cause VISA sessions all kinds of problems, use "Always ON" Power mode settings and also follow this guide to disable USB selective suspend
Win7 - https://helpdeskgeek.com/how-to/prevent-windows-from-powering-off-usb-device/
Win10 - https://www.windowscentral.com/how-prevent-windows-10-turning-usb-devices
Other ideas..
Checked the firmware version of your 34972A for updates that would fix USB drops?
Return to RS232 or ethernet and see if there are issues related to code?
Post code here for review and help.
Craig
11-12-2020 04:08 PM - edited 11-12-2020 04:08 PM
thanks a lot for your input so far. stripping the code down to a minimum created a new problem: now one VISA Read gives a "timeout expired before operation completed" error - again at random intervals.
the typical problem there are termination characters, but since I am using USB, I believe that this is not relevant for me.
Timeout is set to very high values (300 secs for a measurement, which should take a few milliseconds).
attached is a screenshot of my code, mostly consisting of VI's provided by Keysight. The error occurs in the EZ Voltage.vi, where I added an extra wait during reading, which did not help. Any ideas are highly welcome!