DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

delete old values of variables

Hello,
 
I have a problem with the initial values of the variables. The first time I run my program everything works propperly. However, if I stop it and I run it again later it works but it gives me the same results.The problem is that the first time the variables have no initial value and then they take the calibrated values. That is fine, but the second time the new values are written after the first values. So at the beginning you can read the old values again. I would like to reset my variables or something like this. I have tried to write in the variable 0 at the end (well, it's an array so an array constant with no values) but it writes after the old values. What can I do?
Thanks in advance.
0 Kudos
Message 1 of 2
(4,048 Views)
Hi Vicen,
in general, there at least four different sorts of variables you can use in DIAdem scripts. Concerning their initial behaviour, they are behaving differently:

  • auxiliary variables. Those you find if you open the DIAdem SCRIPT menu edit -> auxiliary variables. (R1, Rv1,...)  They are allocated (and reset)  automatically when you start DIAdem. There is no command to reset all of them to the initial states. Since they might be used by different scripts and examples in DIAdem, your program should always start with an initialisation.
  • global variables. They behave the same as auxiliary variables, but there is one difference. They are not allocated until you call the globaldim command. Nevertheless, calling globaldim a second time will not reset them to initial values. That is why our program should always start with an initialisation in this case as well.
  • VBS variables. These are variables used in the context of the VBS only. You cannot use them in other DIadem panels as SCRIPT. They are allocated and reset each time you start  your script. When the script completes executions, these variables are deleted again.
  • user variables DIAdem supports the declaration of user variables inside a specific declaration file (*.vas). All variables can be configured to have an initial value and there is a command that can be used to reset them to that value at any time.  Refer to "user variables" and the command "uservarreset" in the DIAdem online help.

Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
Message 2 of 2
(4,037 Views)