Skip to content

Commit

Permalink
TekScope2K - turn on HEADER and VERBOSE options to query available da…
Browse files Browse the repository at this point in the history
…ta sources correctly (#327)

* fix(tekscope_2k.py): Added HEADER setting calls so that SELECT? functions properly

Added HEADER calls to 'get_available_data_sources' function

* feat(mso2kb.py): added support for mso2024b oscilloscope

Added driver functions for MSO2KB series oscilloscope. Added "curve_query", "all_channel_names_list", "turn_channel_on/off", and "total_channels" functions, and added model ID 0x03A4 to supported models list

* fix(tekscope_2k): Added HEADER and VERBOSE setting calls so that SELECT? functions properly

If the MSO2K scope is not in HEADER and VERBOSE mode when SELECT? is called to determine the number of active channels, the channel names will not be read properly

* docs(test_scopes.py): Removed unnecessary comments

* fix(tekscope_2k.py): Queries previous HEADER state before SELECT? and returns to original state

* Update CHANGELOG.md

Co-authored-by: Nicholas Felt <[email protected]>
Signed-off-by: Joe <[email protected]>

* Update src/tm_devices/drivers/pi/scopes/tekscope_2k/tekscope_2k.py

Co-authored-by: Nicholas Felt <[email protected]>
Signed-off-by: Joe <[email protected]>

* docs(CHANGELOG.md): Added CR to CHANGELOG.md

* refactor(CHANGELOG): Fixed pre-commit-config merge issue and CHANGELOG corrected

---------

Signed-off-by: Joe <[email protected]>
Co-authored-by: Nicholas Felt <[email protected]>
  • Loading branch information
RoaCode and nfelt14 authored Oct 24, 2024
1 parent f20bbdd commit 81503b7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
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.
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

0 comments on commit 81503b7

Please sign in to comment.