Qcodes
Qcodes copied to clipboard
fix cryomagnetics4g driver bug.
I am trying to fix several bugs in cryomagnetics4g:
- In the write_raw function of the code, when VisaIOError occurs in the first communication, the code will use
self._RETRY_WRITE_ASKto determine whether to re-communicate, but I did not see the definition ofself._RETRY_WRITE_ASKin the code, so I added
self._RETRY_WRITE_ASK = True
self._RETRY_TIME = 1
- This magnet power supply has three states: Standby, Holding, and Ramping. In the original code, each time the
set_fieldfunction is executed, it will determine whether the magnetic field setting is normal by judging whether the final state is the Holding state. However, he forgot one situation——when the magnetic field is set to 0T, the magnet power supply will enter the Standby state instead of Holding, so I added a judgment to fix this problem. - This program waits for the excitation to end by checking the status code
status_byte = int(self.ask("*STB?")), when the magnet state is not ramping, it means that the excitation is complete. However, there is a problem with this magnet power supply——even if the magnetic field has been added to the specified value, the state is still ramping and will not change! So I changed to ask the current magnetic field valueself._get_field()to determine whether the excitation is complete