DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving variables from a dialog box

I have created a dialog box for inputing 6 text variables for my data reduction script. These variables will change each time. They are T1, T2, T3, etc. How can I make it so the report template remembers these variables when I save the .TDR report file?
Download All
0 Kudos
Message 1 of 4
(3,443 Views)
Hello jetblack,

A DIAdem .TDR file does not contain data or variables, it only contains report layout information. However, you can create and modify DIAdem report layouts programmatically in your VBScript code. Attached is a small example of creating a DIAdem report layout in VBScript, and you could extend this to save user-entered variables to the different parts of the report layout (axis labels, legend, etc).

David Mc.
NI Applications Engineer
0 Kudos
Message 2 of 4
(3,443 Views)
Well I'm not sure I follow the executable, but I don't think it does or can do what I need it to do. When I created the input dialog box, I made 6 fields that are all different text variables, T1 through T6. Then I made a seperate table in my DIAdem report results page and linked the variables T1 through T6 to certain cells in the table. My question is how do program in my VBS script a way to remember it. I tried to write the variables to my DIAdem view by using the cht command to write those variables I input to certain channels so then it will be saved but it didn't work the way I had thought it would. I included the VBS script with this. Lines 1370 through 1390 were my attempt to write the text to cells in the DIAdem View.
0 Kudos
Message 3 of 4
(3,443 Views)
Hello jetblack,

Keep the following in mind:

- Data is only be stored in your TDM or DAT datafile.

- DIAdem-VIEW only displays the data from your datafile.

- DIAdem-REPORT only displays your report layout with the data from your datafile or variables.

- text can only be saved in text channels (or channel properties)

According to your script, you were trying to save the values of the T variables into numeric channels. Instead you should allocate a new text channel and save the T-values there.

You can use the attached VBScript to create a text channel, set your T-values, and save the contents of the T-values to your datafile using CHT. Everything will be saved with your datafile in the new text channel (named "TValues"), the
n the datafile itself needs to be saved. Then, you can reload this datafile and retrieve the T-values from it!

David Mc.
NI Applications Engineer
0 Kudos
Message 4 of 4
(3,443 Views)