Closed roboguy222 closed 8 years ago
There is also a really long wait time right after turning it off where the computer seems confused. What is going on here?
When the PS is turned back on, the adr server doesn't always recognize it as connected for some reason.
The really long wait time in ^^ seems to be a visa error. Even when the timeout is only 3s, it still takes ~30s to error out when you query a instrument for the first time when it is off.
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?')
This more or less works now. There is still a delay sometimes, but maybe we just have to deal with it. I had to add a 0.5s pause before connecting to the instrument so that the device server has a chance to add the instrument first, otherwise the instrument address cannot be found.