LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

如何使用Reference由sub-Vi,即時傳遞多筆資料至最上層UI?

ref_data.vi 為模擬Subvi在程式各階段(也許是不同層的SUBVI),所送出的及時狀態)

在UI上,要顯示程式即時運作的狀態(Ready => Initial => Running => Finish )
目前使用String Refnum來作為即時顯示的方法,
 
但若使用此方法來實現,SUBVI即時傳遞很多個狀態到最上層的UI上,
那SUBVI與最上層的UI會連接好幾條Reference的線,可能導致SUBVI 的connector不夠用!
 
狀態1 (Ready => Initial => Running => Finish )
狀態2 (PASS => FAIL => ERROR)
 
 
若在SubVI用Cluster 把所有的資料先收集起來 再統一用Cluster Refnum來傳遞到最上層的UI上,
又會發生訊息傳遞不即時的問題(不管程式是否已經運作完成,所有資料流都要全部到達Cluster後,資料才會送出來!)
 
請問若要做到多個即時顯示狀態,可以獨立的顯示資料,有什麼比較好的方法? 謝謝!
 
附檔說明:
ref_UI.vi   為UI 顯示subvi的即時狀態
ref_data.vi 為模擬Subvi在程式各階段(也許是不同層的SUBVI),所送出的及時狀態)
Download All
0 Kudos
Message 1 of 2
(3,648 Views)

See attached for what you want.  If you want to pass values from subvi to main vi, you should wire the subvi to the indicators in the main vi directly.  If there are way too many wires for the connector pan, you either should use a cluster or break your subvi down further.  Don't pack too much stuff into one subvi only.  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Download All
0 Kudos
Message 2 of 2
(3,575 Views)