Engineers in many industries use automation to extend the functionality of their test instruments, often using the free programming language Python. As the primary programming language suitable for automation, Python offers many significant advantages:
■ Versatility
■ Easy to teach
■ Code readability
■ Widely available knowledge base and modules
• Routines that simulate human behavior to automate front panels and save time, such as automating compliance testing. Instead of sitting in front of an oscilloscope every time a new part needs to be tested, adding the appropriate measurements and writing down the results, an engineer develops a script that does all the work and displays the final results.
• Extend the use of instrument functionality, for example: measurement recording, verification or quality assurance. Automation enables engineers to perform complex tests and circumvents many of the inherent shortcomings of the testing process. Operators no longer need to set up the oscilloscope and record results manually, and tests can be performed the same way every time.
This technical introduction will cover what you need to program with Python, including the basics of the programming interface and examples of download and run methods.
A programming interface (PI) is one or more boundaries between two computing systems that can be programmed to perform specific behaviors. For the purposes of this article, the programming interface is the bridge between the computer running each Tektronix test device and the applications written by the end user. To narrow the scope further, a programming interface is defined here as a set of commands that can be sent remotely to an instrument, which processes them and performs the corresponding tasks. The PI stack (Figure 1) shows the flow of information from the host controller to the instrument. Application code written by the end user defines the behavior of the target instrument.
End users typically write code using development platforms popular in the industry, such as Python, MATLAB, LabVIEW, C++, or C#. These applications will send data using the Standard Commands for Programmable Instruments (SCPI) format—a standard format supported by most test and measurement equipment. SCPI commands are typically sent through the Virtual Instrument Software Architecture (VISA) layer, which facilitates data transfer by providing enhanced robustness to the communication protocol (such as error checking). In some cases, the application may call the driver, which then sends one or more SCPI commands to the VISA layer.
Tektronix's tm_devices is a device management package developed by Tektronix that supports users to use the programming language Python to control and automate the testing process of Tektronix and Keithley products. tm_devices can be quickly installed using Python's package management system pip.
The Python package contains a large number of commands and functions to help users easily conduct automated testing of Tektronix and Keithley products. It can be used in the most popular Python IDEs and supports code completion assistance. Additionally, Python packages help engineers with any level of software skills make coding and test automation simple and easy.
This section guides you through the prerequisites and installation for developing with tm_devices. We intentionally provide instructions to support virtual environments in Python (venvs) because we believe this will help you manage and maintain your projects more easily, especially if you are simply trying out a Python package before using it.
a.Python >=3.8
PyCharm installation, startup project and tm_devices installation
VSCode installation, startup project and tm_devices installation
View more at EASELINK
2023-11-13
2023-09-08
2023-10-12
2023-10-13
2023-10-20
2023-09-22
2023-10-16
2023-10-14
Please leave your message here and we will reply to you as soon as possible. Thank you for your support.
Sell us your Excess here. We buy ICs, Transistors, Diodes, Capacitors, Connectors, Military&Commercial Electronic components.
Leave Your Message