[英]How to control GUI from labview?
I have a requirement where I have to edit the settings of the GUI. 我有一个必须在其中编辑GUI设置的要求。 Suppose if I will open a
notepad
now I need to change the setting by labview
. 假设现在打开
notepad
需要setting by labview
更改setting by labview
。 eg changing the font
. 例如改变
font
。 How can i do it? 我该怎么做? Please help me.
请帮我。
http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/creating_configuration_files/ http://zone.ni.com/reference/zh-XX/help/371361H-01/lvconcepts/creating_configuration_files/
One way to do it would be with a config file, property nodes associated with the front panel items you want to edit, and a button to activate a new event case. 一种方法是使用配置文件,与要编辑的前面板项目关联的属性节点以及用于激活新事件案例的按钮。 This is assuming your GUI or main VI already has a working event structure (I don't know any other way to have a GUI w/o an event structure).
假设您的GUI或主VI已经具有有效的事件结构(我不知道有没有事件结构的GUI的任何其他方法)。
In the event case, you would have it read the config file, return the keys, and based on the key value, change the value of a property node. 在这种情况下,您可以让它读取配置文件,返回键,并根据键值更改属性节点的值。 If you know your property node takes some number value or a string, then you could directly wire the key value to the property node.
如果您知道属性节点采用某个数字值或字符串,则可以直接将键值连接到属性节点。 Alternatively, you can send your keys as the input to a case structure.
或者,您可以将密钥作为输入发送到案例结构。 Then in your case structure, hardcode the options you want to send to your property node.
然后在案例结构中,对要发送到属性节点的选项进行硬编码。
For example, to change the font (see http://digital.ni.com/public.nsf/allkb/6BD344ACA4DEE20A8625692700737E16 ), you can directly wire the output of the Read Key.vi to the Text.FontName input of the property node. 例如,要更改字体(请参见http://digital.ni.com/public.nsf/allkb/6BD344ACA4DEE20A8625692700737E16 ),可以将Read Key.vi的输出直接连接到属性节点的Text.FontName输入。 。
Then you can use notepad to edit your GUI settings "on the fly". 然后,您可以使用记事本“即时”编辑GUI设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.