Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Binding Front Panel Controls to Shared Variables in Other Projects

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Bind a front panel control to a network path if the VI from which you want to manipulate the front panel control is not in the same project as the VI with the front panel control.

Complete the following steps to control a front panel control from another VI using a network path to a shared variable in another project or to an NI Publish-Subscribe Protocol (NI-PSP) data item.

  1. Create a shared variable.
  2. Create a VI with a control in the front panel window to write the front panel data to the variable you created. Right-click the control and select Properties from the shortcut menu. On the Data Binding page of the Properties dialog box, select the Read/Write option in the Access Type pull-down menu.
  3. Run the VI.
  4. In the front panel window of a second VI, either on the local computer in another project or on a remote computer, bind a front panel control to the NI-PSP data item to which you wrote in step 1.
Note  To bind a front panel control, the front panel window must be open in the application instance for a target in a project.
  1. Right-click a front panel object and select Properties from the shortcut menu to display the Properties dialog box for the object.
  2. Click the right arrow button to navigate to the Data Binding page of the Properties dialog box.
  3. Select Shared Variable Engine (NI-PSP) from the Data Binding Selection pull-down menu.
  4. Click the Browse button to browse to the data item you selected in step 1.
  5. In the Select Source Item dialog box, select the Network Items option from the Network-Published Source item pull-down menu.
Note  You can bind shared variables only to shared variables in other projects and data items that are currently deployed.
  1. Click the OK button to close the Select Source Item dialog box.
  2. Click the OK button to close the Properties dialog box.
  1. Run or continually run both VIs. 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.

The front panel control in the first VI retrieves the value the second VI passes through the connection. When a user changes the control value in the second VI, the connection writes the new value to the front panel control in the first VI. If the front panel control has write-only access, the control writes the initial value when the VI runs or every time the VI resets if the VI runs continuously. If the front panel control has read-only or read/write access, the control reads the initial value when the VI runs.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit