When you bind a shared variable to an existing data source, the shared variable receives the same updates as that data source. Possible data sources for shared variables include DAQ channels; NI Publish-Subscribe Protocol (NI-PSP) data items, such as other shared variables; and data items from I/O servers that are defined in a separate project.

Note

Bind a shared variable to an existing data source if you need to leverage shared variable features for a data source that does not support those features. For example, assume that you need to set logging and alarming properties for a shared variable on a CompactRIO target. Because real-time targets do not support logging and alarming, you must create a new shared variable on your development computer, bind that shared variable to the shared variable on the CompactRIO target, and configure the shared variable on the development computer for logging and alarming. When the shared variable on the CompactRIO target sends new data to the Shared Variable Engine (SVE), the SVE updates the value of the shared variable on your development computer, and that shared variable performs the logging and alarming tasks.

Note When you bind a shared variable to an existing data source across a network, LabVIEW does not track configuration changes to the data source. Therefore, in the example above, if you change the name of the variable on the CompactRIO target, you also must update the configuration of the shared variable on your development computer, or that shared variable breaks.

Complete the following steps to bind a shared variable to an existing data source.

  1. Create a shared variable or right-click a shared variable in the Project Explorer window and select Properties from the shortcut menu to display the Shared Variable Properties dialog box.
  2. Place a checkmark in the Enable Aliasing checkbox.
  3. Choose from the following options in the Bind to pull-down menu:
    • Select Project Variable to bind the shared variable to an NI-PSP data item in the current project.
    • Select PSP URL to bind the shared variable to an NI-PSP data item on the network.
      Note If the data item is on a computer that is not on the local subnet, you must select Tools»Shared Variable»Register Computer to register that computer. After you specify the computer name or the IP address of the computer, you can bind shared variables to data sources on that computer.
    • Select I/O Variable to bind the shared variable to a data item on an I/O server, such as an OPC server.
  4. Select the data source to which you want to bind the shared variable using one of the following methods:
  5. Click the OK button.

Data Communication Methods Home