Skip to content
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

TekScope2K - turn on HEADER and VERBOSE options to query available data sources correctly #327

Merged
merged 9 commits into from
Oct 24, 2024
4 changes: 4 additions & 0 deletions CHANGELOG.md
RoaCode marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Valid subsections within a version are:

Things to be included in the next release go here.

### Fixed

- fix: TekScope2K active channel query needs HEADER options enabled to function properly

### Added

- `collectgarbage()` is now called during cleanup of `TSPDevice` children.
RoaCode marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
4 changes: 4 additions & 0 deletions src/tm_devices/drivers/pi/scopes/tekscope_2k/tekscope_2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def get_available_data_sources(self) -> List[str]:
Returns:
The list of available data sources as strings.
"""
previous_header_state = self.query("HEADER?").split(" ")[-1] # Read previous header state
self.write("HEADER 1") # Turn on header state so SELECT query works correctly
source_string = self.query("SELECT?")
self.write(f"HEADER {previous_header_state}") # Return header state back to original

source_string = source_string.split(":")[-1] # Remove :SELECT: from beginning
source_list = source_string.split(";")
available_source_list: List[str] = []
Expand Down
11 changes: 9 additions & 2 deletions tests/sim_devices/scope/mso2kb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,17 @@ devices:
verbosity:
default: 0
getter:
q: :VERBose?
q: VERBOSE?
r: '{:s}'
setter:
q: :VERBose {:s}
q: VERBOSE {:s}
header:
default: 0
getter:
q: HEADER?
r: '{:s}'
setter:
q: HEADER {:s}
channel_select:
default: :SELECT:BUS1 0;BUS2 0;CH1 1;CH2 0;CH3 0;CH4 0;MATH 0;REF1 0;REF2
0;D0 1;D1 0;D2 0;D3 0;D4 0;D5 0;D6 0;D7 0;D8 0;D9 0;D10 0;D11 0;D12 0;D13
Expand Down
Loading