如何使用Python脚本控制LabView VI前面板开关(打开/关闭,条形调节器)? [英] How to control LabView VI front panel switches (on/off, bar adjuster) using Python scripts?

查看:533
本文介绍了如何使用Python脚本控制LabView VI前面板开关(打开/关闭,条形调节器)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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.

推荐答案

我在LabVIEW讨论板上找到了一个参考,该参考在

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

似乎您需要使用Python中的win32com.client库.

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

这篇关于如何使用Python脚本控制LabView VI前面板开关(打开/关闭,条形调节器)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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