如何使用Python脚本控制LabView VI前面板开关(开/关、条调节器)?

发布于 2024-09-15 07:36:43 字数 98 浏览 2 评论 0原文

我有一个 LabView 前面板控制硬件的开关和传感器电压调节器,需要使用 Python 脚本来控制它们。我对LabView了解不多。请解释如何做到这一点。

I have a LabView front panel controlling switches and sensor voltage adjustors to the hardware and need to control these with a Python script. I do not have much knowledge of LabView. Please explain how this could be done.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

难以启齿的温柔 2024-09-22 07:36:43

我在LabVIEW讨论板上找到了一篇参考文献,该参考文献成功this,它使用以下代码:

import win32com.client //load the interface
labview = win32com.client.Dispatch("Labview.Application") //get a ref to the Labview application
VI = labview.getvireference(r'C:\TEMP\python.vi') //load the VI
VI.setcontrolvalue('Numeric','5') //set the control 'numeric' to 5

看来您需要 Python 中的 win32com.client 库。

I found one reference on the LabVIEW discussion board that succeeded in this, it uses the following code:

import win32com.client //load the interface
labview = win32com.client.Dispatch("Labview.Application") //get a ref to the Labview application
VI = labview.getvireference(r'C:\TEMP\python.vi') //load the VI
VI.setcontrolvalue('Numeric','5') //set the control 'numeric' to 5

It seems like you need the win32com.client library in Python.

不必了 2024-09-22 07:36:43

您还可以使用 Mark E. Smith 的优秀文章 XML-RPC 包

You can also push data between LabVIEW and Python using Mark E. Smith's excellent XML-RPC package.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文