Skip to content

Basic TCP Connection in Labview. Sending data from one sensor to another on the same computer or different.

Notifications You must be signed in to change notification settings

spailll/LabviewTCPTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Basic LabView program to send and receive data for one sensor over TCP

This program involves two VIs, the Send.vi and Read.vi

Send.vi

  • This program involves a TCP open connection node, two TCP write nodes, and a TCP close connection node
  • All timeout values are set to -1 so it doesn't timeout
  • The TCP open connection node is initialized with a PORT value
  • The error and the connection are passed into the while loop, which iterates once per second
  • Inside the loop, the program first attempts to receive a packet that is 1 byte in size (4 bits, 0-15)
  • First, the thermometer data is converted to a string
  • the length of the string is then converted to a string and is sent out preliminarily
  • The thermometer string data is then sent out on the port
  • This continues until the stop is called, at which time the connection is closed and any error is passed

Read.vi

  • This program involves a TCP Listener node, two TCP read nodes, and a TCP close connection node
  • All timeout values are set to -1 so it doesn't timeout
  • The TCP listener node is initialized with a PORT value and with a blank string converted to an ip, which returns the local machine ip.
  • The error and the connection are passed into the while loop, which iterates once per second
  • Inside the loop, the program first attempts to receive a packet that is 1 byte in size (4 bits, 0-15)
  • After the length data is received, the length is converted to an int and passed to the next receive node where the actual data is received
  • The String is converted to a number and the thermometer is set to the value
  • This continues until the stop is called, at which time the connection is closed and any error is passed

About

Basic TCP Connection in Labview. Sending data from one sensor to another on the same computer or different.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published