diff --git a/ADwinProII/blacs_workers.py b/ADwinProII/blacs_workers.py index dcde962bf4377895e080a7e9e00b871b74455b4d..8271e021803ff47ed8999dee206350c5b6584eb1 100644 --- a/ADwinProII/blacs_workers.py +++ b/ADwinProII/blacs_workers.py @@ -114,7 +114,7 @@ class ADwinProIIWorker(Worker): stop_time_quantized = np.round(self.stop_time * CLOCK_T12 / self.PROCESSDELAY) AO_data = group["ANALOG_OUT/VALUES"] final_indices = np.nonzero(AO_data["n_cycles"] == stop_time_quantized)[0] - if final_indices[-1]+1==AO_data.shape[0]: + if final_indices.size>0 and final_indices[-1]+1==AO_data.shape[0]: # In the ANALOG_OUT table, there is a termination line. The time (cycle number) of this line # should be one larger than the last outputs, but sometimes this seemed to be violated. I added # this check to remove this line in any of those cases from trying to use it for final values.