Skip to content

Commit

Permalink
feat: Added SourceXpress API support and AWG defects fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
v12ganesh committed Jul 31, 2024
1 parent 12f4a71 commit ea79a9f
Show file tree
Hide file tree
Showing 162 changed files with 3,589 additions and 1,594 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ Valid subsections within a version are:

Things to be included in the next release go here.

### Added

- Full Python API support for SourceXpress to AWG70KA, AWG70KB and AWG7K models.

### Fixed

- Fixed APIs with writes and queries accepting arguments for AWG70KA and AWG70KB models drivers.

---

## v2.0.0 (2024-07-24)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ _Device Support Levels_
| | **AFG31xxx** | PI || |
| AWGs | **AWG5000** | PI || |
| | **AWG5200** | PI || |
| | **AWG7000** | PI || |
| | **AWG70000** | PI || |
| | **AWG7000** | PI || |
| | **AWG70000** | PI || |
| Scopes | **2 Series MSO** | PI |||
| | **3 Series MDO** | PI || |
| | **4 Series MSO** | PI |||
Expand Down Expand Up @@ -148,6 +148,7 @@ _Software Solution Support Levels_
| Software<br>Solution | Command<br>Type | Basic<br>Control | Python API<br>Validation<br>Status |
| -------------------- | --------------- | ---------------- | ---------------------------------- |
| DPOJET | PI |||
| SourceXpress | PI |||

</div>

Expand Down
3 changes: 3 additions & 0 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ SESR
SMU
: Source Measure Unit

SourceXpress
: An application to load and play waveforms remotely for Tektronix Arbitrary Waveform Generators

SRQ
: Service Request

Expand Down
1 change: 1 addition & 0 deletions docs/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
(" TSP ", " <TSP:>"),
(" API ", " <API:>"),
(" DPOJET ", " <DPOJET:>"),
(" SourceXpress ", " <SourceXpress:>"),
(" ✅ ", " [](default:✅) "),
(" 🚧 ", " [](default:🚧) "),
(" ❌ ", " [](default:❌) "),
Expand Down
29 changes: 29 additions & 0 deletions examples/signal_generators/awgs/awg70k_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""An example script for AWG70K compiling sine waveform, name the waveform and play it."""

from tm_devices import DeviceManager
from tm_devices.drivers import AWG70KB
from tm_devices.helpers import PYVISA_PY_BACKEND

with DeviceManager(verbose=True) as device_manager:
# Disable resetting the devices when connecting and closing
device_manager.setup_cleanup_enabled = False
device_manager.teardown_cleanup_enabled = False

# Use the PyVISA-py backend
device_manager.visa_library = PYVISA_PY_BACKEND

# Creating Scope driver object by providing ip address.
scope: AWG70KB = device_manager.add_awg("127.0.0.1")

# Sets the Basic Waveform editor plug-in waveform type.
scope.commands.bwaveform.function.write("SINE")
# Sets the peak-to-peak Amplitude value for the waveform created by the Basic Waveform
# editor plug-in.
scope.commands.bwaveform.amplitude.write(250.0e-3)
# Sets the Sample Rate for the waveform created by the Basic Waveform editor plug-in.
scope.commands.bwaveform.srate.write(2.0e9)
# Sets the name of the Basic Waveform editor plug-in compiled waveform.
scope.commands.bwaveform.compile.name.write("Basic_Wfm_sine")
# Enabled the state of the Basic Waveform editor to either immediately play the waveform
# after compile or just compile
scope.commands.bwaveform.compile.play.write("ON")
27 changes: 26 additions & 1 deletion src/tm_devices/commands/awg5200_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .gen_2i1z2s_awg.bwaveform import Bwaveform
from .gen_2i1z2s_awg.clock import Clock
from .gen_2i1z2s_awg.cplayback import Cplayback
from .gen_2i1z2s_awg.diagnostic import Diagnostic
from .gen_2i1z2s_awg.fgen import Fgen
from .gen_2i1z2s_awg.instrument import Instrument
from .gen_2i1z2s_awg.mmemory import Mmemory
Expand All @@ -26,7 +27,7 @@
from .gen_2i1z2s_awg.wlist import Wlist
from .gen_3n9auv_awg.active import Active
from .gen_3n9auv_awg.calibration import Calibration
from .gen_3n9auv_awg.diagnostic import Diagnostic
from .gen_3n9auv_awg.connectivity import Connectivity
from .gen_3n9auv_awg.display import Display
from .gen_3n9auv_awg.output import Output
from .gen_3n9auv_awg.slist import Slist
Expand Down Expand Up @@ -85,6 +86,7 @@ class AWG5200Commands:
- ``.calibration``: The ``CALibration`` command tree.
- ``.clock``: The ``CLOCk`` command tree.
- ``.cls``: The ``*CLS`` command.
- ``.connectivity``: The ``CONNectivity`` command tree.
- ``.cplayback``: The ``CPLayback`` command tree.
- ``.diagnostic``: The ``DIAGnostic`` command tree.
- ``.display``: The ``DISPlay`` command tree.
Expand Down Expand Up @@ -127,6 +129,7 @@ def __init__(self, device: Optional[PIDevice] = None) -> None:
self._calibration = Calibration(device)
self._clock = Clock(device)
self._cls = Cls(device)
self._connectivity = Connectivity(device)
self._cplayback = Cplayback(device)
self._diagnostic = Diagnostic(device)
self._display = Display(device)
Expand Down Expand Up @@ -346,6 +349,25 @@ def cls(self) -> Cls:
"""
return self._cls

