是这样的,子VI(SOUND DAQ.vi)中采集是在一个while循环中连续采集的,采用接线端的话,是采集的条件结束返回时,主VI才能显示出波形,但是我需要主VI中能实时显示出当前子VI中的波形以实现实时监控信号状况。
我现在使用全局变量和外部并行While循环不断的去更新波形(如图中声音频谱图),但这样感觉不太好,想问问看大家有没有更好的办法?
另有问题补充:在两个或多个并行WHILE循环中,如何使用一个while循环当中的按钮去结束这两个while循环?
Create a Reference of the indicator (in caller VI), wire it to the sub VI (Sound DAQ.vi must have Reference input created too).
Now, in the sub VI, you may create Right-click the Reference and create property i.e. Value, and have this property updated with the Sound DAQ's data...
Try it out and see 😉
(Hope I did't remember that steps wrongly :p)
Hi,
Attached is quickly done up example that uses Refnum (Reference) for updating caller's control/ indicator with sub-VI's data at runtime.
Attention!
Please beware of how sub-VI is terminated... In this example, sub-VI stops after 10 iterations.
A little busy this day, i appreciate your help very much, and i had notice your sample works excellent, but there are error in my program when i follow your instruction. Can you please tell me why?
Did you pass the Reference in from the caller VI?
You must call the sub-VI i.e. SoundDAQ.vi once from the main-VI (caller), before you can run and debug the sub-VI alone.
If you open the sub-VI immediately after launching LabVIEW, you will get such error as the control/ indicator Reference is not passed in to the sub-VI, yet.
Not try yet because i had finished the program in the gloable variant method. maybe later^_^
But thank you anyway!