From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Use a SUD Dialog to Provide a Text String to a DIAdem Python Script

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Diadem

    Programming Language

  • Python

Code and Documents

Attachment

Description

This example shows a simple SUD dialog box with three inputs and how can it can receive and send data to the Python script being executed in DIAdem, using global variables. This can be used to customize parameters during an automated test with DIAdem Scripting.

mceclip0.pngmceclip1.png

How to Use

  1. Download and decompress the .zip file attached.
  2. Save both files (.py and .sud) in the same location in disk, open the callSUD.py file in DIAdem and execute it.
  3. Enter data in the three input boxes and click OK.
  4. The entered data will be shown in a message box, which closes after 5 seconds or by clicking OK.

Additional Information

The scriptable user dialog (SUD) files must be written in VBS, however, once created the dialog box can be called in both a VBS and Python DIAdem script.

Related Links

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors