From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does shared variable deployed on RT target holds its value after reboot?

Solved!
Go to solution

The shared variables deployed on real time target are stored in RAM or non volatile memory? Will it hold its value after reset or power off/power on? I tested and it seems hold its value but I didn't find any documentation about it from NI.

 

Regards,

 

Tom

0 Kudos
Message 1 of 6
(2,396 Views)

I had always assumed that shared variables would assume their default or inital value (if you are using the DSC)

http://digital.ni.com/public.nsf/allkb/7BA64956A475405F862570ED007B2A88

The deployment itself is stored in flash and is preserved when cycling power, but the actual value of the SV's is

in RAM and I would not expect it to be preserved.

Message 2 of 6
(2,390 Views)

All shared variables revert to their 'default' values when the Shared Variable Engine is deployed.

Message 3 of 6
(2,380 Views)

If the shared variable is redeployed after reset or power down/power up it do reset to its default value. But without redeployment it keeps its previous value, at least for the target I tested (sbRIO 9612).

0 Kudos
Message 4 of 6
(2,359 Views)
Solution
Accepted by topic author tom_z

Hello,

There are several components involved in how the variables are stored on a target but a portion of that is in non-volatile memory. Shared variables local to the RT target will not retain their value. Any host reading data from the target will receive the last value from the target prior to reboot considering that the host is not concurrently re-booted. The reason why is that there are 2 shared variable engines at work;one for the host and the other for the target. Since only the target was re-booted, the shared variable engine on the host will retain its last value while the engine on the target will be set to 0, false or empty string. Here is a Community example that  'Monitor'[s] for Empty State in RT FIFO Enabled Shared Variable'.

 

Best,

National Instruments
Applications Engineer
Message 5 of 6
(2,349 Views)

Hi Patricia,

 

    Thanks! It explain what I saw.

 

    Regards,

 

    Tom

0 Kudos
Message 6 of 6
(2,334 Views)