DIAdem Help

Notes on Python

  • Updated2024-09-12
  • 3 minute(s) read

Notes on Python

In DIAdem you can execute Python scripts in the SCRIPT panel in addition to VBS scripts. You specify the script language in the DIAdem Settings for SCRIPT. DIAdem uses the selected script language when you capture scripts and when you create a new script.

In the DIAdem settings for SCRIPT, you can also specify the program path of an installed Python version. If you do not specify a path or the path does not contain a Python version supported by DIAdem, DIAdem also looks for a valid Python installation in the paths of the Windows Path system variable. If DIAdem cannot find a valid Python installation, DIAdem uses the Python version of the DIAdem installation. DIAdem installs the base package of Python 3.8 (64-bit) DIAdem also supports the 64-bit Python versions 3.6, 3.7, and 3.9.

If you want to use the Python version that is installed on your PC, make sure that the installed Python module is PyWin32. If this module is not installed, you will get a message that Python is not initialized. You can also install your own Python libraries and use them in DIAdem.

DIAdem does not support Python in user commands or in SUD dialog boxes. The Script Profiler does not support Python scripts.

Currently, DIAdem for Python does not support virtual environments with virtualenv or venv.

The Python scripts in the excecutable examples show how to use DIAdem commands in Python. You may also be able to solve some tasks with pure Python syntax.

DIAdem also supports the auto-completion of Python and DIAdem methods and properties in Python scripts. Auto-completion is case sensitive. When you access the elements in a collection, you must specify the Item method for auto-completion to work. With DIAdem methods and properties, auto-completion does not currently work for polymorphic objects. For more information on the properties or methods of an object, refer to the help that you open by pressing F1.

To debug Python scripts, you cannot use the internal debugger of DIAdem, but must use an external debugger instead. If you start Python scripts and have enabled external debugging, DIAdem does not execute the scripts until you have connected the external debugger.

The page General information about Python scripts contains further information about Python scripts.

You can find more documentation about Python at https://www.python.org/.

Python examples

AC/DC Coupling | Analysis of Two Electric-Powered Race Cars | Area Calculation between Curves | ASCII File Loading and 3D Display | Automatically Creating a PowerPoint Presentation | Calculate Characteristics of an Oscillation | Calculating and Checking a Corridor | Calculating Process Capability | Calculating the Gear Transmission Ratio | Calculating the GPS Track | Calculating with Waveform Channels | Color Marker Depending on Channel | Combining DataFinder Search Results | Comparing Speed | Connect and Mirror Channels | Convert Polar Coordinates to Cartesian Coordinates | Converting Units | Copying Signals into Channel Groups | Crash Analysis | Creating a Python DataPlugin | Creating an Excel File | Creating and Viewing Long Data Channels | Detrending an Oscillation Signal | Error Bar Display | Error Handling in Scripts | Evaluating a Shock Response Spectrum | Event Search | Find Pattern in Signals | Flow Cytometry | Frequency Weighting (A-, B-, C-Filtering) | Mapping a Channel onto an Integer Data Type | Merging Channels from Different Measurements | Multiple Sorting of Channel Data | Non-Linear Curve Fitting | Pareto Diagram | Printing Reports Automatically as PDF | Removing Repeatedly Occurring Values in a Channel | Resampling | Savitzky-Golay Filter | Searching for and Interpolating Invalid Values | Searching for Data Sets Marked "Failed" in Data Stores | Searching for Data Sets Marked "Failed" | Searching for Events in Channels | Searching for Outliers with the ChnEvent Function | Searching for Outliers with the Peak Search Function | Seismic Phase Picker | Smoothing Signals with the 4253H Filter | Smoothing Signals | Sorting Channel Groups | Sorting the Channels in the Default-Group | Specifying Intersection Points | Swivel Analysis at the Engine | Synchronizing Measurement Data | Table with Automatic Row Height | Test Rig Analysis | Viewing and Automatically Analyzing Data

Log in to get a better experience