Labview programming

2.2k views Asked by At

Our project is LIDAR which is based on physics. The total equipment is connected to server which consists of various sensors. Server gives total information about the equipment like temperature, humidity etc. Server and laptop are connected through LAN. Our work is to develop a software using labview which interfaces the equipment with the laptop. To achieve that first we have to connect the server to the laptop. We have tried in so many ways using TCP/IP vi in labview. Both server and client programs are required to do this. In the server program we are using TCP Listen and in the client program we are using TCP open connection. Which IP address and port address should be given to TCP listen and TCP open coonection ?

2

There are 2 answers

6
Swinders On

The IP address and port should refer to the server as shown in this snippet (replace port with your chosen port and localhost with your server address):

enter image description here

The example code I have shown above has two code blocks, the TCP Server should run on your server and the TCP Client should run on your laptop. The remote address would then need to be changed to the address of your server. Using the above example only shows how the connection is made and a single item of data transferred before closing the connection. You would need to wrap up some extra code to provide any handshaking between the server and laptop to provide the required functionality in your application.

In LabVIEW you will find some examples on how to use the TCP function, from the top menu select 'Help' and 'Find Examples...' then using the 'Search' tab type in TCP and you will see 'Simple TCP.lvproj' that should give you something that will get you going.

0
crcarlin On

If your project doesn't specifically require you to use the TCP listen/open VIs then you might want to consider some of the built in networking functionality that comes with LabVIEW.

I've had good luck with LabVIEW's network shared variables stuff where you can, among other things, connect a front panel control on the client to a variable shared by the server, and LabVIEW takes care of all of the TCP functions behind the scenes.

Here's one webpage about the feature: http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/ni_psp/