LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reinitlaizing global variables

Dear All,

Please let me know the possible ways to reinitalize a global variable to a default value. I want it to get initialized to a certain value everytime the VI starts running afresh. I have done this for indicators but not sure how to do this for global variables.

Regards
Karthikeyan
0 Kudos
Message 1 of 4
(2,924 Views)
Hi Karthikeyan
 
try this and let me know if it worked, dubble click the global variable so you will see the global front panel, then put the mouse on top of the front panel relevent icon (what the global variable means on the front panel) and initialize it to the certain value you want everytime the VI starts running afresh, then wright click and go to "data operations" and in it to the option "make current value default" and chouse it!!!, after that save the global front panel and the program were the global variable is and that shoud to the job
 
good lock and tell me if it worked!!
 
SKI FARM
0 Kudos
Message 2 of 4
(2,908 Views)

Just do it with code! SImply write the desired values to your globals before the main loop of you toplevel program starts.

0 Kudos
Message 3 of 4
(2,895 Views)
If you want to set the globals to the same known value, the "set current values to default" should work. Try it. However, if your defaults can change (say, from run to run or operator to operator) you can use the configuration files vi's and write/read the global from a file. It would make your global a little more flexible and dynamic.
PaulG.
Retired
Message 4 of 4
(2,893 Views)