Example Code

Using TCP Functions to Connect to a HTTP Server in 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

 Overview

Demonstrates how to request a resource from a HTTP server.

 

Description

This VI shows how to use TCP to connect to a HTTP server and request a resource. Any available resource may be requested (HTML, image, etc.). Refer to the Web for more information about the HTTP protocol specifications.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Run the VI
  2. The program will send a "get" command to ni.com and receive the HTML code from the website

 

Additional Information or References

 

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

 

John Passiak

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