Home News For engineers | A hard-core technique for efficient Python

For engineers | A hard-core technique for efficient Python

2024-03-23

Share this article :

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


Automation encompasses two main use cases:

• 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.


01 Definition of programming interface

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.


02 Contents of the tm_devices driver package

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.


03 Environment settings

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.

3.1 Overview of installation and prerequisites

1. Install Python.

     a.Python >=3.8

2. PyCharm——

PyCharm installation, startup project and tm_devices installation

3. VSCode——

VSCode installation, startup project and tm_devices installation



View more at EASELINK

HOT NEWS

Understanding the Importance of Signal Buffers in Electronics

Python,engineer,engineers,tm_devices,tm,devices

Have you ever wondered how your electronic devices manage to transmit and receive signals with such precision? The secret lies in a small ...

2023-11-13

How to understand Linear Analog Multipliers and Dividers?

IntroductionLinear analog multipliers and dividers are an advanced-looking device at first glance, but they're actually crucial player...

2023-09-08

Demystifying Data Acquisition ADCs/DACs: Special Purpose Applications

Introduction to Data Acquisition ADCs/DACsUnlocking the potential of data has become an integral part of our ever-evolving technol...

2023-10-12

Another century of Japanese electronics giant comes to an end

"Toshiba, Toshiba, the Toshiba of the new era!" In the 1980s, this advertising slogan was once popular all over the country.S...

2023-10-13

Understanding the World of Encoders, Decoders, and Converters: A Comprehensive Guide

Encoders play a crucial role in the world of technology, enabling the conversion of analog signals into digital formats.

2023-10-20

The Future of Linear Amplifiers: Unlocking Breakthroughs in High-Fidelity Audio and Communication

Introduction to Linear AmplifiersWelcome to the world of linear amplifiers, where breakthroughs in high-fidelity audio and communication...

2023-09-22

Financial Times Documentary "The Battle for Global Semiconductor Dominance"

On September 28, the Financial Times, a century-old media giant, launched a documentary titled "The race for semiconductor suprema...

2023-10-16

What signals does the United States send out on these IC companies?

According to Yonhap News Agency, Choi Sang-moo, the chief economic secretary of the South Korean Presidential Office, held a press...

2023-10-14

Address: 73 Upper Paya Lebar Road #06-01CCentro Bianco Singapore

Python,engineer,engineers,tm_devices,tm,devices Python,engineer,engineers,tm_devices,tm,devices
Python,engineer,engineers,tm_devices,tm,devices
Copyright © 2023 EASELINK. All rights reserved. Website Map
×

Send request/ Leave your message

Please leave your message here and we will reply to you as soon as possible. Thank you for your support.

send
×

RECYCLE Electronic Components

Sell us your Excess here. We buy ICs, Transistors, Diodes, Capacitors, Connectors, Military&Commercial Electronic components.

BOM File
Python,engineer,engineers,tm_devices,tm,devices
send

Leave Your Message

Send