-
Notifications
You must be signed in to change notification settings - Fork 331
fix cryomagnetics4g driver bug. #7114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,3 @@ | |||
1. Fixed the problem that there is no specific initialization variable in self._RETRY_WRITE_ASK. | |||
2. Fix the instrument status recognition problem in self.set_field. | |||
3. Fixed the ramping state recognition issue in wait_while_ramping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you reword this so it's clear which driver this refers to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that! I've updated the code in a new commit following your suggestion.
if not exit_state.holding: | ||
msg = "_set_field({}) failed with state: {}" | ||
raise Cryomagnetics4GException(msg.format(field_setpoint, exit_state)) | ||
if not exit_state.standby: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not exit_state.standby: | |
if not exit_state.standby and not exit_state.holding: |
Writing this on one line will make the logic clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! I've updated the code accordingly.
I am trying to fix several bugs in cryomagnetics4g:
self._RETRY_WRITE_ASK
to determine whether to re-communicate, but I did not see the definition ofself._RETRY_WRITE_ASK
in the code, so I addedset_field
function 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.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