04-25-2013 10:08 AM
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..
Solved! Go to Solution.
04-25-2013 10:21 AM
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.
04-25-2013 10:28 AM
Actually I am doing the project in LabVIEW...
I need a way to store a value (counter) Even if i stop/close the VI.
04-25-2013 10:36 AM
@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.
04-25-2013 12:10 PM - edited 04-25-2013 12:10 PM
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.
04-25-2013 03:04 PM
I found my mistake...
I used another method to design my program..
Thanks for Helping...![]()
![]()
![]()