DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DIAdem create an user variable for Report

Solved!
Go to solution

Hi,

 

I know that i can display in a DIAdem report some pre-defined DIAdem vairiable (such as CurrDate) using @@Variable@@. 

I would like to create a DIAdem user variable (from a DIAdem script) to be used in DIAdem report.

1) I have created a variable in my script

                  Dim myvariable

                  myvariable = "hello"

2) I have run the scirpt

3) I have put @@myvariable@@ in a Text

 But a error message appears : Variable is undefined : 'myvariable'

 

How could a create a user varaible to be displayed in my report?

 

Thank

0 Kudos
Message 1 of 3
(4,311 Views)
Solution
Accepted by malexman

Hi malexman

 

You first have to register your script as a user command. Goto SCRIPT and select Settings»Options»Extensions»User Commands

More information can be found in the DIAdem help (e.g. Basics > General > Basic Information > Using User Commands)

 

Hope this helps

 

Winfried

0 Kudos
Message 2 of 3
(4,310 Views)

Hi malexman,

 

The other option is to create a global variable from a normal (non-user-command) VBScript.  There are several ways to do this, but the one we instruct new users to implement is the "GlobalDim" command, like this:

 

GlobalDim "UserVariable"

UserVariable = "hello"

 

You will notice that after this short VBScript runs the "UserVariable" changes color to show that it has become a global variable-- at that point you can use it in REPORT (and everywhere else in DIAdem, thus the name "global" variable).

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

Message 3 of 3
(4,297 Views)