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

Exchanging Data Between VB Script and SUD in DIAdem

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

Code and Documents

Attachment

Description

This example shows you how to open a scriptable user dialog (SUD) in DIAdem and exchange input data with your VB Script using a VBS class.

 

How to Use

The best way to exchange data between VBS and SUD in DIAdem is a VBS CLASS.

 

  1. Define a class which contains at least the variables to be exchanged.
  2. Define a class object variable which is used as parameter for the SUD call.
  3. In SUD define a global variable and assign the SUD parameter (class object variable) with it.
  4. In the SUD dialog initialize event you assign the class content to the corresponding SUD object to initialize them.
  5. In the EventClick of the OK button or in the EventTerminate of the dialog write back the content of the dialog objects to the corresponding SUD parameter (class object variable).

 

Attached you'll find a small example.

 

 

Related Links

DIAdem Help

 

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

Contributors