*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit d178c6ad authored by Schabbauer, Johannes's avatar Schabbauer, Johannes
Browse files

Bugfix: Don't break ADwin code when we use no wait

parent 05f3f679
No related branches found
No related tags found
1 merge request!6Added: waits with the ADwin, calculate Tweezers occupation from the OrcaQuest mid-shot, reprogram AWG mid-shot
......@@ -143,7 +143,7 @@ class ADwinProIIWorker(Worker):
# Send stop time to ADwin
self.adw.Set_Par(2, int(self.stop_time * CLOCK_T12 / self.PROCESSDELAY))
# Send wait time and timeout to ADwin (default 0 if no waits)
self.adw.Set_Par(3, group.attrs.get("wait_time",0))
self.adw.Set_Par(3, group.attrs.get("wait_time",-1))
self.adw.Set_Par(5, group.attrs.get("wait_timeout",0))
# Send data to ADwin
AOUT = group["ANALOG_OUT/VALUES"]
......@@ -160,7 +160,7 @@ class ADwinProIIWorker(Worker):
self.smart_cache[name] = DOUT[:]
self.adw.SetData_Long(DOUT["n_cycles"], module, 1, DOUT.shape[0])
self.adw.SetData_Long(DOUT["bitfield"], module+1, 1, DOUT.shape[0])
self.adw.Set_Par(module-1, DOUT.attrs.get("wait_time",0))
self.adw.Set_Par(module-1, DOUT.attrs.get("wait_time",-1))
PIDs = group["ANALOG_OUT/PID_CHANNELS"]
if fresh or not np.array_equal(PIDs[:],self.smart_cache["PIDs"]):
print("PIDs programmed.")
......
......@@ -198,8 +198,10 @@ class ADwinProII(PseudoclockDevice):
def do_checks(self, outputs):
if len(self.trigger_times)>2 or self.trigger_times[1] not in compiler.wait_table:
raise NotImplementedError('ADwin does not support retriggering, and only supports one "wait" in the current implementation.')
if len(self.trigger_times)>1:
# Either only one software trigger (for starting shot as master pseudoclock), or two (where the second one is for the 'wait')
if len(self.trigger_times)==2 and self.trigger_times[1] not in compiler.wait_table:
raise NotImplementedError('ADwin does not support retriggering, and only supports one "wait" in the current implementation.')
for output in outputs:
output.do_checks(self.trigger_times)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment