How do I send data from LabView to Python and get a result back?
解决方案
One other solution is using the smart messaging library ZeroMQ, which comes with a lot of bindings, almost for all major languages.
For the Python/Labview case there is a nice demo project on sourceforge:
Client-side ~LabVIEW

+
Server-side part (example)
#-----------------------------------------# INFRASTRUCTURE for communication
context = zmq.Context() # I/O-DAEMON CONTEXT
socket = context.socket(zmq.REP) # ARCHETYPE for a Smart Messaging
socket.bind( "tcp://127.0.0.1:5555" ) # PORT ready for LabView to .connect()
#-----------------------------------------# TRANSPORT-CLASS-es

本文介绍如何使用ZeroMQ库实现LabVIEW与Python之间的数据通信。通过创建一个在LabVIEW端作为客户端,Python端作为服务器的示例,展示了如何发送数据并接收返回结果。Python服务器在127.0.0.1:5555端口监听,接收LabVIEW的请求,执行eval()函数处理请求,并将结果回传给LabVIEW。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



