diff --git a/CHANGELOG.md b/CHANGELOG.md index 7db1f39161ab8239bbcd6a00ca26526fd43e72e8..a7a0d5931ce9d51331e8b56ab6e38e1709b45a85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pulse_lib/keysight/M3202A_uploader.py b/pulse_lib/keysight/M3202A_uploader.py index da3f30318cc727600c371011f0d1c1df988b93dc..af26465f97cb4956e87d5427430b4969d0597060 100644 --- a/pulse_lib/keysight/M3202A_uploader.py +++ b/pulse_lib/keysight/M3202A_uploader.py @@ -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, diff --git a/pulse_lib/qblox/pulsar_uploader.py b/pulse_lib/qblox/pulsar_uploader.py index a31965bbc8aa9416a55e63f9ece8dfc66716024a..e35d31b6de38e07003110396238212dcec68edd1 100644 --- a/pulse_lib/qblox/pulsar_uploader.py +++ b/pulse_lib/qblox/pulsar_uploader.py @@ -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() diff --git a/pulse_lib/tests/acquire/test_read.py b/pulse_lib/tests/acquire/test_read.py index 0f7a36370ecfe430a42d3e72e90a10158eafe21d..020b241c8d95ef7f1f2ba4c635de9de38823d607 100644 --- a/pulse_lib/tests/acquire/test_read.py +++ b/pulse_lib/tests/acquire/test_read.py @@ -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() diff --git a/pulse_lib/tests/mock_m3102a.py b/pulse_lib/tests/mock_m3102a.py index f4cff0356346bd27560146e5b629c5ed26d5c4bb..da10a5c1bd8e4ba29ab1abb65f054b64f404de3c 100644 --- a/pulse_lib/tests/mock_m3102a.py +++ b/pulse_lib/tests/mock_m3102a.py @@ -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]