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

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

Bugfix in AWG worker (when no output is defined)

parent b906a8dd
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,7 @@ class SpectrumAWGWorker(Worker):
def transition_to_buffered(self, device_name, h5_file, initial_values, fresh):
self.AWG.card_stop() # If card was still running, e.g. from manual mode
write_setup_and_start = False
with h5py.File(h5_file,'r') as f:
group = f[f"devices/{device_name}"]
for ch in self.channels:
......@@ -71,6 +72,7 @@ class SpectrumAWGWorker(Worker):
last_index = len(group[ch].attrs)-1
for index in range(len(group[ch].attrs)):
index_h5 = str(index) # The index in the h5 file is a str
write_setup_and_start = True
### LOOP TROUGH STREAMING STEPS ###
instruction = group[ch].attrs[index_h5]
instruction_hash = hash(instruction.tobytes())
......@@ -109,9 +111,11 @@ class SpectrumAWGWorker(Worker):
# FOR IMPLEMENTATION ONE HASE TO INTERWEAVE THE DATA FOR BOTH CHANNELS
break
self.AWG.card_write_setup() # TODO: Do we have to call that every shot or just once after the initialization?
self.AWG.card_start()
self.AWG.card_enable_trigger()
# If there were no sequences defined in the shot, don't start the AWG
if write_setup_and_start:
self.AWG.card_write_setup() # TODO: Do we have to call that every shot or just once after the initialization?
self.AWG.card_start()
self.AWG.card_enable_trigger()
return initial_values
def transition_to_manual(self):
......
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