04-12-2011 12:10 PM
Hello,
I have a cRIO with an RT prog. There are some networked shared variables that are hosted on the cRIO.
I can update these from a host app.
If I reboot the cRIO, the shared variables come back to what they were last set to.
If the RIO loses power and then is restarted, the shared variables will come back as they were last saved, not neccessarily what they were last updated too.
So it appears that on a normal reboot, the shared variables are saved as part of the shutdown, but on a sudden loss of power they are not.
Is there a command that I can send to the cRIO to force it save it's current shared variable values so that if it loses power it will restart with those values?
Thanks,
Paul
Solved! Go to Solution.
04-13-2011 07:18 PM
There really is no automatic way of doing this that I know of. The only reason SV's persist between RT resets is because SV's reside in a separate
tagger.exe process that keeps running through a reset. The SV state is only saved in ram so it gets wiped out on a power cycle. You would have to write code to read all of your SV's and then save/restore to disk. As an alternative, I suppose you could possibly save the state in the initial value property of the SV's which could then be saved to flash and of course would then automatically restore upon powerup.
04-15-2011 07:02 AM
Thanks for the reply.
Is Initial Value still available in ver 10?
I see in Help for ver 8
However in my ver 10 project, I don't see
Alarming, Logging, Update Deadband, Initial Value, or Security
04-15-2011 07:23 AM
Initial Value is only available with the DSC toolkit. Personally I think it should be built into all versions of LV.
11-11-2013 08:29 AM
Is there any solution to make the last value set to a variable as the new initial value, so when the cRIO reboots from a power outage or any other reason, it starts with that last value?
11-12-2013 10:43 AM
Hi Quintino,
You would have to write the data to disk and pull from that configuration file for the new values. I would also suggest you post this question in a new topic so you can get some more relvant replies, this thread is 2 years old.
Regards,
11-12-2013 11:01 AM
Dear ShishKeBobby,
thank you for your reply. I have indeed created a new topic here: http://forums.ni.com/t5/LabVIEW/cRIO-Shared-Variable-after-Reboot/m-p/2618125
Initially I thought in that, but I can I save a file inside cRIO? When I try for example the block Write Spreadsheet or Open/Create/Replace File how can I set the filepath to the cRIO?
Thank you very much for your help.
11-12-2013 11:08 AM
It is designated as drive C, but you need to use VXWorks format e.g.
/c/your_folder/data.csv