Example Code

Log Data from a Web Service using a queue using LabVIEW

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

Download All

Overview
Demonstrates how to Log Data from a web service using a queue

 

Description
Here is simple example description:

It is often desirable to log data from a web service, but file I/O is relatively slow and can cause a long delay between the web request and the return. This example circumvents this problem by queueing data in the web method and dequeuing it in a background processing loop that runs in the web service.

 

Requirements

  1. LabVIEW 2015 (or compatible)


Steps to Implement or Execute Code

  1. Unzip the file and open "WS Queue Example.lvproj"
  2. Start the web service
  3. Enter the URL "http://127.0.0.1:8001/ws/queueData?name=test&value=1234" in to your browser and submit it several times with any data you'd like to log to a file.
  4. Stop the web service.
  5. Open the log file at <Project Directory>/test data

 

Additional Information or References

VI Snippet

WS Queue NI Verified.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Tanner B.
Systems R&D Engineer - Aerospace, Defense, and Government
National Instruments

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

Comments
sushilplikhar
Member
Member
on

Thank you for this example.

Can you please send me the tutorials and some labview examples.So i can learn by myself.