LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

how to initialize a variable only once like static keyword available in c programming

Hi friends...


I would like u to initialize a variable only once ...........in the math script window similar to........... static keyword available in c programming.....
(the variable should get initialize only at first time ,when the program starts..after that it shouldn't get initialized once again...)
Is it possible with Labview Mathscript programming....
or Any other way to achieve this....

regards
rajasekar



0 Kudos
Message 1 of 3
(8,157 Views)
Hello,

Unfortunately, there isn't an equivalent to the static keyword in the MathScript Window.  If you wish to initialize a variable when the MathScript Window starts, the easiest way is to create a simple script that will assign the value to the variable and perform any other startup work you wish.  After starting the MathScript Window, simply run this script and the variables will be populated.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 3
(8,142 Views)
You can write your mathscript script in C and then use the call library function node to run your C script.  The tutorial is online if you search for call library function node...I believe the example is called Array Average.
0 Kudos
Message 3 of 3
(7,929 Views)