Use shared variables to read and write data among VIs in a project or across a network. From the Project Explorer window, right-click an RT target and select New»Variable from the shortcut menu to open the Shared Variable Properties dialog box, which you can use to create and configure the options for a shared variable. Shared variables are configured software items that can send data between two locations in a block diagram that cannot be connected with wires, between two VIs running on an RT target, or between two VIs across a network running on different targets. Use single-process shared variables to share data locally on an RT target. Use network-published shared variables to share data between VIs on different targets.
The Real-Time Module adds a real-time FIFO to the shared variable. By enabling the real-time FIFO of a shared variable, you can deterministically share live data without affecting the determinism of VIs running on an RT target.
To create a shared variable under an RT target in a LabVIEW project, right-click the target in the Project Explorer window and select New»Variable from the shortcut menu to open the Shared Variable Properties dialog box. Select to create a Single-Process or Network-Published shared variable from the Variable page of the Shared Variable Properties dialog box. LabVIEW creates a project library that contains the shared variable under the RT target. Right-click the project library and select Deploy from the shortcut menu to deploy the shared variable to the target.
When you create a network-published shared variable on a target, the Shared Variable Engine on the target hosts the shared variable. The Shared Variable Engine sends the data you share to other targets across the network. You can choose the target that you want to host the shared variable by creating the shared variable under the target in the Project Explorer window.
If you host a network-published shared variable on an RT target, the target controls the data, the shared variable resides on the same target with the application, and other targets do not affect the availability of the shared variable. If you host a network-published shared variable on the host computer, you can offload the processing required by the shared variable from the RT target, you can reference a network-published shared variable from a target that does not support the Shared Variable Engine, and you can use the added security features provided by the LabVIEW DSC Module. The following illustration shows a Real-Time Module application that uses single-process and network-published shared variables to share data locally and across the network between VIs.

The Deterministic VI running on the RT target shares data with Other VI on the target using a single-process shared variable. The Deterministic VI also shares data with a VI on the host computer using a network-published shared variable hosted with the Shared Variable Engine on the RT target. The network-published shared variable on the RT target sends data to the Shared Variable Engine running on the target, which then shares the data with a host computer. ETS RT targets that have less than 32 MB of RAM cannot run the Shared Variable Engine; therefore, you cannot create network-published shared variables on these targets. You can reference network-published shared variables under other targets in the Project Explorer window to share data across the network.
![]() |
Note RTX The RTX target running in the real-time subsystem does not support creating or referencing networked-published shared variables. |
The following table shows the shared variable support of different RT targets.
| Support | ETS targets | VxWorks targets | RTX targets |
| Host Network-Published Shared Variables? (Must install Network Variable Engine software on RT target) | Yes (Except targets with less than 32 MB RAM) | Yes | No |
| Reference Network-Published Shared Variables? (Must install Variable Client Support software on RT target) | Yes | Yes | No |
| Create and Reference Single-Process Shared Variables? (No additional components to install) | Yes | Yes | Yes |
After you create a shared variable, you can change the configuration by right-clicking the shared variable in the Project Explorer window and selecting Properties from the shortcut menu to open the Shared Variable Properties dialog box. If you change the configuration of a shared variable, you must deploy the variable properties on the target. Right-click the project library where the shared variable resides under the target and select Deploy from the shortcut menu to update the properties of the shared variable on an RT target.
You can enable the real-time FIFO of a shared variable from the Real-Time FIFO page of the Shared Variable Properties dialog box. Place a checkmark in the Enable Real-Time FIFO checkbox to deterministically share data using single element or multi-element FIFOs.
A single-element FIFO shares the most recent data value. The shared variable overwrites the data value when it receives a new data value, which can cause you to lose data. Configure the size of the array elements or the size of the waveform for the FIFO buffer if you select an array or waveform data type.
![]() |
Note You must configure the size of the FIFO elements equal to the size of the data you want to share. Sharing data smaller or larger than the length you specify causes a memory allocation that affects determinism. |
A multi-element FIFO buffers the values shared by the shared variable. You can configure the size and the elements of the FIFO buffer to match the settings from the Use Buffering section of the Variable page, or you can configure a custom size for the FIFO and the FIFO elements.
![]() |
Note You must configure the size of the FIFO elements equal to the size of the data you want to share. Sharing data smaller or larger than the length you specify causes a memory allocation that affects determinism. |