|Download Help (Windows Only)|
You can pass data between LabVIEW and the Shared Variable Engine (SVE) by using different data access methods. The complexity of the application you build determines the data access method to use. For example, passing data between LabVIEW and the SVE requires significantly more resources than updating a Local Variable in LabVIEW. Therefore, you must minimize the number of writes and reads that you make to or from shared variables in a VI. Though performance varies greatly depending on the system configuration, the SVE can process at least 5,000 updates per second for double-typed shared variables.
You can pass data between LabVIEW and the SVE by using either a static or programmatic data access method. The following table describes static and programmatic data access methods that you can use.
|Data Access Method||Recommended Use||Supported Method||Required Product|
|Static||Small applications that contain a small number of shared variables and do not gain in complexity over time.||Shared Variable nodes||LabVIEW Development System|
|Front panel data binding|
|Programmatic||Applications that contain a large number of shared variables or require dynamic creation of shared variables.||Shared Variable VI and functions|
|Shared variable Event structure support||LabVIEW Datalogging and Supervisory Control (DSC) Module|
You can configure Shared Variable nodes to read data from or write data to the SVE. Shared Variable nodes update automatically if you rename or move the corresponding shared variable in a project. Thus, you also can use this method when you develop an entire application within one project. However, with Shared Variable nodes, you cannot change the source of the data at run time. Shared Variable nodes also are difficult to use in subVIs. Therefore, maintaining or reusing applications developed with this method can be difficult because this method has limited scalability.
You can bind shared variables to a front panel object using the NI-PSP. Binding a front panel object enables you to create a flexible and reconfigurable user interface with minimal programming requirements. You can configure front panel data binding by using VI Server properties and methods. To set the URL of a front panel control bound using the NI-PSP, obtain a control reference to the control or indicator and write to the Data Binding:Path property of the control.
|Note You must configure the control or indicator to bind to the URL that the Network:URL property specifies before you can write to the URL property.|
If you want to allow for a growing application, you can use the Shared Variable VI and Functions with the NI Publish-Subscribe Protocol (NI-PSP) to read data from or write data to the SVE programmatically. The Shared Variable VI and functions behave similarly to the Shared Variable node. However, with the Shared Variable VI and functions, you can reconfigure the source of the data at run time.
The DSC Module enables you to monitor shared variables using the Shared Variables VIs and the Event Structure. Shared variable Event structure support allows you to receive raw event data directly from the SVE. This programming model most closely resembles the execution model running in the SVE. Shared variable Event structure support is read-only but allows you to process all events, including value changes, quality changes, instantiations, and deletions, that the SVE passes. This programmatic data access method is useful in supervisory control applications where the VI needs to take a predefined action upon encountering a change in the system.
Tags are data sources that contain values, traces, alarms, and events of multiple shared variables and I/O server data items. You can manage the following shared variable properties programmatically by using the Tags VIs.