简体   繁体   English

Labview编程

[英]Labview programming

Our project is LIDAR which is based on physics. 我们的项目是LIDAR,它基于物理学。 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. 服务器提供有关设备的全部信息,如温度,湿度等。服务器和笔记本电脑通过LAN连接。 Our work is to develop a software using labview which interfaces the equipment with the laptop. 我们的工作是使用labview开发软件,将设备与笔记本电脑连接起来。 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. 我们在labview中使用TCP / IP vi尝试了很多方法。 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. 在服务器程序中我们使用TCP Listen,在客户端程序中我们使用TCP开放连接。 Which IP address and port address should be given to TCP listen and TCP open coonection ? 哪个IP地址和端口地址应该给TCP listen和TCP open coonection?

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): IP地址和端口应引用此片段中显示的服务器(将端口替换为您选择的端口,将localhost替换为您的服务器地址):

在此输入图像描述

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. 我上面显示的示例代码有两个代码块,TCP服务器应该在您的服务器上运行,TCP客户端应该在您的笔记本电脑上运行。 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. 在LabVIEW中,您将找到有关如何使用TCP功能的一些示例,从顶部菜单中选择“帮助”和“查找示例...”,然后使用TCP中的“搜索”选项卡类型,您将看到“简单TCP.lvproj” '那应该会给你带来让你前进的东西。

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. 如果您的项目没有特别要求您使用TCP侦听/打开VI,那么您可能需要考虑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. 我已经很幸运使用了LabVIEW的网络共享变量,除此之外,您还可以将客户端的前面板控件连接到服务器共享的变量,LabVIEW负责处理幕后的所有TCP功能。

Here's one webpage about the feature: http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/ni_psp/ 这是一个关于该功能的网页:http: //zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/ni_psp/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM