LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Timeout Error with Agilent U3606A

Hi All,

 

I realise there are quite a few posts about timeout errors on here - I've worked through many of the threads which seem similar to my problem and still haven't had any luck, so I'm hoping someone here can help me figure this out.

 

I'm trying to use LabVIEW to control an Agilent U3606A (Source/DMM) with the USB connector. I've tried using the provided LabVIEW Agilent drivers for this unit, and every single time come up against a timeout error - tried it on multiple computers, and tried GPIB rather than USB - my preference for USB is just that the computer this should eventually run off of doesn't have GPIB, but I'll take anything that works at this stage.

 

What bothers me more than anything is that, using the VISA test panel which can be accessed through NI-MAX, I can send the commands I wish and have the expected response - at the moment I'm alternating between toggling the output on and off and sending the *IDN?\n command because these have clear, definite responses which don't depend on anything else I have set up. The end goal is to run the source until a second instrument picks up a specific reading - I already have a fully functional, reliable code for the readout, and am trying to develop the code for the source separately to it first to isolate any problems, before combining the two processes, adding the cutout and dealing with any resulting bugs.

 

Find attached a screencap of a simple VI I built to try to debug this timeout problem. If I single-step through it, the error always seems to be associated with the read step. I'm using the numeric indicators just to check that the number of bytes at each stage are what I expect from doing the same thing in NI-MAX, and have increased the timeout to far in excess of what is necessary (my judgement of "necessary" being based on the timeout which I have set in the NI-MAX test panel to perform the same process) in order to try removing this as the issue.

 

Any assistance in either solving my problem, or insight into what further debugging I could perform to isolate my issue, would be very much appreciated. 

0 Kudos
Message 1 of 3
(2,282 Views)

Hi Alex,

 

using the VISA test panel which can be accessed through NI-MAX, I can send the commands I wish and have the expected response - at the moment I'm alternating between toggling the output on and off and sending the *IDN?\n command because these have clear, definite responses

You big fail is: you did not enable/show the display style indicator of your string constant.

Your next big fail is: you did not attach a VI. You attached just an image we cannot debug using LabVIEW.

 

My glassball says: you are sending the characters "\", "r", "\" and "n" when you need to send just 2 bytes 0D0A (or "\r\n" in \-display style or CR+LF when using default ASCII notation)!

 

  • You also forgot to wire the error from VISAWrite to VISARead. And you used the wrong datatype for that "100" numeric constant.
  • Instead of VISAOpen and that Timeout property node you could use VISAConfigureSerialPort.
  • Do you really need to clear the port right after opening it?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,237 Views)

@GerdW wrote:
  • Instead of VISAOpen and that Timeout property node you could use VISAConfigureSerialPort.

Only applicable if the instrument actually shows up as a virtual COM port when connected over USB (many of the large instruments do not).

 

Otherwise, I agree with GerdW that the likely issue is the display format of the commanded string.  Right-click on the constant and choose Visible Items->Display Style.  If a little 'n' appears, that mean you are in "normal" display.  Click on it and you can change to "\ Codes".  You will now see a little '\' instead.  Now remove the extra slashes in the string to correct the termination of the command.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 3
(2,196 Views)