LabVIEW Web Server

Publishing VI Images

When you use the LabVIEW Web Server to publish the image of a VI, the VI must be in memory, and the Web server must be enabled and correctly configured.

The LabVIEW Web Server uses the .snap? URL to publish panel images. The .snap? is followed by the name of the VI encoded according to URL rules.

For example, if you have a VI with the name Chart.vi loaded, you can type the following text in your browser's URL field (replace host.domain.com with the Internet address of your own computer):

http://host.domain.com/.snap?Chart.vi

The LabVIEW Web Server returns the image of the Chart VI front panel.

Embedding VI Images in HTML Documents

It might not be enough to simply see the image of your VI in the browser. Usually, you want additional text to explain what the image represents. In this case, you can embed the URL link of your VI image in an HTML document.

Most HTML editors allow you to insert an image and then specify the source URL of the image. Type the appropriate URL as described above into the source (or SRC) field of the image.

If you are editing HTML by hand, the tag for the image can be one of the following:

<IMG SRC="/.snap?Chart.vi">
<IMG SRC="http://host.domain.com/.snap?Chart.vi">

The first example uses a relative URL to describe the location of the image. You can use a relative URL when the when the same server publishes the HTML document and the VI image.

The second example uses a full URL. You can use a full URL in HTML documents that any Web server publishes.

Image Animations

The LabVIEW Web Server also can publish animations of VI images. Use the .monitor? URL to retrieve animations of VI images. The .monitor? URL follows the same rules as the .snap? URL.

Things to Consider

Often, the front panel of your VI is quite large, especially if you use a large, high-resolution monitor. When the Web server receives a request for a VI image, it must capture the contents of the front panel window, convert it into an image format, and then send it back to the browser. The larger the window is, the longer it takes the server to create the image, thus slowing down the execution of your VIs. Additionally, a large picture takes significantly more time to transmit to the browser, especially over a slow modem connection.

It is a good idea to keep the panels of VIs that you plan to publish on the Internet small. You might want to create a large VI that contains buttons and other controls that the operator of your application sees and create a second, smaller VI that contains only relevant display information for publishing on the Web.


© National Instruments