Skip to content
Snippets Groups Projects
Commit 5e57dc0a authored by Sander Snoo's avatar Sander Snoo
Browse files

Calculate and set timeout for acquisition

parent c13ff227
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ All notable changes to Pulselib will be documented in this file.
- Fixed setpoints of measurment parameter for time traces > 2 seconds.
- Fixed simultaneous pulses with indexing of segments on looping parameter.
- Calculate timeout for get_acquisition_data from sequence.
## \[1.6.7] - 2023-02-01
......
......@@ -155,6 +155,10 @@ class M3202A_Uploader:
acquisition_mode: set externally
scale, impedance: set externally
'''
n_rep = job.n_rep if job.n_rep else 1
total_seconds = job.playback_time * n_rep * 1e-9
timeout = int(total_seconds*1.1) + 3
enabled_channels = {}
channels = job.acquisition_conf.channels
sample_rate = job.acquisition_conf.sample_rate
......@@ -178,6 +182,8 @@ class M3202A_Uploader:
dig = self.digitizers[dig_name]
dig.set_operating_mode(2) # HVI
dig.set_active_channels(channel_nums)
if hasattr(dig, 'set_timeout'):
dig.set_timeout(timeout)
self.acq_description = AcqDescription(job.seq_id, job.index, channels,
job.acquisitions, enabled_channels,
......
......@@ -242,8 +242,12 @@ class PulsarUploader:
logging.info(f'Play {index}')
self.q1instrument.run_program(job.program) # sync
# self.q1instrument.start_program(job.program) # @@@ async
n_rep = job.n_rep if job.n_rep else 1
total_seconds = job.playback_time * n_rep * 1e-9
timeout_minutes = int(total_seconds*1.1 / 60) + 1
self.q1instrument.start_program(job.program)
self.q1instrument.wait_stopped(timeout_minutes=timeout_minutes)
if release_job:
job.release()
......
......@@ -24,8 +24,17 @@ def test3(iq_mode='I+Q'):
return context.run('read_iq_'+iq_mode, dc_param)
def test4():
# takes 200 seconds to run !!!
pulse = context.init_pulselib(n_gates=0, n_sensors=2, rf_sources=False)
dc_param = read_channels(pulse, 200e9, sample_rate=100) # 100 Hz, 200 seconds
return context.run('read', dc_param)
#%%
if __name__ == '__main__':
ds1 = test1()
ds2 = test2()
ds3 = test3()
ds4 = test4()
......@@ -45,6 +45,9 @@ class MockM3102A(Instrument):
t_downsampling = downsampling_factor * 10
return max(1, round(t_measure/t_downsampling))
def set_timeout(self, seconds):
self.timeout_seconds = seconds
def set_daq_settings(self, channel, n_cycles, t_measure, downsampled_rate=None):
self.measure._active_channels.add(channel)
properties = self.measure._ch_properties[channel]
......
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