Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Controlling a Front Panel Control Remotely Using the dstp, opc, ftp, http, or file Protocol

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Using front panel data binding to control a front panel control remotely through the Shared Variable Engine provides faster and more reliable data transmission than dstp as well as seamless connections to shared variables and NI Publish-Subscribe Protocol (NI-PSP) data items.

Complete the following steps to control a front panel control from another VI using the opc, ftp, or http protocols on Windows, and the dstp and file protocols on all LabVIEW-supported platforms.

Note  You must install the DataSocket Server to control front panel controls remotely using the dstp protocol.
  1. If you are using a dstp connection, launch and configure the DataSocket Server. If you are using an opc, ftp, http, or file connection, skip to step 2.
    1. Open the DataSocket Server by selecting Start»All Programs»National Instruments»DataSocket»DataSocket Server.
    2. Launch the DataSocket Server Manager by selecting Start»All Programs»National Instruments»DataSocket»DataSocket Server Manager.
    3. Click the New Item button to create a predefined data item, and place a checkmark in the Allow Multiple Writers checkbox. Refer to the NI DataSocket Server Help for more information about configuring a connection for multiple writers.
  2. Right-click a front panel object and select Properties from the shortcut menu to display the Properties dialog box for the object.
  3. Click the right arrow button to navigate to the Data Binding page of the Properties dialog box.
  4. Select DataSocket from the Data Binding Selection pull-down menu.
  5. On Windows, enter an opc, ftp, or http URL, or on all LabVIEW-supported platforms enter a file or dstp URL in the Path text box. You also can select DSTP Server or File System on all LabVIEW-supported platforms from the Browse pull-down menu to navigate to a URL for the predetermined data item you created in step 1c.
  6. On the Data Binding page, select Read/Write from the Access Type pull-down menu.
  7. Click the OK button.
  8. Run the VI.
  9. In a second VI (either on the local computer or on a remote computer), right-click a front panel object and select Properties from the shortcut menu to display the Properties dialog box for the object.
  10. Click the right arrow button to navigate to the Data Binding page of the Properties dialog box.
  11. Select DataSocket from the Data Binding Selection list.
  12. Select DSTP Server or File System from the Browse pull-down menu to navigate to the URL you entered in step 5.
  13. On the Data Binding page, select Read/Write from the Access Type pull-down menu.
  14. Run or continually run both VIs. While the VI is running, if the connection to the DataSocket Server 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»DataSocket LED from the shortcut menu. You also can use the DataSocket: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 DataSocket connection. When a user changes the control value in the second VI, the DataSocket 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.


 

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