This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

What Happens if the System Hosting my Shared Variables Crashes?

Updated Jul 25, 2023

Reported In

Software

  • LabVIEW

Issue Details

I am setting up a critical application using several shared variables, and I am concerned about what will happen should the computer hosting the shared variable engine go down unexpectedly.  What will happen to my shared variables?

Solution

Once a shared variable is deployed it remains deployed as a service until it is explicitly undeployed.  If the computer running the shared variable engine goes offline or crashes for some reason, any subscribers will receive the following error from the shared variable node error out terminal:

Error -1950679023: The connection to the server was disconnected.  

The value read back will be the default value for the shared variable's data type or the last known value.  Once the host computer is back online, the subscribers may continue to receive the following warning:

Warning -1950679034: The shared variable has no value.  

If you see this warning, it could mean that the shared variable has not been written to yet.  Once the variable receives its first piece of data, the warning will go away.  If you are using front panel data binding, the triangular LED will turn red while the host computer is offline and will turn green once it is back online.

Additional Information

If you are using a LabVIEW Real-Time target such as CompactRIO or a Real-Time PXI Controller, it is appropriate to consider hosting the shared variable library on the real-time target. These devices have watchdog capabilities and typically contain hardware components controlling the critical pieces of an application. Most Windows or PC-based targets do not have these fail-safes.

The LabVIEW Datalogging and Supervisory Control Module (DSC) adds more functionality to shared variables, including Initial Values, Alarming, and Logging.If you enable an Initial Value on a shared variable, when the host computer comes back on-line it will default to this value. Setting a Bad Status alarm for the shared variable is also a good way of handling this type of event.  It is important to note that if your are using the DSC Module, the Alarming and Logging functions of the shared variables are not available if the library is hosted on a real-time target.  These functions are only available when your library is hosted from a desktop computer.