You can configure an individual shared variable interactively, a group of shared variables interactively, or any number of shared variables programmatically. Use the following table to understand the methods of configuring a shared variable.

Method Recommended Use Required Product
Interactively by using the Shared Variable Properties dialog box Configuring an individual shared variable LabVIEW Development System, LabVIEW Datalogging and Supervisory Control (DSC) Module, or LabVIEW Real-Time Module
Interactively by using the Multiple Variable Editor window Configuring multiple shared variables simultaneously DSC Module or Real-Time Module
Programmatically by using the SharedVariableIO properties Reading and writing engineering units, scales, and other information about the shared variable DSC Module

To delete a shared variable, right-click the shared variable in the Project Explorer window and select Remove from the shortcut menu.

Changes you make using the Shared Variable Properties dialog box, the Multiple Variable Editor window, or the shared variable properties affect the .lvlib file. Changes you make using the SharedVariableIO properties do not affect the LabVIEW project library (.lvlib). The SharedVariableIO properties affect the Shared Variable Engine (SVE) directly.

Configuring Shared Variables Interactively

You can configure shared variables interactively by using the Logging, Update Deadband, Alarming, Initial Value, Security, Scaling, Description, Real-Time FIFO, and Network pages of the Shared Variable Properties dialog box.

Note You also can configure shared variables interactively by using the NI Distributed System Manager.

Configuring Multiple Shared Variables Interactively

By using the Multiple Variable Editor window, you can configure multiple shared variables simultaneously and interactively. You can use the Multiple Variable Editor window to edit properties, such as alarming, logging, network, description, and scaling, for a large number of shared variables. You also can change the data type of multiple shared variables.

Configuring Shared Variables Programmatically

By using the SharedVariableIO properties, you can configure shared variables programmatically by editing many shared variable properties, such as alarming, logging, and scaling. You also can read shared variable information and read and configure network information programmatically.

Note You can use the SharedVariableIO properties only on shared variables you configure with the Variable Type set to Network-Published on the Variable page of the Shared Variable Properties dialog box.

The following list describes the properties you can read and write. The shared variable properties that you can read and write depend on the data type of the shared variable and on your target and licensed product(s).

  • Shared variable information—You can read information about the shared variable, including the name and data type of the shared variable, the name of the process the shared variable belongs to, and whether the shared variable is loaded in the process. You also can provide a description for the shared variable.
  • Network information—You can read and configure options about NI Publish-Subscribe Protocol (NI-PSP) and how the shared variable can access the source. You also can specify whether the shared variable updates.
  • Alarming—You can configure and read alarm information for shared variables.
  • Logging—You can configure and read whether logging is enabled for shared variables.
  • Scaling—You can configure and read scaling for shared variables.

You can configure SharedVariableIO properties for network-published shared variables only. Enable network publishing for a shared variable before you configure and read this shared variable.