[dataio/daq] making the buffer bigger

This commit is contained in:
wendtalexander 2024-10-24 16:35:09 +02:00
parent 3ab7a33b52
commit 2ef018ef07

View File

@ -41,7 +41,7 @@ class DaqProducer:
) )
# let the buffer for the daq device hold 5 seconds of data # let the buffer for the daq device hold 5 seconds of data
daq_buffer_size = int(self.buffer.samplerate * 5) daq_buffer_size = int(self.buffer.samplerate * 30)
data_in = uldaq.create_float_buffer(channel_range.size, daq_buffer_size) data_in = uldaq.create_float_buffer(channel_range.size, daq_buffer_size)
log.debug(f"Buffersize for daq {len(data_in)}") log.debug(f"Buffersize for daq {len(data_in)}")
@ -84,7 +84,7 @@ class DaqProducer:
channel_samples = transfer_status.current_scan_count channel_samples = transfer_status.current_scan_count
new_data_count = total_samples - prev_count new_data_count = total_samples - prev_count
# check if counts if new data is bigger than the buffer # check if new data is bigger than the buffer
# if that happends stop the acquisition # if that happends stop the acquisition
if new_data_count > len(data_in): if new_data_count > len(data_in):
self.ai_device.scan_stop() self.ai_device.scan_stop()
@ -136,8 +136,6 @@ class DaqProducer:
data_second_channel = data_in[ data_second_channel = data_in[
prev_index + 1 : prev_index + chunk_size : 2 prev_index + 1 : prev_index + chunk_size : 2
] ]
embed()
exit()
[ [
self.buffer.append(data_first_channel[i], channel=0) self.buffer.append(data_first_channel[i], channel=0)
for i in range(int(chunk_size / 2)) for i in range(int(chunk_size / 2))