Closed prakhub closed 2 months ago
In my opinion, there are two possible fixes:
initialize_switch()
command after "Clear State"So this is unexpected! Maybe the better option to overcome this behavior would be to explicitly call open_all_channels()
in the BrandBox drivers configure()
method:
def configure(self, options: dict) -> None:
self.open_all_channels()
channels = options.get("channels", [])
self.close_channels(channels)
After the initializing the switch
https://github.com/hephy-dd/diode-measurement/blob/ef06b805224ebbf3d82fb0fa0bd57a5ab1c4a9ed/diode_measurement/measurement/__init__.py#L344 The clear state signal is sent to the Switch Box. https://github.com/hephy-dd/diode-measurement/blob/ef06b805224ebbf3d82fb0fa0bd57a5ab1c4a9ed/diode_measurement/measurement/__init__.py#L356 However, maybe unexpectedly, the clear state command also changes the switch states and sets the switchbox to the default I-V mode.
In the default "I-V" mode, some switches are already closed.
Later, in the configure action, only the switches to be closed are sent as a command: https://github.com/hephy-dd/diode-measurement/blob/ef06b805224ebbf3d82fb0fa0bd57a5ab1c4a9ed/diode_measurement/driver/brandbox.py#L56
This means that the switches which are closed via
*CLS
are never opened again and the configuration of the switch box is wrong.