LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re open executable with previous values

I have user interface VI and a VI running on my cRIO, if host computer goes down or the executable is closed the the cRIO continues as if nothing happened which is what I want but then if I reopen my UI VI then the values are blank, I am wondering if there is a setting or a way to remember the previous values and fill the cells with those values so that the cRIO does not stop when the executable is re opened.

 

Thanks 

Billy

0 Kudos
Message 1 of 10
(2,946 Views)

hi,

 

you can save the data of all your variables in a file when you stop your VI. Then, when you launch your VI, you read this file, and fill the variables with the data stored in the file.

Giuliano Franchetto
Student at the l'Ecole Nationale Supérieure des Mines de Saint-Etienne, cycle ISMIN (FRANCE)
0 Kudos
Message 2 of 10
(2,941 Views)

I havenever worked with cRIO so I don't kow about the cRIO startign and stopping but...

 

In general you will need to store the current control and indicator values to a file at regular intervals and then restore them or give the user the option each time the program starts.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 10
(2,936 Views)

Does the program on the cRIO continue running, and when you reconnect to it it is still running but the user interface isn't updated? If it continues to run, indicators should keep their previous values, but if you're using property nodes to update the user interface, you will not see a correct value until you write to the property while a client is connected. Are you using property nodes to update the display? See Remote Front Panel Image Does Not Reflect Property Node Changes that Occur Prior to Connection. Note that if no remote front panel is connected, property nodes that reference front panel items will generate errors because there is no front panel.

0 Kudos
Message 4 of 10
(2,917 Views)

The cRIO is still running and I am both reading and writing on the computer end so perhaps writing to a file is the best way to go. I am currently using shared variables that are only on the cRIO side and have programatic access on the user interface side so that I can have a variable cRIO IP address.

0 Kudos
Message 5 of 10
(2,903 Views)

It sounds like you may need an initialization state on your computer VI.  When it starts up, it detects whether the RIO is running or not.  If it is, then it precedes to read the shared variables and update the controls on the computer VI.  If the RIO is not running, then it can do whatever initialization routines it would normally do if you were starting your PC and RIO execution on a clean slate.

Message 6 of 10
(2,872 Views)

Thanks for the reply, this may sound like a stupid question but how do I get the controls to display the number that I want?

0 Kudos
Message 7 of 10
(2,854 Views)

Property nodes. ( or local variable but thy are frowned upon ) 


Learning LabVIEW since January 2013
Message 8 of 10
(2,838 Views)

Yes either local variables or property nodes (the value property).

 

While they are "frowned upon", that is only in certain situations where they are abused and cause race conditions.

 

For a case like initializing controls, either one is perfectly acceptable to use.  Property nodes can be somewhat slower to execute, but the time difference would be insignificant for a use case such as initializing controls.

Message 9 of 10
(2,825 Views)

Thanks everyone I ended up using property nodes and it works great

0 Kudos
Message 10 of 10
(2,823 Views)