Right-click a project library or folder within a library and select New»Variable from the shortcut menu, or right-click an existing shared variable and select Properties from the shortcut menu to display the Shared Variable Properties dialog box and this page.
Use this page to set the basic options for a shared variable. You also can use the Variable Reference property with the Variable properties to configure shared variables programmatically.
This page includes the following components:
- Name—Specifies the name of the shared variable.
- Data Type—Specifies the data type of the shared variable. Select From Custom Control and enter a path or browse to a custom type control to set the data type of the shared variable to any data type supported by LabVIEW. The data type you select appears in the field to the right of the pull-down menu. LabVIEW modules and toolkits you have installed might provide additional shared variable data types. Refer to the documentation for the LabVIEW module or toolkit for more information about the shared variable data types that product adds to LabVIEW.
- Variable Type—Specifies the scope of the shared variable. Select Network-Published from the drop-down list if you want to share the shared variable data across a network. Select Single-Process from the drop-down list if you want to share the shared variable data among VIs on the local computer. LabVIEW modules and toolkits you have installed might provide additional shared variable types, configuration options, and limitations. Refer to the documentation for the LabVIEW module or toolkit for more information about the shared variable types, configuration options, and limitations that product adds to shared variables.
- Use Buffering—Enables you to store data from the variable in a first-in-first-out (FIFO) buffer. The shared variable overwrites the first value in the FIFO if the FIFO reaches capacity. You only can use buffering for network-published shared variables.
 | Note If you are using a network-published Shared Variable node that is configured to read data, you must run each Shared Variable node before the node subscribes and starts receiving buffered values. |
- Number of xxx—Specifies the number of shared variables the buffer can contain. The data type you select in the Data Type pull-down menu determines the variable xxx. This control does not appear for all data types.
- Bind to Source—Binds the shared variable to an existing shared variable in the active project, an existing shared variable in another project, or an NI Publish-Subscribe Protocol data item on the network. This component is available only for network-published shared variables.
- Access Type—Sets whether the shared variable writes or reads data. If you selectread only or write only, you can create shared variables that are configured only to read data or write data, respectively. When you right-click the shared variable that is bound to a source that is read or write only, the Change to Write and Change to Read options are disabled in the shortcut menu.
- Path—Specifies the path to the shared variable or data item to which you want to bind the shared variable you are configuring. The path to a shared variable in the active project consists of the computer name as it appears in the project, the name of the library in which the shared variable resides and the shared variable name: computer\library\shared_variable. The path to a shared variable in a separate project or on a separate computer consists of the DNS name or IP address of the computer preceded by \\, the name of the library in which the shared variable resides and the shared variable name: \\computer\library\shared_variable. The path to a shared variable in another project consists of the computer name, the name of the library in which the shared variable resides, and the shared variable name: \\computer\library\shared_variable. The path to an NI-PSP data item consists of the computer name, the name of the process in which the data item resides, and the data item name: \\computer\process\data_item.
- Browse—Displays the Select Source Item dialog box from which you browse to the shared variable or data item on the network to which you want to bind the control.
- Single Writer—Sets the shared variable to accept changes in value from only one target at a time. This component is available only for network-published shared variables.
Selecting this option ensures that the shared variable write operation is not affected by another instance of LabVIEW.exe. The Shared Variable Engine restricts writing to a single VI on a single computer. The first instance of LabVIEW that connects to the shared variable can write values, and any subsequent instances cannot. When the first instance disconnects, the next instance in the queue can write values to the shared variable. LabVIEW notifies writers that are not allowed to write to the shared variable.
- Enable timestamp—Specifies if a timestamp value is recorded each time the single-process shared variable reads data. To view the timestamp information and add a timestamp output to the Shared Variable node, right-click the Shared Variable node and select Show Timestamp from the shortcut menu. The Enable timestamp component is available only for single-process shared variables. The timestamp is always enabled for other types of shared variables.
 | Note Windows You can create, configure, and host shared variables only on Windows systems. You can use the DataSocket VIs and functions to read or write shared variables from other platforms. If you have a VI with a Shared Variable node that was configured on a Windows system, you also can move that VI to another platform. |