Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Keysight 34972A looses USB connection in LabVIEW

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

0 Kudos
Message 1 of 15
(1,679 Views)

Hi

Did you check that your usb connections power settings in windows are set to NOT suspend power?

greetings from the Netherlands
0 Kudos
Message 2 of 15
(1,675 Views)

Yes, the USB suspend settings are disabled. The error occurs at random intervals, making it hard for me to troubleshoot...

0 Kudos
Message 3 of 15
(1,660 Views)

And neither labview nor the instrument show an error message.

0 Kudos
Message 4 of 15
(1,653 Views)

Hi

Any error messages or code we can look at?

Do post a picture of a vi, post the vi.

greetings from the Netherlands
0 Kudos
Message 5 of 15
(1,652 Views)

Even more important to look at the code

 

greetings from the Netherlands
0 Kudos
Message 6 of 15
(1,646 Views)

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. 

0 Kudos
Message 7 of 15
(1,644 Views)

good luck

greetings from the Netherlands
0 Kudos
Message 8 of 15
(1,640 Views)

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

0 Kudos
Message 9 of 15
(1,621 Views)

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!

 

 

Download All
0 Kudos
Message 10 of 15
(1,610 Views)