How To - 如何設定VI Call Configuration

VI Call Configuration可以設定程式何時要載入subVI。
稍微說明一下 VI Call Configuration 的設定介面如何呼叫:



點選之後可以看到你選擇的VI Call Configuration可以設定的項目有三個:



Load with callers:
Loads the subVI at the same time the caller VI loads. This behavior is identical to how a subVI loads.
當你的程式開始執行的時候,subVI同時也被載入到記憶體。

Reload for each call:
Loads the subVI when the caller VI makes the call to the subVI if the subVI is not already in memory. This option does not guarantee that the subVI stays in memory after the call.
當你程式呼叫這個subVI的時候,subVI才會被載入到記憶體,當這個subVI作業完畢之後其占用的記憶體空間可能會被其他需要使用的程式使用,即釋放記憶體。

Load and retain on first call:
Loads the subVI only the first time the caller VI makes the call to the subVI. If you have a large caller VI, you can save load time and memory by selecting the Load and retain on first call option in the dialog box. When you select this option, the subVI does not load until the caller VI needs it, and you can release the subVI from memory after the operation completes.
當程式呼叫這個subVI的時候,subVI才會被載入到記憶體,直到該程式執行完畢之後,subVI的記憶體空間可能會被其他需要使用的程式使用,即釋放記憶體。

當運算上會占用太大記憶體導致 Memory full 的狀況時,可以考慮使用這種方式來釋放記憶體。