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

Embedding a VI in an Existing HTML Document

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info
Download Help (Windows Only)

National Instruments recommends you use the Web Publishing Tool to create an HTML document and embed VIs so a client computer can view and control the front panel of the VI in a Web browser.

However, if you already have an HTML document, use the following syntax to embed a VI in the HTML document so a client computer can view and control the front panel of the VI in a browser. Include the parameter in brackets [ ] if the VI you want clients to view and control is located on a remote computer. Store the HTML document in the Web Server root directory. Refer to Web Server Syntax Examples for examples of embedding VIs in HTML documents.

The client and server computers must be running the same version of the remote panel protocol in 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.

Note  Different versions of the LabVIEW browser plug-in can run concurrently, but they communicate with different remote front panel servers. Each browser plug-in can display VIs developed in the same version of LabVIEW. The HTML OBJECT/EMBED tag determines which plug-in the browser loads. For the LabVIEW ActiveX control, the CLASSID you specify in the OBJECT tag determines which plug-in to load. The CLASSID for each version of the plug-in is different. For the Netscape browser plug-in, the MIME type you specify in the EMBED tag determines which plug-in to load. Refer to the LabVIEW Help in the previous versions of LabVIEW for more information about the syntax used in those versions. Changes between versions are highlighted in bold in the following example.

<SCRIPT language="JavaScript"><!--
var lng; if (navigator.userLanguage) { lng = navigator.userLanguage; };
if (navigator.language) { lng = navigator.language.toLowerCase(); };

var obj = '<OBJECT ID="LabVIEWControl" CLASSID="CLSID:A40B0AD4-B50E-4E58-8A1D-8544233807AC"
WIDTH=x HEIGHT=x CODEBASE="ftp://ftp.ni.com/support/labview/runtime/windows/8.5';
if (lng.indexOf("fr") != -1) { obj = obj + '/French'; }
else if (lng.indexOf("de") != -1) { obj = obj + '/German'; }
else if (lng.indexOf("ja") != -1) { obj = obj + '/Japanese'; }
obj = obj + '/LVRunTimeEng.exe">';

document.write(obj); // --></SCRIPT>
<PARAM name="LVFPPVINAME" value="VI_NAME">
<EMBED SRC=".LV_FrontPanelProtocol.rpvi85" LVFPPVINAME="VI_NAME" TYPE="application/x-labviewrpvi85" WIDTH=x HEIGHT=x PLUGINSPAGE="http://digital.ni.com/express.nsf/express?openagent&code=ex3e33&"></EMBED>
</OBJECT>

Note  If clients access the VIs using the LabVIEW ActiveX control you need only to include the <OBJECT> tag information. If they access the VIs using the Netscape plug-in, you need only to include the <EMBED> tag information. However, to best support all potential clients with various configurations, you should include both the <OBJECT> and <EMBED> tags. This makes sure all clients can access the VIs remotely using a browser.

The following list describes the parameters you must configure.

ParameterDescription
OBJECT WIDTHWidth of the front panel in pixels.
OBJECT HEIGHTHeight of the front panel in pixels.
CODEBASE The location of the LabVIEW Run-Time Engine installer, including the name of the .exe file, for clients who access VIs using the LabVIEW ActiveX Control.
VI_NAME The name of the VI, such as Example.vi. VI_NAME does not include path or directory names even if the VI is located in a subdirectory or inside a .llb file.
COMPUTER_NAME or IPADDRESS If the VI is located on a remote computer, you must supply the domain name of the computer, such as http://foo or the IP address of the computer, such as http://130.164.76.753.
EMBED SRC If the VI is located on the local computer, set this parameter to .LV_FrontPanelProtocol.rpvi7. If it is located on a remote computer accessible through the computer name, set the parameter to http://foo/.LV_FrontPanelProtocol.rpvi7, where foo is the computer name. If it is accessible through the IP address, set the parameter to http://IPADDRESS/.LV_FrontPanelProtocol.rpvi7, where IPADDRESS is the IP address.
EMBED WIDTH Width of the front panel in pixels.
EMBED HEIGHT Height of the front panel in pixels.
PLUGINSPAGE The URL where clients can download the LabVIEW Run-Time Engine installer, for clients who access VIs using the Netscape plug-in.

Resources

WAS THIS ARTICLE HELPFUL?

Not Helpful