From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Ex - Example of Basic Telnet Echo Project

Code and Documents

Attachment

Overview
This example VI shows how use the Telnet vi to send a message to another computer that is listening for a telnet message.

 


Description
This Example include two VIs one named "Open Sender.vi" the other named "Listener.vi". Each one should run at different computers. Once the listener receives the message it resends the received message back to the sender.

Ensure the example can run successful, the computer running "Open Sender.vi" should enable VI server (Go to Tools » Options » VI Server enable TCP/IP and under Machine  Access add the IP address of the target computer the Listener will be on). And the computer running "Listener.vi" should also enable VI server (Go to Tools » Options » VI Server enable TCP/IP and under Machine  Access add the IP address of the target computer the Listener will be on).

 


Requirements

  • LabVIEW 2012 (or compatible)
  • LabVIEW Internet Toolkit 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download and unzip the attached folder to your computer
  2. Open the VI "Open Sender.vi" and the VI "Listener.vi" on different computers
  3. Enable the VI Server of each VI and input the IP address of target computer and string to send in the front panel controller of "Open Sender.vi"
  4. Run the program of each computer
  5. Click the "Send String Controller" of "Open Sender.vi"

 

Additional Information or References
VI Block Diagram of "Open Sender.vi"

 Block Diagram.PNG

 

VI Block Diagram of " Listener.vi"

 Block Diagram.PNG

 

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

 

BeauH
Applications Engineer
National Instruments

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

Comments
awang
Member
Member
on

can it work in different network , just as one IP address is 10.200.253.1 and another IP address is 10.200.254.2 ? thanks!

Beau_H
NI Employee (retired)
on

Hey awang,

Yes this program will communicate with another IP address, but remember you have to add the IP to the computer you are communicating with to the VI servers allowed computers.

Cheers

BeauH

BeauH
Applications Engineer
National Instruments