From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



Call Library Function Node指定的DLL什么时候导入到内存?



主要软件:
主要软件版本: 7.1
主要软件修正版本: N/A
次要软件: N/A

问题:
我想更谨慎地管理LabVIEW的内存。使用Call Library Function Node,LabVIEW什么时候装载动态链接库(dll)到内存?

解答:
当Call Library Function Node所在的VI导入到内存的时候,DLL文件导入到内存。

至少要考虑2种情况:

1. Call Library Function Node在您程序框图上的一个子VI中,或者在您的主VI程序框图中。
在这种情况下,当您打开主VI时,LabVIEW导入了主VI和所有子VI,所以这个时候同样也导入了Call Library Function Node指定的dll。当调用的VI完全关闭并从内存中移除的时候,dll文件才从内存中导出。

2. Call Library Function Node在一个被Call By Refenrence Node调用的子VI中。
在这种情况下,子VI是在Open VI Reference函数执行的时候被导入到内存中的(通常就在Call By Reference Node之前)。因而,dll是在Open VI Reference函数执行的时候被导入到内存中的。当调用的VI reference关闭的时候,dll就从内存中导出。

相关链接:
Developer Zone Example: Controlling DLL Loading At Runtime in LabVIEW
Developer Zone Example: Using Call by Reference with VI Server

附件:





报告日期: 10/27/2006
最近更新: 01/02/2008
文档编号: 3OUJ9U4B