Labview程式设计 [英] Labview programming

查看:139
本文介绍了Labview程式设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的项目是基于物理的激光雷达.整个设备连接到由各种传感器组成的服务器.服务器提供有关设备的全部信息,例如温度,湿度等.服务器和笔记本电脑通过LAN连接.我们的工作是使用labview开发一款将设备与笔记本电脑连接的软件.为此,我们首先必须将服务器连接到笔记本电脑.我们已经在labview中以多种方式尝试使用TCP/IP vi.服务器和客户端程序都需要执行此操作.在服务器程序中,我们使用TCP侦听,在客户端程序中,我们使用TCP开放式连接.应该为TCP侦听和TCP开放连接提供哪个IP地址和端口地址?

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 ?

推荐答案

IP地址和端口应参考此代码段中所示的服务器(用您选择的端口替换端口,并用您的服务器地址替换localhost):

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):

上面显示的示例代码有两个代码块,TCP Server应该在您的服务器上运行,而TCP Client应该在您的笔记本电脑上运行.然后,需要将远程地址更改为服务器的地址.使用上面的示例仅显示如何建立连接以及在关闭连接之前传输单个数据.您需要包装一些额外的代码,以提供服务器与便携式计算机之间的任何握手,以在您的应用程序中提供所需的功能.

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.

在LabVIEW中,您将找到一些有关如何使用TCP函数的示例,从顶部菜单中选择帮助"和查找示例...",然后在TCP中使用搜索"选项卡类型,您将看到简单" TCP.lvproj'应该可以为您带来帮助.

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.

这篇关于Labview程式设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