LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Variables saving on cRIO

Solved!
Go to solution

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

0 Kudos
Message 1 of 8
(3,624 Views)
Solution
Accepted by pjackson59

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.

0 Kudos
Message 2 of 8
(3,610 Views)

Thanks for the reply.

 

Is Initial Value still available in ver 10?

I see in Help for ver 8

  • Variable—Determines the basic configuration of the shared variable, including the Data Type and Variable Type.
  • Alarming—Configures alarming options for the shared variable.
  • Description—Specifies a description for the shared variable.
  • Logging—Configures logging options for the shared variable.
  • Network—Configures network options such as buffering for the shared variable.
  • Real-Time FIFO—Enables and configures the Real-Time FIFO of a shared variable.
  • Scaling—Configures scaling options for the shared variable.
  • Update Deadband—Configures the deadband options for the shared variable.
  • Initial Value—Configures the initial value for the shared variable.
  • Security—Configures the security options for the shared variable.

 

However in my ver 10 project, I don't see

Alarming, Logging, Update Deadband, Initial Value, or Security

 

0 Kudos
Message 3 of 8
(3,594 Views)

Initial Value is only available with the DSC toolkit.  Personally I think it should be built into all versions of LV.

0 Kudos
Message 4 of 8
(3,591 Views)

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?

0 Kudos
Message 5 of 8
(3,353 Views)

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,

 

Bobby Breyer
Applications Engineer
National Instruments
0 Kudos
Message 6 of 8
(3,331 Views)

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.

0 Kudos
Message 7 of 8
(3,327 Views)

It is designated as drive C, but you need to use VXWorks format e.g.

/c/your_folder/data.csv

Message 8 of 8
(3,324 Views)