Example Code

Sending Information in a Cluster to Another Computer by TCP/IP 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

Overview

This VI shows how to send information to another PC using TCP/IP Protocol

 

Description

Internet Protocol (IP), User Datagram Protocol (UDP), and Transmission Control Protocol (TCP) are the basic tools for network communication. The name TCP/IP comes from two of the best-known protocols of the internet protocol suite, the Transmission Control Protocol and the Internet Protocol. With TCP/IP you can communicate over single networks or interconnected networks (Internet). TCP/IP communication provides a simple user interface that conceals the complexities of ensuring reliable network communication. With most I/O communication, the processor is always the client that initiates a connection to the disk drive server, the external instrument server, or the DAQ board server. With TCP/IP connections, a computer can function either as the client or the server.

This a very simple VI used to show how to send information, like a cluster for example, to another PC using TCP/IP. You can run the TCP_Server.vi in one computer and the TCP_Client.vi in another. The two VI’s implements the client and the server.

  

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

Client Instructions: 

  1. Input the address of the PC where is running the TCP_Server.vi
  2. Run this VI

Server Instructions: 

  1. Open the TCP_Client.vi
  2. Run this VI first
  3. Change the controls in the cluster to see them in the client

 

Additional Information or References

Client VI Block DiagramSending Information in a Cluster to Another Computer by TCP_IP_Client LV2012 NI Verified BD.jpg

Server VI Block DiagramSending Information in a Cluster to Another Computer by TCP_IP_Server LV2012 NI Verified BD.jpg

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

 

Arturo Gómez | Applications Engineering
Certified LabVIEW Associated Developer

National Instruments Latin America
01-800-010-0793
ni.com/support

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

Comments
Todd S.
NI Employee (retired)
on

Thanks for posting.  Could you please rename your attachments to include the LabVIEW version?  "_lvXX.vi" would be fine.

Todd S.
LabVIEW Community Manager
National Instruments
haidang
Member
Member
on

hi my name's dang,

I want to control a device in a far local by use internet and labview 2009, I used tcp/ip vi but it only active on Lan not internet, please introduce me the way, I thank so much please help me.