LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keysight Waveform generator 33521B hangs up

Solved!
Go to solution

I am using drivers Agilent 3352X Series.lvlib for the waveform generator 33521B from Keysight.

First I am initializing the instrument with the VI "Initialize.vi". After some measurements I am closing it.

Sometimes when I would run the "Initialize.vi" again it hangs up for a minute and then comes back with timeout error.

Anyone that has seen the same problem?

0 Kudos
Message 1 of 14
(5,337 Views)

If it is connected with USB have you disabled your PC power saving mode?

(If not never mind)

 

Ben64

0 Kudos
Message 2 of 14
(5,330 Views)

Yes, it is connected with the USB and the power saving is not active.

0 Kudos
Message 3 of 14
(5,319 Views)

Does the instrument give you an error?  Do the Initialize.vi give you an error?  

 

Why not post your code and we can see if there's a problem in the code that causes the error?

 

 

When you say close, are you running the Close.vi?  If the instrument has received commands and you then terminate the program with the LabVIEW Stop icon you are leaving the instruments in an indeterminate state. Perhaps its waiting to receive data and ignore the next request. 

 

I'll echo you should check power settings for USB.  That one has hung me up a few times. The steps to disable it are here - https://helpdeskgeek.com/how-to/prevent-windows-from-powering-off-usb-device/

 

Craig

0 Kudos
Message 4 of 14
(5,287 Views)

No, the instrument doesn't give me an error but LabView does in the Initialize.vi (timeout error).

I am using the Close.vi.

If it is a problem with the USB power setting, why does it always work the first time every time?

I'll post the important part of my code here.

0 Kudos
Message 5 of 14
(5,278 Views)

Hi hasse,

 

Are you familiar with Measurement & Automation Explorer (MAX)? Let's try to use VISA Test Panel and see if you get the same behavior. If not, probably the issue comes from the code.

 

Regards,

Jose F.

0 Kudos
Message 6 of 14
(5,273 Views)

In your code you use VISA close in one case.  Just use the driver "Close.vi" and make your logice such that there is only one way to get there.33521b.png

 

 

 

Craig

0 Kudos
Message 7 of 14
(5,259 Views)

Hi Craig,

I've tried your suggestion and it is still the same problem.

The code runs fine the first time and after close there is no error.

Next time I run the VI it will be stuck inside the Initialize.vi

Error -1073807339 occurred at VISA Read in Agilent 3352X Series.lvlib:InitializeWithID.vi->WFG_Instrument.vi

Possible reason(s):

VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed.

 

After that I turn off/on the instrument and everything works for one more time until the timeout happens.

0 Kudos
Message 8 of 14
(5,226 Views)

Post the code you are running so I can see what you are doing.

0 Kudos
Message 9 of 14
(5,217 Views)
Solution
Accepted by topic author hasse

Well, the original Initialize.vi from the 3352X library have a timeout of 10 sec and is set to read back 256 bytes of data from the *IDN? query. Your modified vi have a 5 sec timeout and is set to read back 1024 bytes. The reduced timeout is probably the cause of the timeout error (the comm probably use an END character so the increased bytes to read probably have no impact). After powering up the buffers are empty so the clear function executes rapidly, after a run it may take longer to execute.

 

Also never us the Stop.vi, you don't know in what state this will leave the instrument. Also note that the Close.vi always execute even when there is an incoming error and that the CLose.vi is called in the Initialize.vi when there is an error so it is useless to call it in your error case.

 

Ben64

Message 10 of 14
(5,205 Views)