### Setup tm-devices for Local Development (Manual) Source: https://tm-devices.readthedocs.io/stable/CONTRIBUTING Manually sets up a virtual environment and installs project dependencies using pip and Poetry. This method provides more granular control over the setup process. ```bash python -m venv .env # Linux source .venv/bin/activate # Windows .venv\Scripts\activate.bat python -m pip install -U pip poetry poetry install pre-commit install ``` -------------------------------- ### Setup tm-devices for Local Development (Script) Source: https://tm-devices.readthedocs.io/stable/CONTRIBUTING This script automates the setup of the tm-devices project for local development. It handles virtual environment creation and dependency installation using Poetry. ```bash python scripts/contributor_setup.py ``` -------------------------------- ### SETUP: Configure Setup Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/mso2k_commands Allows configuration and querying of specific setup items identified by an index ``. This includes setting the date, label, and time for a setup. ```APIDOC ## POST /setup/{index} ### Description Configures specific setup items (date, label, time) for a given setup index. ### Method POST ### Endpoint /setup/{index} ### Parameters #### Path Parameters - **index** (int) - Required - The index of the setup item to configure (e.g., 1, 2, ...). #### Request Body - **date** (string) - Optional - The date for the setup in `YYYY-MM-DD` format. - **label** (string) - Optional - A label for the setup. - **time** (string) - Optional - The time for the setup in `HH:MM:SS` format. ### Request Example ```json { "date": "2023-10-27", "label": "My Setup 1" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Setup item 1 updated successfully." } ``` ## GET /setup/{index} ### Description Queries the details of a specific setup item identified by its index. ### Method GET ### Endpoint /setup/{index} ### Parameters #### Path Parameters - **index** (int) - Required - The index of the setup item to query (e.g., 1, 2, ...). ### Request Example None ### Response #### Success Response (200) - **date** (string) - The date of the setup. - **label** (string) - The label of the setup. - **time** (string) - The time of the setup. #### Response Example ```json { "date": "2023-10-27", "label": "My Setup 1", "time": "14:30:00" } ``` ``` -------------------------------- ### Setup Commands Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/dsa70kd_commands Provides commands for managing instrument setups, including saving and recalling named setups. ```APIDOC ## SETUP Commands ### Description Provides commands for managing instrument setups, including saving and recalling named setups. ### Usage - Using the `.query()` method will send the `SETUp?` query. - Using the `.verify(value)` method will send the `SETUp?` query and raise an AssertionError if the returned value does not match `value`. ### Sub-properties - `.name`: The `SETUp:NAMe` command. ``` -------------------------------- ### Setup Item Commands Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_61rg18_dpomdomso/setup_1 This section details the commands related to the SetupItem, which represents the SETUP command tree. It allows querying and verifying setup information. ```APIDOC ## SETUP ### Description The `SETUP` command tree allows interaction with oscilloscope setup configurations. ### Method GET, POST ### Endpoint /SETUP ### Parameters #### Path Parameters - **x** (integer) - Required - The setup channel number (1-10). #### Query Parameters None #### Request Body None ### Request Example ```json { "command": "SETUP1?" } ``` ### Response #### Success Response (200) - **data** (string) - The queried setup information. #### Response Example ```json { "data": "Example Setup Data" } ``` ``` -------------------------------- ### Format for New Troubleshooting Entries Source: https://tm-devices.readthedocs.io/stable/troubleshooting/usage Demonstrates the required format for adding new entries to troubleshooting guides. It includes sections for issue summary, problem description, and solution, with placeholders for code examples. ```markdown ______________________________________________________________________ ## Example Issue Summary This is an example issue to use for formatting new troubleshooting entries. ### Problem: Explain the problem. ``` Use code if applicable. ``` ### Solution: Explain the solution. ``` Use code if applicable. ``` ``` -------------------------------- ### SETUP Command Tree Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/mso5kb_commands Provides access to commands for managing instrument setups. Use `.query()` or `.verify(value)`. ```APIDOC ## SETUP Command Tree ### Description Manages instrument setup configurations. ### Method GET (for queries) ### Endpoint SCPI ### Parameters None ### Request Example ```python # Example using a hypothetical client library client.setup.query() client.setup.name.query() ``` ### Response #### Success Response (200) Returns information related to the instrument setup. #### Response Example ```json { "setup_info": "Current setup details" } ``` ### Sub-properties - `.name`: Accesses the `SETUp:NAMe` command. ``` -------------------------------- ### Setup API Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/ss3706a_commands Manage device setup configurations, including power-on states and recalling/saving settings. ```APIDOC ## Setup API ### Description This API allows for the management of device setup configurations. You can control power-on states and save or recall specific setup profiles. ### Endpoints #### Setup Properties - `setup` (property): Access to setup functionalities. - `.poweron`: Controls the power-on state of the device. - `.recall()`: Recalls a saved setup configuration. - `.save()`: Saves the current setup configuration. ``` -------------------------------- ### Python Setup Commands for SMU Instruments Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_ftsc04_smu/setup_1 This Python code snippet demonstrates how to interact with the setup commands for SMU instruments. It includes accessing the power-on setting, recalling a setup by ID, and saving the current setup. Dependencies include the tm_devices library and potentially device connection objects. ```python from tm_devices.commands import SMU2601B # Assuming 'smu' is an initialized device object, e.g., SMU2601B(visa_address='TCPIP0::192.168.1.100::INSTR') # Accessing the power-on setup attribute print(f"Power-on setup: {smu.setup.poweron}") # Setting the power-on setup smu.setup.poweron = "default_setup" # Recalling a saved setup by ID smu.setup.recall(id_='1') # Saving the current setup to a specific ID smu.setup.save(id_=5) ``` -------------------------------- ### Setup Property API Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/smu2612b_commands Manages device setup configurations, including power states and saving/recalling settings. ```APIDOC ## Setup Property API ### Description Manage device setup configurations, including power control and saving/recalling settings. ### Method GET (for retrieving settings), POST/PUT (for setting properties), POST (for recall/save functions) ### Endpoint `/devices/setup` (hypothetical endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * `poweron` (boolean) - Optional - Set to true to turn the device power on. * `recall` (object) - Optional - Parameters for recalling setup configuration. * `save` (object) - Optional - Parameters for saving setup configuration. ### Request Example ```json { "poweron": true } ``` ### Response #### Success Response (200) * `setup` (object) - Contains the current setup status. * `poweron` (boolean) - The current power status of the device. * `recall_status` (string) - The status of a `recall()` operation. * `save_status` (string) - The status of a `save()` operation. #### Response Example ```json { "setup": { "poweron": true }, "save_status": "success" } ``` ``` -------------------------------- ### Installed Options Query Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/mso70kdx_commands Query the installed options on the device. ```APIDOC ## *OPT Query ### Description This query-only command returns a comma-separated list of installed options as an arbitrary ASCII string. The format is `:`. If no options are found, 'NONE' is returned. ### Method GET ### Endpoint `/*OPT` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **options** (string) - A comma-separated list of installed options (e.g., 'OPT1:Option One,OPT2:Option Two'). #### Response Example ```json { "example": "*OPT: \"OPT1:Option One,OPT2:Option Two\"" } ``` ### SCPI Syntax ``` - *OPT? ``` ``` -------------------------------- ### AWGControl:SREStore Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_chhuo_awg/awgcontrol Opens a setup file into the AWG’s setup memory. ```APIDOC ## POST /AWGControl/SREStore ### Description Opens a setup file into the AWG’s setup memory. ### Method POST ### Endpoint /AWGControl/SREStore ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **filepath** (string) - Required - The path to the setup file to be restored. - **msus** (string) - Optional - The mass storage unit specifier. ### Request Example ```json { "command": "AWGControl:SREStore", "parameters": { "filepath": "C:\\Setups\\MySetup.awg", "msus": "MSUS0" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure of the command execution. #### Response Example ```json { "status": "Success" } ``` ``` -------------------------------- ### TSP Syntax for Setup Commands Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_ftsc04_smu/setup_1 This section provides the raw TSP (Test Script Processor) syntax for interacting with the setup commands on compatible instruments. It covers the direct commands for setting and printing the power-on configuration, recalling a setup, and saving a setup. ```tsp // TSP Syntax for setup.poweron setup.poweron = value print(setup.poweron) // TSP Syntax for setup.recall setup.recall(id_) // TSP Syntax for setup.save setup.save(id_) ``` -------------------------------- ### TOML Configuration for TM Devices Source: https://tm-devices.readthedocs.io/stable/configuration Example TOML configuration for defining devices and options. It shows how to set up a SERIAL connection with specific serial configurations and a REST_API connection for a Margin Tester. Options for setup, cleanup, and logging are also demonstrated. ```toml # SERIAL (aka ASRL) connection using serial COM1 [[devices]] address = "1" alias = "my_smu_serial" connection_type = "SERIAL" device_type = "SMU" # serial_config data defines parameters specific to serial communication protocol [devices.serial_config] baud_rate = 9600 data_bits = 8 end_input = "none" flow_control = "xon_xoff" parity = "none" # REST_API connection to Margin Tester [[devices]] address = "TMT4-200015" alias = "my_mt" connection_type = "REST_API" device_type = "MT" device_driver = "TMT4" lan_port = 5000 [options] setup_cleanup = true teardown_cleanup = true disable_command_verification = true standalone = false verbose_mode = false verbose_visa = false retry_visa_connection = false default_visa_timeout = 10000 # 10 second default VISA timeout check_for_updates = false log_console_level = "NONE" # completely disable console output log_file_level = "DEBUG" log_file_directory = "./logs" log_file_name = "custom_logfile.log" # customize the log file name log_colored_output = false log_pyvisa_messages = true # log PyVISA messages in the log file log_uncaught_exceptions = true ``` -------------------------------- ### MMEMory:OPEN:SETup Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_60bjc_awg/mmemory Restores a setup file from the device's memory. Supports the native setup file format (.AWGX). ```APIDOC ## MMEMory:OPEN:SETup ### Description Restores a setup configuration from a specified file path. The supported file format is the native setup format (.AWGX). ### Method WRITE ### Endpoint /MMEMory/OPEN/SETup ### Parameters #### Request Body - **filepath** (string) - Required - The path to the setup file to be restored. ### Request Example ```json { "write": "MMEMory:OPEN:SETup \"C:\\SetupFiles\\MySetup.AWGX\"" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "OK" } ``` ``` -------------------------------- ### Query Installed Options Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/mso70kdx_commands Retrieves a comma-separated list of installed instrument options. Each option is formatted as ':' followed by the license type. If no options are installed, it returns 'NONE'. ```python installed_options = instrument.opt.query() print(installed_options) # Verify a specific set of options instrument.opt.verify('OPT1:OptionOne-LicenseType1,OPT2:OptionTwo-LicenseType2') ``` -------------------------------- ### Formatting New Troubleshooting Entries Source: https://tm-devices.readthedocs.io/stable/troubleshooting/contributions Demonstrates the standard format for adding new entries to the troubleshooting guide. It emphasizes using dashed lines for visual separation and includes sections for summarizing the issue, detailing the problem with code examples, and providing a clear solution, also with code examples if applicable. ```markdown ______________________________________________________________________ ## Example Issue Summary This is an example issue to use for formatting new troubleshooting entries. ### Problem: Explain the problem. ``` Use code if applicable. ``` ### Solution: Explain the solution. ``` Use code if applicable. ``` ``` -------------------------------- ### SYSTem:SETup Command Usage (Python) Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_8jb5gq_dpodsamso/system Demonstrates how to use the SYSTem:SETup command in Python to configure and query oscilloscope setup data. This command interacts with the oscilloscope's data block, which is a compressed zip file. It supports writing a data block and querying the current setup. ```python from tm_devices.drivers.device.commands.system import SystemSetup # Assuming 'device' is an instance of a connected oscilloscope # For setup property: setup_command = SystemSetup(device, "SYSTem:SETup") # Write a setup (replace with actual data block) # setup_command.write("") # Query the current setup current_setup = setup_command.query() print(f"Current setup: {current_setup}") # Verify the setup # try: # setup_command.verify("") # except AssertionError: # print("Setup verification failed.") ``` -------------------------------- ### Query Immediate Measurement Setup Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_5wj7x6_dpomdomso/measurement This snippet shows how to query all immediate measurement setup parameters. It uses the '.query()' method to send 'MEASUrement:IMMed?'. The returned value contains various setup details. ```python device.measurement.immed.query() # Sends: MEASUrement:IMMed? ``` -------------------------------- ### Environment Variables for Runtime Configuration Source: https://tm-devices.readthedocs.io/stable/configuration Examples of setting runtime configurations using environment variables TM_OPTIONS and TM_DEVICES. These variables override the TOML configuration file and are useful for dynamic setups. They support various device types, connection methods, and option settings. ```bash # Sample SMU using IP address and PyVISA-py TM_OPTIONS = "STANDALONE" TM_DEVICES = "address=123.45.67.255,device_type=SMU" # Sample scope using hostname and AFG using IP address with cleanup and a non-standard default VISA timeout TM_OPTIONS = "SETUP_CLEANUP,TEARDOWN_CLEANUP,DEFAULT_VISA_TIMEOUT=10000" TM_DEVICES = "address=MDO9876-C543210,device_type=SCOPE~~~address=123.45.67.255,device_type=AFG" # Sample scope using IP address and AWG using hostname TM_DEVICES = "address=123.45.67.255,device_type=SCOPE~~~address=AWG9876-C543210,device_type=AWG" # Sample scope using IP address and port for socket connection TM_DEVICES = "address=123.45.67.255,connection_type=SOCKET,device_type=SCOPE,lan_port=4000" # Sample scope using USBTMC with an alias TM_DEVICES = "address=MSO58-300026,alias=my-alias,connection_type=USB,device_type=SCOPE" # Sample Margin Tester using IP address TM_DEVICES = "address=123.45.6.789,connection_type=REST_API,device_type=MT,device_driver=TMT4" ``` -------------------------------- ### Execute Sequence Setup Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_7n037o_lpdmso/power Executes the sequence setup for a specified power module. ```APIDOC ## POST /websites/tm-devices_readthedocs_io_stable/POWer:POWer:SEQSETup:Execute ### Description Executes the sequence setup for a specified power module. ### Method POST ### Endpoint `/websites/tm-devices_readthedocs_io_stable/POWer:POWer:SEQSETup:Execute` ### Parameters #### Query Parameters - **POWer** (integer) - Required - The power module identifier (e.g., 1). ### Response #### Success Response (200) - **status** (string) - Indicates the execution status of the sequence setup. ``` -------------------------------- ### Query Installed Options Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/dpo5k_commands Retrieves a comma-separated list of installed options and their descriptions. Returns 'NONE' if no options are found. ```python opt: Opt # Return the `*OPT` command. # Description: # * This query-only command returns a comma separated list of installed options as an arbitrary ASCII string (no quotes) of the form: `:`,`:`… The last section of each entry (the text following the last hyphen) indicates the license type. If no options are found, NONE is returned. # Usage: # * Using the `.query()` method will send the `*OPT?` query. # * Using the `.verify(value)` method will send the `*OPT?` query and raise an AssertionError if the returned value does not match `value`. # SCPI Syntax: # - *OPT? ``` -------------------------------- ### LINKTRaining:SETUP Command Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_1nfb7e_dpo/linktraining Saves or restores the current Link Training setup configuration. This allows for quick recall of frequently used settings. ```APIDOC ## LINKTRaining:SETUP Command ### Description Saves or restores the current Link Training setup configuration. Use `SAVe` to store the current settings and `RESTore` to recall a previously saved setup. ### Method GET, POST ### Endpoint /LINKTRaining:SETUP ### Parameters #### Query Parameters * **action** (string) - Optional - The action to perform: `SAVe` or `RESTore`. #### Request Body * **action** (string) - Required - The action to perform: `SAVe` or `RESTore`. ### Request Example ```json { "method": "POST", "path": "/LINKTRaining:SETUP", "body": { "action": "SAVe" } } ``` ### Response #### Success Response (200) * **status** (string) - Indicates the success of the operation (e.g., "Setup saved", "Setup restored"). #### Response Example ```json { "status": "Setup saved" } ``` ``` -------------------------------- ### Save Setup Command Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_7n037o_lpdmso/save Saves the current instrument setup to a file. The argument specifies the file path and name. The `INCLUDEREFs` sub-property can be used to include references in the saved setup. ```python # SAVe:SETUp # SAVe:SETUp:INCLUDEREFs {ON|OFF|1|0} # SAVe:SETUp:INCLUDEREFs? # Properties # * .setup: The SAVe:SETUp command. # Sub-properties # * .include_refs: The SAVe:SETUp:INCLUDEREFs command. ``` -------------------------------- ### Setup Label Commands Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_61rg18_dpomdomso/setup_1 API endpoints for setting and retrieving the label for an oscilloscope setup on a specific channel. ```APIDOC ## SETUP:LABEL ### Description Specifies the setup label for the specified channel. Labels are alphanumeric strings enclosed in quotes, limited to 30 characters. ### Method POST ### Endpoint /SETUP:LABEL ### Parameters #### Path Parameters - **x** (integer) - Required - The setup channel number (1-10). #### Query Parameters None #### Request Body - **label** (string) - Required - The setup label (max 30 characters). ### Request Example ```json { "command": "SETUP1:LABEL \"My_First_Setup\"" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure of the operation. #### Response Example ```json { "status": "Success" } ``` ``` -------------------------------- ### RECAll:SETUp Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_7iy04z_dpolpdmso/recall Recalls stored or factory settings to the instrument. This command performs the same function as selecting Recall from the File menu, and then choosing the Setup button. ```APIDOC ## POST /recall/setup ### Description Recalls stored or factory settings to the instrument. This command performs the same function as selecting Recall from the File menu, and then choosing the Setup button. ### Method POST ### Endpoint /recall/setup ### Parameters #### Query Parameters - **value** (string) - Required - Specifies either 'FACtory' for factory settings or a file path to a setup file. ### Request Example ```json { "value": "FACtory" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates the setup recall operation was successful. #### Response Example ```json { "message": "Setup recalled successfully." } ``` ``` -------------------------------- ### GET /HIStogram:STARt? Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_5wj7x6_dpomdomso/histogram Queries the start point of the histogram. ```APIDOC ## GET /HIStogram:STARt? ### Description Queries the start point value of the histogram's data range. ### Method GET ### Endpoint /HIStogram:STARt? ### Parameters None ### Request Example None ### Response #### Success Response (200) - **(number)** - The start point value of the histogram. #### Response Example ``` 10 ``` ``` -------------------------------- ### GET /DATa:STARt Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_5xwdt0_dpomdomso/data Queries the current starting data point for waveform transfer. ```APIDOC ## GET /DATa:STARt ### Description Queries the current starting data point for waveform transfer. ### Method GET ### Endpoint /DATa:STARt? ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **start_point** (integer) - The current starting data point for waveform transfer. #### Response Example ```json { "start_point": 100 } ``` ``` -------------------------------- ### GET /TRIGGER:A:SETHold:SETTime Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_60a2g6_dpomdomso/trigger Queries the setup time for setup and hold violation triggering. ```APIDOC ## GET /TRIGGER:A:SETHold:SETTime ### Description Queries the setup time for setup and hold violation triggering. ### Method GET ### Endpoint /TRIGGER:A:SETHold:SETTime ### Parameters ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **description** (string) - This command specifies the setup time for setup and hold violation triggering. #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### GET /TRIGGER:A:SETHold Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_60a2g6_dpomdomso/trigger Queries the clock edge polarity, voltage threshold and source input; data voltage threshold and source; and both setup and hold times for setup and hold violation triggering. ```APIDOC ## GET /TRIGGER:A:SETHold ### Description Queries the clock edge polarity, voltage threshold and source input; data voltage threshold and source; and both setup and hold times for setup and hold violation triggering. ### Method GET ### Endpoint /TRIGGER:A:SETHold ### Parameters ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **description** (string) - Returns the clock edge polarity, voltage threshold and source input; data voltage threshold and source; and both setup and hold times for setup and hold violation triggering. #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### createconfigscript() Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/ss3706a_commands Creates a setup file that captures most of the present settings of the instrument. ```APIDOC ## createconfigscript() ### Description This function creates a setup file that captures most of the present settings of the instrument. ### Method POST ### Endpoint /commands/createconfigscript ### Parameters #### Query Parameters - **script_name** (str) - Required - The name of the script that will be created. ### Request Example ```json { "script_name": "my_setup_script" } ``` ### Response #### Success Response (200) - **message** (str) - Confirmation message that the script was created. #### Response Example ```json { "message": "Configuration script 'my_setup_script' created successfully." } ``` ### Error Handling - **NoDeviceProvidedError**: Indicates that no device connection exists. ``` -------------------------------- ### GET /TRIGGER:A:SETHold:THReshold Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_60a2g6_dpomdomso/trigger Queries the threshold settings for setup and hold triggering. ```APIDOC ## GET /TRIGGER:A:SETHold:THReshold ### Description Queries the threshold settings for setup and hold triggering. ### Method GET ### Endpoint /TRIGGER:A:SETHold:THReshold ### Parameters ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **description** (string) - Returns the threshold settings for setup and hold triggering. #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### GET /AUXout Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_8jb5gq_dpodsamso/auxout Queries the current auxiliary output setup. This is equivalent to viewing the AUX OUT Configuration in the Utilities menu. ```APIDOC ## GET /AUXout ### Description Queries the current auxiliary output setup. This is equivalent to viewing the AUX OUT Configuration in the Utilities menu. ### Method GET ### Endpoint /AUXout? ### Parameters #### Query Parameters None #### Request Body None ### Request Example ``` "" ``` ### Response #### Success Response (200) - **data** (string) - The current auxiliary output configuration. #### Response Example ```json { "data": "[Current Configuration]" } ``` ``` -------------------------------- ### GET /TRIGGER:A:SETHold:HOLDTime Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_60a2g6_dpomdomso/trigger Queries the hold time for setup and hold violation triggering. ```APIDOC ## GET /TRIGGER:A:SETHold:HOLDTime ### Description Queries the hold time for setup and hold violation triggering. ### Method GET ### Endpoint /TRIGGER:A:SETHold:HOLDTime ### Parameters ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **description** (string) - This command specifies the hold time for setup and hold violation triggering. #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### GET /TRIGGER:A:SETHold:THReshold:D Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_60a2g6_dpomdomso/trigger Queries the data-specific voltage threshold for setup and hold triggering. ```APIDOC ## GET /TRIGGER:A:SETHold:THReshold:D ### Description Queries the data-specific voltage threshold for setup and hold triggering. ### Method GET ### Endpoint /TRIGGER:A:SETHold:THReshold:D ### Parameters #### Path Parameters - **x** (integer) - Required - The data index. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **description** (string) - Returns the data-specific voltage threshold for setup and hold triggering. #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### Python Setup Commands for TM Devices Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_g3p49f_ss/setup_1 Provides Python wrappers for interacting with the setup commands of TM devices, specifically the SS3706A model. These commands allow users to control power-on behavior, recall saved instrument states, and save the current configuration. Dependencies include the 'tm_devices' library and potentially error handling for device connections. ```python # `` setup_1 ¶ # The setup_1 commands module. # These commands are used in the following models: SS3706A # THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. # Please report an issue if one is found. # Attributes and Functions # - setup.poweron # - setup.recall() # - setup.save() ## `` Setup ¶ # Bases: `BaseTSPCmd` # The `setup` command tree. # Properties and methods # * `.poweron`: The `setup.poweron` attribute. # * `.recall()`: The `setup.recall()` function. # * `.save()`: The `setup.save()` function. ### `` poweron `property` `writable` ¶ # ``` # poweron: str # # ``` # Access the `setup.poweron` attribute. # Description # * This attribute specifies which saved setup to recall when the instrument is turned on. # Usage # * Accessing this property will send the `print(setup.poweron)` query. # * Setting this property to a value will send the `setup.poweron = value` command. # TSP Syntax # ``` # - setup.poweron = value # - print(setup.poweron) # ``` # Raises: | # * `NoDeviceProvidedError` – Indicates that no device connection exists. ---|--- ### `` recall ¶ # ``` # recall(id_: str) -> None # # ``` # Run the `setup.recall()` function. # Description # * This function recalls settings from a saved setup. # TSP Syntax # ``` # - setup.recall() # ``` # Parameters: | # * **`id_`**(`str`) – An integer or string that specifies the location of the setup to recall. ---|--- # Raises: | # * `NoDeviceProvidedError` – Indicates that no device connection exists. ---|--- ### `` save ¶ # ``` # save(id_: Optional[str] = None) -> None # # ``` # Run the `setup.save()` function. # Description # * This function saves the present setup as a user-saved setup. # TSP Syntax # ``` # - setup.save() # ``` # Parameters: | # * **`id_`**(`optional` , default: `None` ) – A string that specifies the path and file name to which to save the user setup on a USB flash drive (‘/path/filename’). ---|--- # Raises: | # * `NoDeviceProvidedError` – Indicates that no device connection exists. ---|--- ``` -------------------------------- ### Build Documentation with Tox Source: https://tm-devices.readthedocs.io/stable/CONTRIBUTING Builds the project's documentation using Tox. This command generates the documentation files, which can then be served locally for preview. ```bash tox -e docs ``` -------------------------------- ### GET /TRIGGER:A:SETHold:DATa Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_60a2g6_dpomdomso/trigger Queries the voltage threshold and data source for the setup and hold trigger. ```APIDOC ## GET /TRIGGER:A:SETHold:DATa ### Description Queries the voltage threshold and data source for the setup and hold trigger. ### Method GET ### Endpoint /TRIGGER:A:SETHold:DATa ### Parameters ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **description** (string) - Returns the voltage threshold and data source for the setup and hold trigger. #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### GET /TRIGGER:A:SETHold:THReshold:CH Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_60a2g6_dpomdomso/trigger Queries the channel-specific voltage threshold for setup and hold triggering. ```APIDOC ## GET /TRIGGER:A:SETHold:THReshold:CH ### Description Queries the channel-specific voltage threshold for setup and hold triggering. ### Method GET ### Endpoint /TRIGGER:A:SETHold:THReshold:CH ### Parameters #### Path Parameters - **x** (integer) - Required - The channel number. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **description** (string) - Returns the channel-specific voltage threshold for setup and hold triggering. #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### GET /TRIGGER:A:SETHold:CLOCk Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_60a2g6_dpomdomso/trigger Queries the clock edge polarity, voltage threshold, and source input for setup and hold triggering. ```APIDOC ## GET /TRIGGER:A:SETHold:CLOCk ### Description Queries the clock edge polarity, voltage threshold, and source input for setup and hold triggering. ### Method GET ### Endpoint /TRIGGER:A:SETHold:CLOCk ### Parameters ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **description** (string) - Returns the clock edge polarity, voltage threshold, and source input for setup and hold triggering. #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### Installed Options Command (*OPT) Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/afg3k_commands The *OPT? query returns a comma-separated list of installed options, including their codes and descriptions. If no options are found, 'NONE' is returned. ```APIDOC ## *OPT Command ### Description Query-only command that returns a comma-separated list of installed options in the format `:`. The last section of each entry indicates the license type. Returns 'NONE' if no options are found. ### Method - `query()`: Sends the `*OPT?` query. - `verify(value)`: Sends the `*OPT?` query and raises an AssertionError if the returned value does not match `value`. ### SCPI Syntax ``` *OPT? ``` ``` -------------------------------- ### Get Device Series (Python) Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/drivers/power_supplies/psu22xx/psu2200 Returns the series name of the device as a string. This is a cached property. Examples include MSO5, TSOVu, TEKSCOPE, AFG3K, AWG5200. ```python series: str Return the series of the device. Returns: | * `str` – The series of the device, e.g. MSO5, TSOVu, TEKSCOPE, AFG3K, AWG5200 ---|--- ``` -------------------------------- ### Recall Setup/Waveform (RECAll) Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/dpo2kb_commands Returns the RECAll command tree, allowing queries and verification of setup and waveform recall states. ```APIDOC ## RECAll - Recall Command Tree ### Description Returns the `RECAll` command tree, which allows querying and verifying recall states for setup and waveform. ### Method - `.query()`: Sends the `RECAll?` query. - `.verify(value)`: Sends the `RECAll?` query and asserts that the returned value matches the provided `value`. ### Sub-properties - `.setup`: Accesses the `RECAll:SETUp` command. - `.waveform`: Accesses the `RECAll:WAVEform` command. ### SCPI Syntax - `RECAll?` ### Parameters #### Query Parameters (for .query and .verify methods) None ### Request Example ```json { "example": "recall.query()" } ``` ### Response #### Success Response (200 for query/verify) - **data** (string) - The recall status or data. #### Response Example ```json { "example": "SETUP" } ``` ``` -------------------------------- ### Set and Get Positive Full-Scale Current Range (TSP) Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_ehslfy_smu/smux This snippet shows how to set and get the positive full-scale value of the measurement range for current (in amperes) using the smuX.measure.rangei attribute. It's used for defining the upper limit of the current measurement range. The code includes examples for both setting and retrieving the range value. ```TSP - smuX.measure.rangei = value - print(smuX.measure.rangei) ``` -------------------------------- ### Setting up a Virtual Environment and Installing Dependencies Source: https://tm-devices.readthedocs.io/stable/troubleshooting/usage Provides commands for setting up a Python virtual environment and installing necessary packages, including tm_devices, PyInstaller, and a specific version of tomli, crucial for PyInstaller compatibility. ```bash python -m venv .venv .venv\Scripts\activate # Windows # or source .venv/bin/activate # Linux/Mac pip install tm_devices pyinstaller tomli==2.0.1 ``` -------------------------------- ### Get Bit Field (Python) Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_3skc3w_mp/bit Extracts a field of bits from a string value starting at a specified index with a given width. Requires a device connection and returns the field as a string. The index is one-based. ```python bit.getfield(value: str, index: int, width: int) -> str ``` -------------------------------- ### SCPI SYSTem:SETup Syntax Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_8jb5gq_dpodsamso/system Provides the raw SCPI (Standard Commands for Programmable Instruments) syntax for the SYSTem:SETup command. This command is used to configure the oscilloscope's data block, which contains a compressed zip file representing the current setup. The query form retrieves this data block. ```scpi SYSTem:SETup SYSTem:SETup? ``` -------------------------------- ### Create instrument configuration script Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/smu2450_commands Creates a setup file that captures most of the present settings of the instrument. It takes the desired script name as a string argument. ```python createconfigscript(script_name: str) -> None Run the `createconfigscript()` function. This function creates a setup file that captures most of the present settings of the instrument. TSP Syntax - createconfigscript() Parameters: * `script_name`(`str`) – A string that represents the name of the script to be created. Raises: * `NoDeviceProvidedError` – Indicates that no device connection exists. ``` -------------------------------- ### Get Buffer Statistics (Python) Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_amjcgz_smu/buffer Retrieves statistics from a specified reading buffer. It supports optional parameters for buffer name, relative start time, and relative end time. Returns a dictionary containing the statistics. ```python def getstats( buffer_var: Optional[str] = None, rel_start_time: Optional[str] = None, rel_end_time: Optional[str] = None, ) -> Dict[Any, Any]: """Run the buffer.getstats() function.""" pass ``` -------------------------------- ### Python: Get Device Series Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/drivers/digital_multimeters/dmm75xx/dmm75xx Returns the cached series name of the device. This property is evaluated once and its value is cached. Example series: MSO5, TSOVu, TEKSCOPE, AFG3K, AWG5200. ```python series: str # Return the series of the device. ``` -------------------------------- ### Serve Documentation Locally (MkDocs) Source: https://tm-devices.readthedocs.io/stable/CONTRIBUTING Serves the built documentation locally using MkDocs. This command allows for previewing documentation changes in real-time. ```bash mkdocs serve --clean --no-livereload ``` -------------------------------- ### GET /curve Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/lpd6_commands Retrieves waveform data from the instrument. This command transfers waveform data along with a preamble containing format and scale information. The data source, start, and stop points can be configured using related commands. ```APIDOC ## GET /curve ### Description Retrieves waveform data from the instrument. This command transfers waveform data along with a preamble containing format and scale information. The data source, start, and stop points can be configured using related commands. ### Method GET ### Endpoint /curve ### Parameters #### Query Parameters - **DATA:SOUrce** (string) - Optional - Specifies the data source for the waveform transfer. - **DATa:STARt** (string) - Optional - Specifies the first data point for the transfer. - **DATa:STOP** (string) - Optional - Specifies the last data point for the transfer. - **DATa:WIDth** (string) - Optional - Specifies the data width for digital sources (1 for state, 2 for transition). - **DATA:MODe** (string) - Optional - Specifies the data mode, e.g., 'PIXmap' for Fast Acquisition. ### Request Example ``` GET /curve?DATA:SOUrce=CH1&DATa:STARt=0&DATa:STOP=1000 ``` ### Response #### Success Response (200) - **curve_data** (binary) - The transferred waveform data and preamble. #### Response Example (Binary data representing waveform and preamble) ``` -------------------------------- ### Get Buffer Statistics (Python) Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_9m90a9_smu/buffer Retrieves statistics from a specified reading buffer. It can target default buffers (defbuffer1, defbuffer2) or user-defined buffers. Optional parameters allow specifying relative start and end times for the statistics. ```python def getstats( buffer_var: Optional[str] = None, rel_start_time: Optional[str] = None, rel_end_time: Optional[str] = None, ) -> Dict[Any, Any]: # Function implementation details would go here pass ``` -------------------------------- ### Register Additional USBTMC Mapping in Python Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices Provides an example of using `register_additional_usbtmc_mapping` to add USBTMC support for devices not natively recognized by tm_devices. This is useful for custom hardware setups. It requires specific device identification information. ```python from tm_devices import register_additional_usbtmc_mapping # Example usage (replace with actual vendor and product IDs) register_additional_usbtmc_mapping(vendor_id='0xABCD', product_id='0x1234') ``` -------------------------------- ### *OPT Command Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/dpo5k_commands Queries the installed options on the instrument, returning a comma-separated list of option codes and descriptions. ```APIDOC ## *OPT Command ### Description This query-only command returns a comma separated list of installed options as an arbitrary ASCII string (no quotes) of the form: `:`,`:`… The last section of each entry (the text following the last hyphen) indicates the license type. If no options are found, NONE is returned. ### Method GET, VERIFY ### Endpoint `/*OPT` ### Parameters None ### Request Example ```json { "query": "*OPT?" } ``` ### Response #### Success Response (200) - **result** (string) - A comma-separated list of installed options. #### Response Example ```json { "result": "OPTION1:Description1,OPTION2:Description2" } ``` ### SCPI Syntax ``` - *OPT? ``` ``` -------------------------------- ### Python tm_devices Commands and Triggers Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_60a2g6_dpomdomso/trigger This snippet demonstrates how to interact with tm_devices using Python, specifically for executing commands and managing triggers. It assumes the tm_devices library is installed and accessible. The code outlines basic command execution and trigger setup. ```python import tm_devices # Example: Executing a command tm_devices.send_command('your_command', device='your_device') # Example: Setting up a trigger def trigger_callback(data): print(f"Trigger received: {data}") tm_devices.set_trigger('your_trigger', callback=trigger_callback, device='your_device') ``` -------------------------------- ### Installed Options Command (*OPT) Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/mdo4kb_commands The *OPT? query returns a comma-separated list of installed options. Each option is formatted as ':', with the last part indicating the license type. 'NONE' is returned if no options are found. ```APIDOC ## *OPT Command ### Description Queries the installed options on the device. Returns a comma-separated list of options in the format `:`. ### Method - `opt.query()`: Sends the `*OPT?` query and returns the installed options. - `opt.verify(value)`: Sends the `*OPT?` query and asserts if the result does not match `value`. ### Endpoint N/A (Command-based) ### SCPI Syntax ``` *OPT? ``` ``` -------------------------------- ### Get Buffer Statistics with Python Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/gen_9sx7e4_smu/buffer Retrieves statistics from a specified reading buffer using the getstats function. It accepts optional buffer name, relative start time, and relative end time as parameters. Returns a dictionary of statistics or raises NoDeviceProvidedError if no device is connected. ```python def getstats( buffer_var: Optional[str] = None, rel_start_time: Optional[str] = None, rel_end_time: Optional[str] = None, ) -> Dict[Any, Any]: """Run the buffer.getstats() function.""" pass ``` -------------------------------- ### SDS - Delete Setup Slot Source: https://tm-devices.readthedocs.io/stable/reference/tm_devices/commands/mso70kdx_commands Changes a specified setup to reference the factory setup instead of a user setup slot. The content of the user setup slot remains but becomes inaccessible. ```APIDOC ## *SDS ### Description Changes the specified setup to reference the factory setup instead of the specific user setup slot. The content of the setup slot is unchanged but will no longer be accessible. This action is equivalent to selecting Delete from the File menu and then choosing the specified setup. ### Method `write(value)` ### Endpoint N/A (SCPI Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python rm.write('*SDS 1') ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ### Info - `` specifies a user setup location (1-10) to delete. Using an out-of-range value will cause an error. ```