You can read or write front panel data only for network-published shared variables. Complete the following steps to read or write front panel data from a shared variable.
- Right-click a front panel object and select Properties from the shortcut menu to display the Properties dialog box for the object.
- Click the right arrow button to navigate to the Data Binding page of the Properties dialog box.
- Select Shared Variable Engine (NI-PSP) from the Data Binding Selection list.
- Click the Browse button to navigate to the shared variable to which you want to bind the control.
- In the Select Source Item dialog box, verify that the Project Items option is selected in the Network-Published Source pull-down menu.
- Select the shared variable and click the OK button.
 |
Note If you want to read or write shared variable data from a VI that is not in a LabVIEW project, you cannot use the Project Items option. Select the Network Items option in the Network-Published Source pull-down menu instead to bind the front panel object to a shared variable that is not in a project or to an NI Publish-Subscribe Protocol (NI-PSP) data item. However, the VI might break if the shared variable in another project or the data item is moved or unavailable. |
- On the Data Binding page, select Read from the Access Type pull-down menu to configure the control to read the shared variable data, or select Write from the Access Type pull-down menu to configure the control to write the shared variable data.
- Click the OK button.
- On the block diagram, create a While Loop to configure the VI to run continuously.
- Run the VI. LabVIEW either writes the data from the front panel object to the shared variable or data item you select or retrieves the data and displays it in the front panel object of the VI.
While the VI is running, if the connection to the Shared Variable Engine is successful, a small green indicator appears next to the front panel object on the VI. If the connection is not successful, a small red indicator appears. Before LabVIEW attempts to connect to the server, a small transparent indicator appears. A status message also appears if you move the cursor over the indicator. You can hide this indicator by right-clicking the front panel object and selecting Visible Items»PSP LED from the shortcut menu. You also can use the Data Binding:LED Visible property to hide the indicator programmatically.