-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the basic usage docs and Readme (#84)
* docs: Add new examples to the basic usage guide. Also updated some package development dependencies. * docs: Added a new table showing the support levels for software solutions. Also updated the support levels for all the devices.
- Loading branch information
Showing
9 changed files
with
219 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""An example script to choose visa from different visa resources.""" | ||
from tm_devices import DeviceManager | ||
from tm_devices.helpers import PYVISA_PY_BACKEND, SYSTEM_DEFAULT_VISA_BACKEND | ||
|
||
with DeviceManager(verbose=True) as device_manager: | ||
# Explicitly specify to use the system VISA backend, this is the default, | ||
# **this code is not required** to use the system default. | ||
device_manager.visa_library = SYSTEM_DEFAULT_VISA_BACKEND | ||
# The above code can also be replaced by: | ||
device_manager.visa_library = "@ivi" | ||
|
||
# To use the PyVISA-py backend | ||
device_manager.visa_library = PYVISA_PY_BACKEND | ||
# The above code can also be replaced by: | ||
device_manager.visa_library = "@py" | ||
|
||
scope = device_manager.add_scope("127.0.0.1") | ||
print(scope) # This prints basic information of the connected scope. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"""An example script for connecting and configuring scope for acquisition.""" | ||
from tm_devices import DeviceManager | ||
from tm_devices.drivers import MSO6B | ||
from tm_devices.helpers import PYVISA_PY_BACKEND | ||
|
||
with DeviceManager(verbose=True) as device_manager: | ||
# Enable resetting the devices when connecting and closing | ||
device_manager.setup_cleanup_enabled = True | ||
device_manager.teardown_cleanup_enabled = True | ||
|
||
# Use the PyVISA-py backend | ||
device_manager.visa_library = PYVISA_PY_BACKEND | ||
|
||
# Creating Scope driver object by providing ip address. | ||
scope: MSO6B = device_manager.add_scope("127.0.0.1") # pyright: ignore[reportGeneralTypeIssues] | ||
|
||
# Make channel 1 ON | ||
scope.commands.display.waveview1.ch[1].state.write("ON") | ||
|
||
# Set channel 1 vertical scale to 10mV | ||
scope.commands.ch[1].scale.write(10e-3) | ||
|
||
# Set horizontal record length to 20000 | ||
scope.commands.horizontal.recordlength.write(20000) | ||
|
||
# Set horizontal position to 100 | ||
scope.commands.horizontal.position.write(10) | ||
|
||
# Set trigger type to Edge | ||
scope.commands.trigger.a.type.write("EDGE") | ||
|
||
# Acquisition setup | ||
scope.commands.acquire.state.write("OFF") | ||
scope.commands.acquire.mode.write("Sample") | ||
scope.commands.acquire.stopafter.write("Sequence") | ||
|
||
# Adding measurements | ||
scope.commands.measurement.addmeas.write("AMPLitude") | ||
scope.commands.measurement.addmeas.write("PK2PK") | ||
scope.commands.measurement.meas[1].source.write("CH1") | ||
scope.commands.measurement.meas[2].source.write("CH1") | ||
|
||
# Get the measurements values | ||
scope.commands.acquire.state.write("ON") | ||
|
||
if int(scope.commands.opc.query()) == 1: | ||
scope.commands.measurement.meas[1].results.currentacq.mean.query() | ||
scope.commands.measurement.meas[2].results.currentacq.maximum.query() |
51 changes: 51 additions & 0 deletions
51
examples/scopes/tekscope_70k/dpojet/adding_dpojet_measurements.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""An example of adding dpojet measurements and plots.""" | ||
|
||
from tm_devices import DeviceManager | ||
from tm_devices.drivers import MSO70KDX | ||
from tm_devices.helpers import PYVISA_PY_BACKEND | ||
|
||
with DeviceManager(verbose=True) as device_manager: | ||
# Enable resetting the devices when connecting and closing | ||
device_manager.setup_cleanup_enabled = True | ||
device_manager.teardown_cleanup_enabled = True | ||
|
||
# Use the PyVISA-py backend | ||
device_manager.visa_library = PYVISA_PY_BACKEND | ||
|
||
# Creating one 7K/70K/SX Scope driver object by providing ip address. | ||
scope: MSO70KDX = device_manager.add_scope( | ||
"127.0.0.1" | ||
) # pyright: ignore[reportGeneralTypeIssues] | ||
|
||
# Starting DPOJET | ||
scope.commands.dpojet.activate.write() | ||
scope.commands.dpojet.version.query() | ||
|
||
# CLear all measurements | ||
scope.commands.dpojet.clearallmeas.write() | ||
|
||
# Add few DPOJET measurements | ||
scope.commands.dpojet.addmeas.write("Period") | ||
scope.commands.dpojet.addmeas.write("Pduty") | ||
scope.commands.dpojet.addmeas.write("RiseTime") | ||
scope.commands.dpojet.addmeas.write("acrms") | ||
|
||
# Add few DPOJET plots for these measurements | ||
scope.commands.dpojet.addplot.write("spectrum, MEAS1") | ||
scope.commands.dpojet.addplot.write("dataarray, MEAS2") | ||
scope.commands.dpojet.addplot.write("TimeTrend, MEAS3") | ||
scope.commands.dpojet.addplot.write("histogram, MEAS4") | ||
|
||
# Start a measurement | ||
scope.commands.dpojet.state.write("single") | ||
|
||
# Get the measurement values for the current acquisition data | ||
scope.commands.dpojet.meas[1].results.currentacq.max.query() | ||
scope.commands.dpojet.meas[1].results.currentacq.population.query() | ||
|
||
# Save all plots | ||
scope.commands.dpojet.saveallplots.write() | ||
|
||
# Save the report | ||
scope.commands.dpojet.report.savewaveforms.write("1") | ||
scope.commands.dpojet.report.write("EXECUTE") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters