LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

equivalent of visual Basic static variable in LabVIEW

Solved!
Go to solution

Hi all!

 

I am doing a project where I am counting the values. After i Close/Stop the program I want the value to be intact and continue with the last value.

 

I know this in Visual Basic. By using the Static variable we can retain the value even we close the program.

 

 

Kindly help..

 

 

Srikanth Chilivery,
0 Kudos
Message 1 of 6
(3,087 Views)

I have trouble believing that a static variable retains its value after the program is terminated.  Once the program is released from memory, that static variable is gone.  If you want to retain a value between closing and opening an application, you have to save it to disk in some way.

 

Are you working exclusively in the LabVIEW IDE or are you running EXEs?  It sounds like you probably just want to use a Functional Global Variable/Action Engine.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(3,079 Views)

Actually I am doing the project in LabVIEW...

 

I need a way to store a value (counter) Even if i stop/close the VI.

Srikanth Chilivery,
0 Kudos
Message 3 of 6
(3,069 Views)

@windows wrote:

Actually I am doing the project in LabVIEW...

 

I need a way to store a value (counter) Even if i stop/close the VI.


As I already stated, you need to save the value to a file.  Upon running the VI again, read the value and store it whever you are storing it now.  On close, save the new value to the file.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 6
(3,062 Views)
Solution
Accepted by topic author windows

 

I know this in Visual Basic. By using the Static variable we can retain the value even we close the program.

 

 

I program in Visual Basic. What you write is simply NOT true. Once you close a program everything associated even static variables is gone.

 

Do as crossrulz suggests.

 

 

 

Message 5 of 6
(3,039 Views)

I found my mistake...

 

I used another method to design my program..

Thanks for Helping...Smiley HappySmiley HappySmiley Happy

Srikanth Chilivery,
0 Kudos
Message 6 of 6
(3,018 Views)