Overview: Web-based Communication with a LabVIEW Application (Real-Time, Windows)

LabVIEW 2018 Help

Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)

LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help
LabVIEW 2020 Help

A web client can exchange data with a remote LabVIEW stand-alone application over a network through LabVIEW Web services. A Web service consists of VIs and other files running on a server that respond to HTTP requests from clients.

Note  LabVIEW Web services are available only in the LabVIEW Full Development System and the LabVIEW Professional Development System.

Web services are useful in the following situations:

  • Users can invoke the Web service VIs with any HTTP-capable web client, including a standard web browser, to exchange data using a URL and standard HTTP methods such as POST. For example:
    • Uploading new parameters to an application
    • Retrieving current state or status
  • Users can remotely monitor and control embedded applications using custom thin clients. For example:
    • Updating application state
    • Starting or stopping a process
  • You can conduct application-to-application data exchange between numerous HTTP-capable devices and software from both National Instruments and third parties. For example:
    • Connecting to non-LabVIEW clients
    • Implementing security and authentication

Do not use Web services in the following situations:

  • Continuous data streaming
  • Rapid polling
  • Real-time processing

The following figure shows common components and processes involved in many LabVIEW Web service applications.

LabVIEW Project on Host Computer Publishing the Web Service Published Web Service Transferring Data between the Web Service and Clients Web Clients Transferring Data between the Web Service and Embedded Applications Embedded LabVIEW Application

(1) LabVIEW Project on Host Computer

  • On a host computer with LabVIEW installed, develop the Web service in a LabVIEW project.
  • If the Web service will exchange data with a LabVIEW stand-alone application, you can develop the application in the same project.
  • Start a debugging session, where you can test and debug the Web service on a server that acts like a sandbox environment.
  • Include the Web service in the build specification for a stand-alone application to allow it to be distributed with the application. Or include the Web service in an installer to publish the Web service on a Windows computer without LabVIEW.

Related Information

Tutorial: Creating and Accessing a LabVIEW Web Service

Components of a Web Service

Testing and Debugging a Web Service

Including a Web Service in a Stand-Alone Application or Installer

(2) Publishing the Web Service

From the project, you can perform the following actions to distribute or run the Web service:

  • Build and distribute a stand-alone application that includes the Web service. The application publishes the Web service when it starts running.
  • Publish a stand-alone Web service on the host computer or a connected RT target. The Web service starts running immediately.
  • (Windows) Build and distribute an installer that includes the Web service. Installers publish Web services when they run on a Windows computer.

Related Information

Publishing a Web Service

(3) Published Web Service

Web services run on a web server. If the Web service is part of a LabVIEW stand-alone application, it runs on a web server specific to the application. If the Web service is stand-alone, it runs on the Application Web Server. A Web service starts and stops running under different conditions, depending on how you publish it to the host server.

Related Information

Hosting Web Services

Publishing a Web Service

(4) Transferring Data between the Web Service and Clients

A web client, such as a browser, exchanges data with a Web service by sending an HTTP request to a specific URL. LabVIEW maps a URL to each HTTP method VI, so the specific URL that the client uses determines which HTTP method VI receives the HTTP request. The request might contain values to assign to specific parameters in the HTTP method VI. After each request, the HTTP method VI can process those values and return a response. The Web service returns data to the web client in a particular format that you configure, such as XML.

Note   Each time a client reconnects to an HTTP method VI, such as when it refreshes the browser, the client sends a new HTTP request.

In a simple example, a web client might submit an HTTP request that contains two numbers to an HTTP method VI that calculates and returns the sum.

Related Information

Developing HTTP Method VIs: Choosing the Format of Output Data

Using the POST HTTP Method

Processing POST Data, Form Data, and Uploaded Files

Configuring HTTP Headers, Streaming, and Buffering

(5) Web Clients

Supported web clients include any HTTP-enabled platform, such as standard web browsers, HTML forms, third-party software, and VIs that utilize the HTTP Client palette.

Related Information

Sending Data to a Published Application using URLs

Understanding URL Mapping in Web Services

(6) Transferring Data between the Web Service and Embedded Applications

When included in a stand-alone application, Web services run in the main application instance. You can implement communication between the application and Web service with many features and protocols for which LabVIEW provides APIs.

(7) Embedded LabVIEW Application

Web services can communicate with LabVIEW stand-alone applications running on a target. An example of an embedded application is a start-up application deployed to an RT target.

Related Information

Including a Web Service in a Stand-Alone Application or Installer

Developing and Distributing an Application

Data Communication Methods Home


Not Helpful