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

Viewing and Controlling Front Panels Remotely with the Web Server

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

You can view and control a VI front panel remotely, either from within LabVIEW or from within a Web browser, by connecting to the LabVIEW built-in Web Server. When you open a front panel remotely from a client, the Web Server sends the front panel to the client, but the block diagram and all the subVIs remain on the server computer. You can interact with the front panel in the same way as if the VI were running on the client, except the block diagram executes on the server. Use this feature to publish entire front panels or to control your remote applications safely, easily, and quickly.

Note  Use the LabVIEW Web Server if you want to control entire VIs. Use shared variables to read and write data on a single front panel control in a VI.

Configuring the Server for Clients

The user at the server computer must first configure the server before a client can view and control a front panel remotely using LabVIEW or a Web browser. Configure the Web Server by selecting Tools»Options and selecting the Web Server pages from the Category list. Use these pages to control browser access to the server and to specify which front panels are visible remotely. You also can use these pages to set a time limit on how long a remote client can control a VI when multiple clients are waiting to control the VI.

The Web Server allows multiple clients to connect simultaneously to the same front panel, but only one client at a time can control the front panel. The user at the server computer can regain control of any VI at any time. When the controller changes a value on the front panel, all client front panels reflect that change. However, client front panels do not reflect all changes. In general, client front panels do not reflect changes made to the display on front panel objects, but rather to the actual values in the front panel objects. For example, if the controller changes the mapping mode or marker spacing of a scale of a chart or if the controller shows and hides a scroll bar for a chart, only the controller front panel reflects these changes.

Viewing and Controlling Front Panels in LabVIEW or from a Web Browser

A client can view and control a front panel remotely from LabVIEW or from a Web browser.

The client and server computers must be running the same version of LabVIEW. If you are using a browser to view and control a remote front panel, you must use a version of the LabVIEW Run-Time Engine compatible with the version of LabVIEW on the server computer. Also, contact the server administrator to verify that the HTML document specifies the correct version of the LabVIEW Run-Time Engine.

Note  Before you can view and control a front panel remotely, you must enable the Web Server on the server computer where the VI or application you want to view and control is located.

Viewing and Controlling Front Panels in LabVIEW

To view a remote front panel using LabVIEW as a client, select Operate»Connect to Remote Panel to display the Connect to Remote Panel dialog box. Use this dialog box to specify the server Internet address and the VI you want to view. By default, the remote VI front panel is initially in observer mode. You can request control by placing a checkmark in the Request control checkbox in the Connect to Remote Panel dialog box when you request a VI. When the VI appears on your computer, you also can right-click anywhere on the front panel and select Request Control from the shortcut menu. You also can access this menu by clicking the status bar at the bottom of the front panel window. If no other client is currently in control, you have control of the front panel. If another client is currently controlling the VI, the server queues your request until the other client relinquishes control or until the control time limit times out. Only the user at the server computer can monitor the client queue list by selecting Tools»Remote Panel Connection Manager. If you want to save the data generated by a VI running on a remote computer, use TCP instead of remote front panels.

All VIs you want clients to view and control must be in memory on the server computer. If the requested VI is in memory, the server sends the front panel data of the VI to the requesting client. If the VI is not in memory, the Connection status section of the Connect to Remote Panel dialog box displays an error message.

Viewing and Controlling Front Panels from a Web Browser

If you want clients who do not have LabVIEW installed to be able to view and control a front panel remotely using a Web browser, they must install the LabVIEW Run-Time Engine. The LabVIEW Run-Time Engine includes a LabVIEW browser plug-in package that installs in the browser plug-in directory. The LabVIEW DVD or CD contains an installer for the LabVIEW Run-Time Engine.

(Linux) If you installed Netscape, Mozilla, or Firefox in the default location, the LabVIEW installation program automatically installs the browser plug-in necessary to view and control front panels remotely using a Web browser. Otherwise, you can install the browser plug-in manually by installing the LabVIEW Run-Time Engine and then copying /usr/local/lib/LabVIEW-2012/LV2012NPlugin.so to the browser plug-in directory such as usr/lib/netscape/plugins, /usr/lib/mozilla/plugins, or /usr/lib/firefox/plugins.

Clients install the LabVIEW Run-Time Engine and the user at the server computer creates an HTML file that includes an <OBJECT> and <EMBED> tag that references the VI you want clients to view and control. This tag contains a URL reference to a VI and information that directs the Web browser to pass the VI to the LabVIEW browser plug-in. Clients navigate to the Web Server by entering the Web address of the Web Server in the address or URL field at the top of the Web browser window. The plug-in displays the front panel in the Web browser window and communicates with the Web Server so the client can interact with the remote front panel. Clients request control by selecting Request Control of VI at the bottom of the remote front panel window in their Web browser or by right-clicking anywhere on the front panel and selecting Request Control of VI from the shortcut menu.

If no other client is currently in control and if no other browser window on the same connection is currently in control, you have control of the front panel. If another client is currently controlling the VI, the server queues your request until the other client relinquishes control or until the control time limit times out. Only the user at the server computer can monitor the client queue list by selecting Tools»Remote Panel Connection Manager.

Multiple Clients Simultaneously Controlling Remote Front Panels

Multiple clients can control an application or VI remotely at the same time. To allow simultaneous control of a VI, the VI must be reentrant. To make a VI reentrant, select File»VI Properties, select Execution from the Category list, and select either Shared clone reentrant execution or Preallocated clone reentrant execution. LabVIEW opens a clone of the reentrant VI for each client request for a remote front panel. You can use the Web Server:VI Access List property to programmatically limit access to clones already in memory for remote front panel connections.

Functionality Not Supported in Viewing and Controlling Remote Front Panels

The following list includes functionality not supported and recommendations to consider when viewing and controlling remote front panels.

  • Because of the constraints of a Web browser, user interface applications that attempt to manipulate the dimensions and location of a front panel do not work properly when that front panel is displayed as a part of a Web page. Although the Web Server and the LabVIEW browser plug-in attempt to preserve the fidelity of complex user interface applications—in particular, those that present dialog boxes and subVI windows—some applications might not work properly in the context of a Web browser. National Instruments recommends that you do not export these types of applications for use in a Web browser.
  • Avoid exporting VIs that have While Loops but no wait function. These VIs prevent background tasks from performing in a reasonable amount of time, making front panels unresponsive when viewed or controlled remotely.
  • Some VIs might not work exactly the same way from a remote computer as they do when run locally. Embedded .NET and ActiveX controls do not display on a remote client because they draw and operate almost completely independently of LabVIEW. If a VI presents the standard file dialog box, the controller receives an error because you cannot browse a file system remotely. Also, the browse button of a path control is disabled in remote panels.
  • Clients viewing a front panel remotely might see different behavior depending on whether the front panel they are connecting to is from a built application. Specifically, if the front panel is from a built application, any programmatic changes to the front panel made before the client connects to the front panel are not reflected on the client computer. For example, if a Property Node changes a caption on a control before a client connects to that front panel, the client will see the original caption of the control, not the changed caption.
  • Only a controller can remotely view the front panel of a VI dynamically opened and run using the VI Server or the front panel of a subVI configured to display the front panel when called. Clients not controlling the VI cannot view the front panel.
  • Block diagrams that achieve certain user interface effects by polling properties of a front panel control might experience decreases in performance when you control the VI from a remote computer. You can improve the performance of these VIs by using the Wait For Front Panel Activity function.
  • LabVIEW cannot generate a Panel Close event for a VI being viewed or controlled remotely. If you are viewing or controlling a VI remotely, LabVIEW can generate events only in the Control class, that is not in the Application or VI class.

 

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