Complete the following steps to create and configure a shared variable.
![]() |
Note You can create, configure, and host shared variables only on Windows or RT targets with the LabVIEW Real Time Module. 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. |
![]() |
Note If you right-click a target or a folder that is not inside a project library and select New»Variable from the shortcut menu to create a shared variable, LabVIEW creates a new project library and places the shared variable inside. |
![]() |
Note You can configure buffering only for network-published shared variables. |
You also can bind the new shared variable to an existing shared variable or to an NI-PSP data item.
You also can use the Variable Manager dialog box to edit, create, and monitor shared variables outside of the project environment. However, if you deploy a LabVIEW project library that includes shared variables and then use the Variable Manager dialog box to create new shared variables in the same project library, the new shared variables exist only until you deploy the project library again.
You also can use the Variable Reference property with the Variable properties to configure shared variables programmatically.
![]() |
Note You can create shared variables outside of a project library using the VI Server methods. To correct errors you might experience because the shared variable is not in a project library, you can use the AddSharedVariableToLibrary VI in the labview\vi.lib\Utility\Variable directory to programmatically add shared variables to a library. You also can use the CreateOrAddLibrary polymorphic VI to programmatically add a library to a project or a parent item such as a target, folder, or another library. |