-
Notifications
You must be signed in to change notification settings - Fork 345
Tektronix DPO7200xx and AWG70000A — Convenience Methods for Waveform Workflows #7865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
164d769
1f814f8
78a6894
4e8d3c4
e0bfa26
806d041
7b5a150
805c19b
f1be0af
cfe0348
f567eb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add convenience methods to Tektronix DPO7200xx (``single``, ``download_waveforms``, ``get_timebase``) and AWG70000A (``upload_seqx``) drivers for streamlined waveform acquisition and sequence upload workflows. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -158,6 +158,64 @@ def ask_raw(self, cmd: str) -> str: | |||||
| self.visa_log.debug(f"Response: {response}") | ||||||
| return response | ||||||
|
|
||||||
| def single(self): | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| """ | ||||||
| Set scope into single acquisition mode and wait for triggered acquisition | ||||||
| """ | ||||||
| self.acquisition.stop_after("SEQUENCE") | ||||||
| self.acquisition.state("RUN") | ||||||
| timeout_val = self.timeout() | ||||||
| timeout = timeout_val if timeout_val is not None else 10.0 | ||||||
| start_time = time.time() | ||||||
| while True: | ||||||
| acq_state = self.acquisition.state().strip() | ||||||
| trigger_state = self.trigger.ready().strip() | ||||||
| # logger.info(f"Trigger: {trigger_state}, Acquisition: {acq_state}") | ||||||
| if (acq_state == "1") and (trigger_state == "1"): | ||||||
| break | ||||||
|
|
||||||
| if time.time() - start_time > timeout: | ||||||
| break | ||||||
| time.sleep(0.1) | ||||||
|
|
||||||
| def download_waveforms(self) -> tuple: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
If I understand correctly the tuple contains numpy arrays |
||||||
| """ | ||||||
| Wait for acquisition of a triggered waveform to complete and then | ||||||
| download acquired waveforms from the enabled channels the Tektronix scope. | ||||||
| """ | ||||||
| timeout_val = self.timeout() | ||||||
| timeout = timeout_val if timeout_val is not None else 60.0 | ||||||
| start_time = time.time() | ||||||
| while True: | ||||||
| acq_state = self.acquisition.state().strip() | ||||||
| if acq_state == "0": | ||||||
| break | ||||||
| if time.time() - start_time > timeout: | ||||||
| break | ||||||
| time.sleep(0.1) | ||||||
|
|
||||||
| # Only download waveforms from enabled channels | ||||||
| wfms = () | ||||||
| for ch in self.channel: | ||||||
| if self.ask(f"SELect:{ch._identifier}?").strip() == "1": | ||||||
| ch.set_trace_length(self.horizontal.record_length()) | ||||||
| wfms += ( | ||||||
| ch.waveform.trace(), | ||||||
| ) # This will trigger the actual download of the waveform | ||||||
| return wfms | ||||||
|
|
||||||
| def get_timebase(self) -> tuple: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| """ | ||||||
| Get the timebase of the scope in seconds per division | ||||||
|
|
||||||
| Returns: | ||||||
| Tuple of time unit (str) and time axis values (np.ndarray) | ||||||
|
|
||||||
| """ | ||||||
| time_unit = self.channel[0].waveform.trace_axis | ||||||
| time_axis = self.channel[0].waveform.trace_axis() | ||||||
| return time_unit.unit, time_axis | ||||||
|
|
||||||
|
|
||||||
| class TektronixDPOData(InstrumentChannel): | ||||||
| """ | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.