Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

timeout fails when instrument is turned off

I have a power supply connected to my PC over GPIB using VISA.  Everything seems to work fine, but when I turn off the power supply, and then try a query, VISA seems to just hang for around 30 seconds.  I would expect it to timeout after only a few seconds (or whatever the timeout is set to, which is much less than 30s), but it does not.  After this first query, it will timeout in a normal fashion, but the first query after powering off the instrument always takes forever.  Nothing else can be sent over GPIB in the mean time.  Any idea what might be causing this?

0 Kudos
Message 1 of 5
(5,209 Views)

Hi roboguy222,

 

That's definitely very interesting behavior and not something I've personally seen before. What model power supply is it? Do you see the same behavior with other power supplies? Also, how are you performing the query? If you're not already doing this I would try and simplify your code as much as possible, just using VISA test panels in NI MAX with a simple query to see if you still see this behavior. 

 

Thanks,

Selene
0 Kudos
Message 2 of 5
(5,181 Views)

I originally found the problem using pyvisa:

 

import visa
rm = visa.ResourceManager()
list = rm.list_resources()
ps = rm.open_resource('GPIB0::5::INSTR')
ps.query('*IDN?')
[TURN PS OFF]
ps.query('*IDN?')

The problem was the same, however, if I used the NI Device Monitor to directly query a device.  I am using an Agilent 6641A Power Supply, and will check if the problem persists for other instruments soon.

 

Thanks! 

0 Kudos
Message 3 of 5
(5,175 Views)

Roboguy,

 

What happens if you leave the power off for a while before querying it? Turn it off, wait 5 minutes or so, then query it. It may be a residual charge or something within the power supply.

Austin
Staff Software Engineer
NI
0 Kudos
Message 4 of 5
(5,121 Views)

Updating VISA seems to have fixed this issue.

0 Kudos
Message 5 of 5
(4,687 Views)