NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

求助:建子vi中的属性节点问题

已解决!
转到解答

我需要建一个子vi,但vi中有可见和位置的属性节点,生成子vi后,原来的属性节点都不起作用,请问有什么方法R{)ICO3O9`F4I7_3M47GTKY.jpg

如图,原来要实现的功能是让布尔和布尔2重合,随输入数值确定是否可见,但生成子vi后,就不能实现这些功能了,路过的大神指教一下

0 项奖励
1 条消息(共 12 条)
6,010 次查看

从图上分析,似乎是要在子VI中,利用属性节点修改主VI中的控件属性,那这样做是无法实现的。

 

子VI修改主VI中的控件,不能直接采用数据流方式,应该传入控件的引用到子VI中。这类似于C语言中的指针传递和值传递之间的区别。

陈树学
QQ:276509891 .
EMAIL:CSXCS_366@126.COM
qq群:78561268 80754347 37591940
http://labview.weebly.com/
新书《LabVIEW实用工具详解》已经发售,敬请关注。
2 条消息(共 12 条)
5,997 次查看

哎,谢谢了,看来只能一个一个的重复写了,

0 项奖励
3 条消息(共 12 条)
5,990 次查看

呵呵,再问你个问题,在vi中利用用颜色属性节点,是布尔在case不同的情况下显示不同的颜色,可是我把布尔控件自定义后,改成了其他的形状,颜色就不改变了,应该怎么解决呢

0 项奖励
4 条消息(共 12 条)
5,988 次查看
解答
接受人 abczhwsdust

Please also see this similar post 顶层界面如何与子VI的数据实现同步显示。

 

The example uses Refnum (Reference) for updating caller's control/ indicator with sub-VI's data at runtime.

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
5 条消息(共 12 条)
5,984 次查看

Thanks for your answer to my question. I have solved the question. However, I 遇到这样一个情况未命名.JPG未命名1.JPG

第一个是直接调用的引用句柄函数(refnum),第二个是使用右键->创建->属性节点->引用实现的,结果,第一个就没问题,第二个就报错,

6 条消息(共 12 条)
5,909 次查看
0 项奖励
7 条消息(共 12 条)
5,895 次查看

Hi, sorry for late reply as I was out of town...

 

And, I believe that csxsc already replied to your question here

 

Why do you need the second version?

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
8 条消息(共 12 条)
5,835 次查看

thank you all the same. The question was come across in the process that I design my program according to your method. I found that the first version was  right but the second wrong. So I don't know the difference between them. Now I have known.

However ,another problem appears. Please look at the three following picture. The first is your example ,and the second is my own design.The third is my sub_vi.我的程序出现了强制类型转换。我查到,为了优化程序,程序中应该尽量避免转换。

1.jpg         2.jpg

0 项奖励
9 条消息(共 12 条)
5,804 次查看

Without looking at your sub VI, one quick way to fix this is...

 

From the Booleans' references, right-click and create (Reference) Controls. Copy and paste these (Reference) Controls to your sub VI, and use them as Inputs to your sub VI.

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 项奖励
10 条消息(共 12 条)
5,801 次查看