diff --git a/CHANGELOG.md b/CHANGELOG.md index 4032e7c8..f776267a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/tm_devices/drivers/pi/scopes/tekscope_2k/tekscope_2k.py b/src/tm_devices/drivers/pi/scopes/tekscope_2k/tekscope_2k.py index 65c55738..c16213e9 100644 --- a/src/tm_devices/drivers/pi/scopes/tekscope_2k/tekscope_2k.py +++ b/src/tm_devices/drivers/pi/scopes/tekscope_2k/tekscope_2k.py @@ -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] = [] diff --git a/tests/sim_devices/scope/mso2kb.yaml b/tests/sim_devices/scope/mso2kb.yaml index 31ea8551..2d39467a 100644 --- a/tests/sim_devices/scope/mso2kb.yaml +++ b/tests/sim_devices/scope/mso2kb.yaml @@ -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