微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 测试测量 > 虚拟仪器 > 我也抛块砖

我也抛块砖

时间:12-13 整理:3721RD 点击:
请看附件。
By using property nodes one is able to access all the controls in another VI . In "main_prog.vi" there are some controls in a tab container, and one boolean and one numeric outside. In "all_controls.vi", the "control[]" property only returns the tab and the outside controls. How to access the other controls, including OK button1, OK button 2, knob and the waveform graph, as well?
大家讨论一下?

 main_prog.vi

 all_controls.vi

Invoke Node->Get All Control Values

 all_controls.vi

 main_prog.vi

看不懂鸭!

我的想法是要访问主程序tab里面的控件,通过controls[]得到他们的reference,然后向Value(signaling)写入值,从而可以激发主程序中相应的event。所以这要用property node instead of invoke node. Anyway your comment is very helpful. Thanks very much!
In fact I have solved the problem. If nobody answers this question, I will post my solution in several days.

按顺序获得tab,pages和controls的reference……
见附件

 all_controls.vi

这么实现累不累啊……做到一个vi里面多和谐

Yes, this is exactly same as what I did. Attached please find my original VIs (written in LV71).

 main_prog.vi

 all_controls.vi

You are absolutely right. I could not agree with you more as long as the program is not big. As we all know LabVIEW is generically a multithread language. It is very simple to put parallel code in several while loops. However, if you are developing commercial software, it is not convenient to do so. Once you have more and more panels to handle, I suspect it is better to use producer-customer (or state machine) pattern to develop a main VI to deal with the user interface, and use dynamic call to call the other panels. In such a case, it is inevitable to these techniques we are talking about here.
For example, for the software I am working on there are almost 2000 VIs, with more than 20 panels the user may open. Putting everything in one VI would cause several problems. First of all, the block diagram would be too large to maintain. Second, when the user launches the application, all the VIs are open in memory, which is not efficient, since the user will not open all the 20 panels at one time. Third, it is not easy to change and update the structure. When developing a software, one needs to think further. As you know, all the users would like to ask more functionality and easier interface. In addition, in order to make your software, maybe the company, grow, the developer also needs to keep updating... Therefore how to design a good architecture at the very beginning is an important issue.
I am not saying my idea is better. Please do not make me wrong. Any structure is good as long as it is suitable to the specific application. What I am trying to say here is to share some of my experiences and thoughts of developing commercial software.
I can feel that Baxi, a198145 and many other people are LabVIEW expert. I hope I can learn from you guys on this board. Hehe, Shake hands!
  

哦赞专业人士:)
state machine我不太懂不敢评论,我一般用事件结构做界面觉得还是很方便的,就是一个事件结构放在一个大的while loop内,最多在数据采集等不得已的情况下加一个并行while loop专注于数据采集,两者之间用几个全局变量作通讯实现控制,自认为思路还是很清晰的呵呵
expert不敢当,共同进步吧,而且我们再如何也是研究和实验性质,还需要你这做产品级代码的多多指点:)

zan&con
state machine pattern 也是我编程的首选
羡慕你能参与2000VIs的大项目
能再谈谈做这种庞大项目的体会么?

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top