Example Code

LabVIEW 2013 Web Service example

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Description

This example is built from the following tutorial. It demonstrates how a web service is hosted on a host PC as well as a real-time target. This functionallity has only been implemented in LabVIEW 2013.

 

Tutorial: Creating and Accessing a LabVIEW Web Service (Real-Time, Windows)

 

To run the web service, open the project, right click on the HostPC web service and select 'start'. You should then be able to navigate to

 

http://127.0.0.1:8001/PCWebService/AdditionalOperations/Subtract?b=3&a=4

 

Which will display the raw xml data for subtracting 3 from 4.

 

To do the same for a Real-Time taget, connect to your target and perform the same steps as above, but replace the 127.0.0.1 with your target's IP address.

National Instruments
Staff Certification Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.