Home
Quickstart Guide
Introduction RIO Academic RIO Application examples Your first RT app Your first FPGA app
Real-Time
Basic procedures System admin File system I/O monitor System controller architecture Timed loops Inter-process communication RT/Host communication RT/FPGA communication FPGA personalities Interrupts Datalogger (file I/O)
FPGA
Design flow Simulation Inter-process communication RT/host communication Derived clock domain IP blocks FPGA personality
Networking
Get connected Email Web services UDP TCP IP addresses
Site Map
Guides Code examples Procedures Tags LabVIEW block diagram elements Targets Communications All pages
Glossary How to use About
RIO Developer Essentials Guide for Academia
RT guide

Web services overview

A "Web service" uses the infrastructure of the Web for machine-to-machine exchange of specific information. The Academic RIO Device can call Web services to retrieve information and can also host Web services to provide information to other systems.

Globe and binoculars icons

Overview

What is a Web service?

A Web service uses the infrastructure of the Web for machine-to-machine exchange of specific information. Web services may also be known as “APIs” (Application Program Interfaces) and “JSON feeds” – JSON (JavaScript Object Notation) represents structured information in an easy-to-parse form.

Get a feel for web services by considering these example web service requests which are simply URLs that include query information; follow the links with your Internet browser:

How might calling a Web service be useful for my project?

See the API directory at ProgrammableWeb to get a sense of the enormous variety of information resources and tools available as web services. For example, your LabVIEW application running on the Academic RIO Device could look up information stored in a database, post a photo to Twitter or Instagram, check the current weather, or perform OCR (optical character recognition) to convert a webcam image of a document into text.

What should I know about calling a Web service?

  1. A Web service provides a standards-based mechanism to exchange information between your client running on the Academic RIO Device and the server that implements the web service.
  2. Forming the Web service endpoint URL is easy, and forming the query is as simple as assembling a string. Parsing the returned JSON string is also relatively easy because the LabVIEW JSON-related VIs are simple to use, although defining the necessary data type definition of the JSON string returned from a particular API may take some thought.
  3. LabVIEW provides HTTPHyperText Transport Protocol, the basis of the “world wide web” VIs to implement web clients that can exchange information with web servers that host web services. The secure transfer protocol HTTPS is also supported by these VIs.
  4. LabVIEW provides the means to implement your own web service, too
  5. An Internet-capable wireless or wired network connection is required for the Device to access web services outside of your network domain. See ??? for suggested networking configurations for both wireless and wired access.

How might hosting a Web service be useful for my project?

A Web service provides a standards-based mechanism to easily exchange information between your Academic RIO Device and the remote client such as another LabVIEW-based target, an IoT device, or a conventional web browser. Your web service could make sensor measurements available to client machines, and can also control indicators and actuators using the commands obtained from the remote client’s request query string.

What should I know about hosting a Web service?

  1. LabVIEW provides Web Services VIs to implement a web service that can be hosted on the desktop computer or RT host such as the Academic RIO Device.
  2. An Internet connection is required for the Device to provide public web services outside of your network domain. The onboard wireless connection to a home wireless router is probably the easiest way, and you can also establish a wired connection with the X-HUB port and a host PC. You may need to configure your network firewall to allow inbound connections.
  3. Hosting a web service can be useful even if all of your machines are contained within your private network domain.
  4. The LabVIEW Web Services implementation does not presently support secure (SSL) connections.

Code examples

Procedures

Additional guides

For more information

  1. LabVIEW Web Services FAQ (http://www.ni.com/white-paper/7747/en)
    A comprehensive resource describing all aspects of building and deploying Web services on an RT system.
  2. The ProgrammableWeb API Directory (https://www.programmableweb.com/apis/directory)
    Search for thousands of available Web services.