Skip to content

Commit

Permalink
fix: modified API under MSO 2,4,5,6 modules (tektronix#142)
Browse files Browse the repository at this point in the history
* fix: modified API under MSO 2,4,5,6 modules and added default buffer to SMU 26xx series.

* fix: updated the CHANGELOG.md

* fix: removed extra newline in CHANGELOG.md

Signed-off-by: Shashank P <[email protected]>

---------

Signed-off-by: Shashank P <[email protected]>
Signed-off-by: v12ganesh [email protected]
  • Loading branch information
u625355 authored Feb 8, 2024
1 parent 826d127 commit 0334639
Show file tree
Hide file tree
Showing 68 changed files with 19,811 additions and 16,504 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Things to be included in the next release go here.
- Added a step during a device reboot that will reset all the cached properties in the event that one of them changed.
- Added command API support for MSO5K, DPO5K, and DPO7K models.
- Added a custom, read-only implementation of the [`cached_property`](https://docs.python.org/3/library/functools.html#functools.cached_property) decorator.
- Added default buffer API for SMU 26xx series models.

### Changed

Expand All @@ -34,6 +35,7 @@ Things to be included in the next release go here.

- Fixed the code that detects VISA resource expressions to be able to detect SOCKET resource expressions properly.
- Fixed PI device close method to catch VisaIOErrors and throw a warning, rather than an exception, when closing a PI device connection.
- Fixed APIs with query attributes missing under MSO4, MSO5, MSO6 and MSO2 model drivers.

______________________________________________________________________

Expand Down
24 changes: 8 additions & 16 deletions src/tm_devices/commands/_1ltpwt_mdomsodpo/ch.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,8 @@ class ChannelScale(SCPICmdWrite, SCPICmdRead):
"""The ``CH<x>:SCAle`` command.
**Description:**
- This command specifies the vertical scale for the channel specified by <x>, where x is the
channel number. This setting controls the vertical size of the acquisition window as well
as the display scale. The range and resolution of scale values depends on the probe
attached and any other external factors you have specified. For a signal with constant
amplitude, increasing the scale causes the waveform to be displayed smaller. Decreasing
the scale causes the waveform to be displayed larger.
- This command sets or returns the vertical scale for the specified analog channel. The
channel is specified by x.
**Usage:**
- Using the ``.query()`` method will send the ``CH<x>:SCAle?`` query.
Expand All @@ -190,8 +186,8 @@ class ChannelScale(SCPICmdWrite, SCPICmdRead):
- CH<x>:SCAle?
**Info:**
- ``<NR3>`` is a floating point number that specifies the vertical channel scale in
units-per-division. The value entered here is truncated to three significant digits.
- ``CH<x>`` is the channel number.
- ``<NR3>`` is the vertical scale for the specified analog channel.
"""


Expand Down Expand Up @@ -1840,12 +1836,8 @@ def scale(self) -> ChannelScale:
"""Return the ``CH<x>:SCAle`` command.
**Description:**
- This command specifies the vertical scale for the channel specified by <x>, where x is
the channel number. This setting controls the vertical size of the acquisition window
as well as the display scale. The range and resolution of scale values depends on the
probe attached and any other external factors you have specified. For a signal with
constant amplitude, increasing the scale causes the waveform to be displayed smaller.
Decreasing the scale causes the waveform to be displayed larger.
- This command sets or returns the vertical scale for the specified analog channel. The
channel is specified by x.
**Usage:**
- Using the ``.query()`` method will send the ``CH<x>:SCAle?`` query.
Expand All @@ -1861,8 +1853,8 @@ def scale(self) -> ChannelScale:
- CH<x>:SCAle?
**Info:**
- ``<NR3>`` is a floating point number that specifies the vertical channel scale in
units-per-division. The value entered here is truncated to three significant digits.
- ``CH<x>`` is the channel number.
- ``<NR3>`` is the vertical scale for the specified analog channel.
"""
return self._scale

Expand Down
Empty file.
141 changes: 141 additions & 0 deletions src/tm_devices/commands/_1lwj1r_msomdodpo/rosc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
"""The rosc commands module.
These commands are used in the following models:
DPO4K, DPO4KB, MDO3, MDO3K, MDO4K, MDO4KB, MDO4KC, MSO2, MSO4K, MSO4KB
THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED.
Please report an issue if one is found.
Commands and Queries:
::
- ROSc:SOUrce {INTERnal|EXTernal}
- ROSc:SOUrce?
- ROSc:STATE?
"""
from typing import Optional, TYPE_CHECKING

from .._helpers import SCPICmdRead, SCPICmdWrite

if TYPE_CHECKING:
from tm_devices.drivers.pi.pi_device import PIDevice


class RoscState(SCPICmdRead):
"""The ``ROSc:STATE`` command.
**Description:**
- This query-only command returns whether the time base reference oscillator is locked. This
command will return either LOCKED or UNLOCKED.
**Usage:**
- Using the ``.query()`` method will send the ``ROSc:STATE?`` query.
- Using the ``.verify(value)`` method will send the ``ROSc:STATE?`` query and raise an
AssertionError if the returned value does not match ``value``.
**SCPI Syntax:**
::
- ROSc:STATE?
"""


class RoscSource(SCPICmdWrite, SCPICmdRead):
"""The ``ROSc:SOUrce`` command.
**Description:**
- This command sets or queries the selected source for the time base reference oscillator.
The reference oscillator locks to this source. Depending on the command argument that you
specify, you can use an external reference or use the internal crystal oscillator as the
time base reference.
**Usage:**
- Using the ``.query()`` method will send the ``ROSc:SOUrce?`` query.
- Using the ``.verify(value)`` method will send the ``ROSc:SOUrce?`` query and raise an
AssertionError if the returned value does not match ``value``.
- Using the ``.write(value)`` method will send the ``ROSc:SOUrce value`` command.
**SCPI Syntax:**
::
- ROSc:SOUrce {INTERnal|EXTernal}
- ROSc:SOUrce?
**Info:**
- ``INTERnal`` specifies the internal 10 MHz crystal oscillator as the time base reference.
- ``EXTernal`` specifies the user-supplied external signal as the time base reference.
"""


class Rosc(SCPICmdRead):
"""The ``ROSc`` command tree.
**Usage:**
- Using the ``.query()`` method will send the ``ROSc?`` query.
- Using the ``.verify(value)`` method will send the ``ROSc?`` query and raise an
AssertionError if the returned value does not match ``value``.
Properties:
- ``.source``: The ``ROSc:SOUrce`` command.
- ``.state``: The ``ROSc:STATE`` command.
"""

def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "ROSc") -> None:
super().__init__(device, cmd_syntax)
self._source = RoscSource(device, f"{self._cmd_syntax}:SOUrce")
self._state = RoscState(device, f"{self._cmd_syntax}:STATE")

@property
def source(self) -> RoscSource:
"""Return the ``ROSc:SOUrce`` command.
**Description:**
- This command sets or queries the selected source for the time base reference
oscillator. The reference oscillator locks to this source. Depending on the command
argument that you specify, you can use an external reference or use the internal
crystal oscillator as the time base reference.
**Usage:**
- Using the ``.query()`` method will send the ``ROSc:SOUrce?`` query.
- Using the ``.verify(value)`` method will send the ``ROSc:SOUrce?`` query and raise an
AssertionError if the returned value does not match ``value``.
- Using the ``.write(value)`` method will send the ``ROSc:SOUrce value`` command.
**SCPI Syntax:**
::
- ROSc:SOUrce {INTERnal|EXTernal}
- ROSc:SOUrce?
**Info:**
- ``INTERnal`` specifies the internal 10 MHz crystal oscillator as the time base
reference.
- ``EXTernal`` specifies the user-supplied external signal as the time base reference.
"""
return self._source

@property
def state(self) -> RoscState:
"""Return the ``ROSc:STATE`` command.
**Description:**
- This query-only command returns whether the time base reference oscillator is locked.
This command will return either LOCKED or UNLOCKED.
**Usage:**
- Using the ``.query()`` method will send the ``ROSc:STATE?`` query.
- Using the ``.verify(value)`` method will send the ``ROSc:STATE?`` query and raise an
AssertionError if the returned value does not match ``value``.
**SCPI Syntax:**
::
- ROSc:STATE?
"""
return self._state
Loading

0 comments on commit 0334639

Please sign in to comment.