08-15-2013 11:50 AM
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
08-15-2013 12:03 PM
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.
08-15-2013 12:13 PM
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.
08-15-2013 12:34 PM
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.
08-15-2013 01:07 PM
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.
08-15-2013 05:03 PM
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.
08-16-2013 07:56 AM
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?
08-16-2013 08:39 AM
Property nodes. ( or local variable but thy are frowned upon )
08-16-2013 09:32 AM
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.
08-16-2013 09:34 AM
Thanks everyone I ended up using property nodes and it works great