McDermott-Group / servers

Public repo that stores LabRAD servers and other non-measurement related code
0 stars 2 forks source link

[ADR Server] Errors when PS is off #25

Closed roboguy222 closed 8 years ago

roboguy222 commented 8 years ago
WindowsError: [Error 32] The process cannot access the file because it is being used by another process
GPIB Bus: No response from GPIB0::5::INSTR to 'MEAS:CURR?'
roboguy222 commented 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?

roboguy222 commented 8 years ago

When the PS is turned back on, the adr server doesn't always recognize it as connected for some reason.

roboguy222 commented 8 years ago

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?')
roboguy222 commented 8 years ago

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.