@property
def connectivity(self) -> Connectivity:
"""Return the ``CONNectivity`` command tree.
Usage:
- Using the ``.query()`` method will send the ``CONNectivity?`` query.
- Using the ``.verify(value)`` method will send the ``CONNectivity?`` query and raise an
AssertionError if the returned value does not match ``value``.
Sub-properties:
- ``.active``: The ``CONNectivity:ACTive`` command.
- ``.connect``: The ``CONNectivity:CONNect`` command.
- ``.disconnect``: The ``CONNectivity:DISConnect`` command.
- ``.gang``: The ``CONNectivity:GANG`` command tree.
- ``.remove``: The ``CONNectivity:REMove`` command.
- ``.status``: The ``CONNectivity:STATus`` command.
"""
return self._connectivity

@property
def cplayback(self) -> Cplayback:
"""Return the ``CPLayback`` command tree.
Expand Down Expand Up @@ -778,6 +800,8 @@ def synchronize(self) -> Synchronize:
AssertionError if the returned value does not match ``value``.
Sub-properties:
- ``.adjust``: The ``SYNChronize:ADJust`` command tree.
- ``.deskew``: The ``SYNChronize:DESKew`` command tree.
- ``.enable``: The ``SYNChronize:ENABle`` command.
- ``.type``: The ``SYNChronize:TYPE`` command.
"""
Expand Down Expand Up @@ -952,6 +976,7 @@ def commands(self) -> AWG5200Commands:
- ``.calibration``: The ``CALibration`` command tree.
- ``.clock``: The ``CLOCk`` command tree.
- ``.cls``: The ``*CLS`` command.
- ``.connectivity``: The ``CONNectivity`` command tree.
- ``.cplayback``: The ``CPLayback`` command tree.
- ``.diagnostic``: The ``DIAGnostic`` command tree.
- ``.display``: The ``DISPlay`` command tree.
Expand Down
25 changes: 24 additions & 1 deletion src/tm_devices/commands/awg70ka_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from .gen_3n9auv_awg.active import Active
from .gen_3n9auv_awg.calibration import Calibration
from .gen_3n9auv_awg.diagnostic import Diagnostic
from .gen_3n9auv_awg.connectivity import Connectivity
from .gen_3n9auv_awg.display import Display
from .gen_3n9auv_awg.output import Output
from .gen_3n9auv_awg.slist import Slist
Expand All @@ -22,6 +22,7 @@
from .gen_3rs8qy_awg.bwaveform import Bwaveform
from .gen_3rs8qy_awg.clock import Clock
from .gen_3rs8qy_awg.cplayback import Cplayback
from .gen_3rs8qy_awg.diagnostic import Diagnostic
from .gen_3rs8qy_awg.fgen import Fgen
from .gen_3rs8qy_awg.instrument import Instrument
from .gen_3rs8qy_awg.mmemory import Mmemory
Expand Down Expand Up @@ -84,6 +85,7 @@ class AWG70KACommands:
- ``.calibration``: The ``CALibration`` command tree.
- ``.clock``: The ``CLOCk`` command tree.
- ``.cls``: The ``*CLS`` command.
- ``.connectivity``: The ``CONNectivity`` command tree.
- ``.cplayback``: The ``CPLayback`` command tree.
- ``.diagnostic``: The ``DIAGnostic`` command tree.
- ``.display``: The ``DISPlay`` command tree.
Expand Down Expand Up @@ -125,6 +127,7 @@ def __init__(self, device: Optional[PIDevice] = None) -> None:
self._calibration = Calibration(device)
self._clock = Clock(device)
self._cls = Cls(device)
self._connectivity = Connectivity(device)
self._cplayback = Cplayback(device)
self._diagnostic = Diagnostic(device)
self._display = Display(device)
Expand Down Expand Up @@ -331,6 +334,25 @@ def cls(self) -> Cls:
"""
return self._cls

@property
def connectivity(self) -> Connectivity:
"""Return the ``CONNectivity`` command tree.
Usage:
- Using the ``.query()`` method will send the ``CONNectivity?`` query.
- Using the ``.verify(value)`` method will send the ``CONNectivity?`` query and raise an
AssertionError if the returned value does not match ``value``.
Sub-properties:
- ``.active``: The ``CONNectivity:ACTive`` command.
- ``.connect``: The ``CONNectivity:CONNect`` command.
- ``.disconnect``: The ``CONNectivity:DISConnect`` command.
- ``.gang``: The ``CONNectivity:GANG`` command tree.
- ``.remove``: The ``CONNectivity:REMove`` command.
- ``.status``: The ``CONNectivity:STATus`` command.
"""
return self._connectivity

@property
def cplayback(self) -> Cplayback:
"""Return the ``CPLayback`` command tree.
Expand Down Expand Up @@ -938,6 +960,7 @@ def commands(self) -> AWG70KACommands:
- ``.calibration``: The ``CALibration`` command tree.
- ``.clock``: The ``CLOCk`` command tree.
- ``.cls``: The ``*CLS`` command.
- ``.connectivity``: The ``CONNectivity`` command tree.
- ``.cplayback``: The ``CPLayback`` command tree.
- ``.diagnostic``: The ``DIAGnostic`` command tree.
- ``.display``: The ``DISPlay`` command tree.
Expand Down
25 changes: 24 additions & 1 deletion src/tm_devices/commands/awg70kb_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from .gen_3n9auv_awg.active import Active
from .gen_3n9auv_awg.calibration import Calibration
from .gen_3n9auv_awg.diagnostic import Diagnostic
from .gen_3n9auv_awg.connectivity import Connectivity
from .gen_3n9auv_awg.display import Display
from .gen_3n9auv_awg.output import Output
from .gen_3n9auv_awg.slist import Slist
Expand All @@ -22,6 +22,7 @@
from .gen_3rs8qy_awg.bwaveform import Bwaveform
from .gen_3rs8qy_awg.clock import Clock
from .gen_3rs8qy_awg.cplayback import Cplayback
from .gen_3rs8qy_awg.diagnostic import Diagnostic
from .gen_3rs8qy_awg.fgen import Fgen
from .gen_3rs8qy_awg.instrument import Instrument
from .gen_3rs8qy_awg.mmemory import Mmemory
Expand Down Expand Up @@ -84,6 +85,7 @@ class AWG70KBCommands:
- ``.calibration``: The ``CALibration`` command tree.
- ``.clock``: The ``CLOCk`` command tree.
- ``.cls``: The ``*CLS`` command.
- ``.connectivity``: The ``CONNectivity`` command tree.
- ``.cplayback``: The ``CPLayback`` command tree.
- ``.diagnostic``: The ``DIAGnostic`` command tree.
- ``.display``: The ``DISPlay`` command tree.
Expand Down Expand Up @@ -125,6 +127,7 @@ def __init__(self, device: Optional[PIDevice] = None) -> None:
self._calibration = Calibration(device)
self._clock = Clock(device)
self._cls = Cls(device)
self._connectivity = Connectivity(device)
self._cplayback = Cplayback(device)
self._diagnostic = Diagnostic(device)
self._display = Display(device)
Expand Down Expand Up @@ -331,6 +334,25 @@ def cls(self) -> Cls:
"""
return self._cls

@property
def connectivity(self) -> Connectivity:
"""Return the ``CONNectivity`` command tree.
Usage:
- Using the ``.query()`` method will send the ``CONNectivity?`` query.
- Using the ``.verify(value)`` method will send the ``CONNectivity?`` query and raise an
AssertionError if the returned value does not match ``value``.
Sub-properties:
- ``.active``: The ``CONNectivity:ACTive`` command.
- ``.connect``: The ``CONNectivity:CONNect`` command.
- ``.disconnect``: The ``CONNectivity:DISConnect`` command.
- ``.gang``: The ``CONNectivity:GANG`` command tree.
- ``.remove``: The ``CONNectivity:REMove`` command.
- ``.status``: The ``CONNectivity:STATus`` command.
"""
return self._connectivity

@property
def cplayback(self) -> Cplayback:
"""Return the ``CPLayback`` command tree.
Expand Down Expand Up @@ -938,6 +960,7 @@ def commands(self) -> AWG70KBCommands:
- ``.calibration``: The ``CALibration`` command tree.
- ``.clock``: The ``CLOCk`` command tree.
- ``.cls``: The ``*CLS`` command.
- ``.connectivity``: The ``CONNectivity`` command tree.
- ``.cplayback``: The ``CPLayback`` command tree.
- ``.diagnostic``: The ``DIAGnostic`` command tree.
- ``.display``: The ``DISPlay`` command tree.
Expand Down
33 changes: 17 additions & 16 deletions src/tm_devices/commands/dpo2k_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
from .gen_1lcv3a_msodpomdo.setup_1 import SetupItem
from .gen_1nmc1o_msodpomdo.clearmenu import Clearmenu
from .gen_1nmc1o_msodpomdo.errlog import Errlog
from .gen_1nmc1o_msodpomdo.header import Header
from .gen_1nmc1o_msodpomdo.language import Language
from .gen_1nmc1o_msodpomdo.status_and_error import Psc
from .gen_1nmc1o_msodpomdo.usbdevice import Usbdevice
from .gen_1nmc1o_msodpomdo.usbtmc import Usbtmc
from .gen_1nmc1o_msodpomdo.verbose import Verbose
from .gen_e6lgg1_lpdmsodpomdo.totaluptime import Totaluptime
from .gen_fhrp27_msodpomdodsa.curve import Curve
from .gen_fhrp27_msodpomdodsa.date import Date
Expand All @@ -37,6 +35,7 @@
from .gen_fx54ua_lpdmsodpomdodsa.evmsg import Evmsg
from .gen_fx54ua_lpdmsodpomdodsa.evqty import Evqty
from .gen_fx54ua_lpdmsodpomdodsa.factory import Factory
from .gen_fx54ua_lpdmsodpomdodsa.header import Header
from .gen_fx54ua_lpdmsodpomdodsa.id import Id
from .gen_fx54ua_lpdmsodpomdodsa.miscellaneous import Ddt, Lrn
from .gen_fx54ua_lpdmsodpomdodsa.newpass import Newpass
Expand All @@ -45,6 +44,7 @@
from .gen_fx54ua_lpdmsodpomdodsa.set import Set
from .gen_fx54ua_lpdmsodpomdodsa.status_and_error import Pud
from .gen_fx54ua_lpdmsodpomdodsa.teksecure import Teksecure
from .gen_fx54ua_lpdmsodpomdodsa.verbose import Verbose
from .gen_fx54ua_lpdmsodpomdodsa.wavfrm import Wavfrm
from .gen_fzn174_lpdmsodpomdodsa.lock import Lock
from .gen_fzn174_lpdmsodpomdodsa.unlock import Unlock
Expand Down Expand Up @@ -664,7 +664,7 @@ def alias(self) -> Alias:
SCPI Syntax:
```
- ALIas {OFF|ON|<NR1>}
- ALIas {ON|OFF|<NR1>}
- ALIas?
```
Expand Down Expand Up @@ -1484,8 +1484,10 @@ def header(self) -> Header:
"""Return the ``HEADer`` command.
Description:
- This command specifies the Response Header Enable State that causes the oscilloscope
to either include or omit headers on query responses.
- This command sets or queries the Response Header Enable State that causes the
instrument to either include or omit headers on query responses. Whether the long or
short form of header keywords and enumerations are returned is dependent upon the
state of ``:VERBose``.
Usage:
- Using the ``.query()`` method will send the ``HEADer?`` query.
Expand All @@ -1495,18 +1497,18 @@ def header(self) -> Header:
SCPI Syntax:
```
- HEADer {OFF|ON|<NR1>}
- HEADer {ON|OFF|<NR1>}
- HEADer?
```
Info:
- ``OFF`` sets the Response Header Enable State to false. This causes the oscilloscope
to omit headers on query responses, so that only the argument is returned.
- ``ON`` sets the Response Header Enable State to true. This causes the oscilloscope to
include headers on applicable query responses. You can then use the query response as
a command.
- ``<NR1>`` = 0 sets the Response Header Enable State to false; any other value sets
this state to true.
- ``OFF`` sets the Response Header Enable State to false. This causes the instrument to
omit headers on query responses, so that only the argument is returned.
- ``ON`` sets the Response Header Enable State to true. This causes the instrument to
include headers on applicable query responses. You can then use the query response as
a command.
"""
return self._header

Expand Down Expand Up @@ -2474,24 +2476,23 @@ def verbose(self) -> Verbose:
"""Return the ``VERBose`` command.
Description:
- This command specifies the Verbose state that controls the length of keywords on query
responses. Keywords can be both headers and arguments.
- This command sets or queries the Verbose state that controls the length of keywords on
query responses. Keywords can be both headers and arguments.
Usage:
- Using the ``.write(value)`` method will send the ``VERBose value`` command.
SCPI Syntax:
```
- VERBose {OFF|ON|<NR1>}
- VERBose {ON|OFF|<NR1>}
```
Info:
- ``<NR1>`` = 0 disables Verbose, any other value enables Verbose.
- ``OFF`` sets the Verbose state to false, which returns minimum-length keywords for
applicable setting queries.
- ``ON`` sets the Verbose state to true, which returns full-length keywords for
applicable setting queries.
- ``<NR1>`` a 0 returns minimum-length keywords for applicable setting queries; any
other value returns full-length keywords.
"""
return self._verbose

Expand Down
Loading

0 comments on commit ea79a9f

Please sign in to comment.