Chapter 8 Utility Library
© National Instruments Corporation 8-59 LabWindows/CVI Standard Libraries
ReleaseExternalModuleint status = ReleaseExternalModule (int moduleID);
Purpose
Decreases the reference count for a module loaded using LoadExternalModule.
When LoadExternalModule is called successfully on a module, that module's reference
count is incremented by one. When you call ReleaseExternalModule, its reference count
is decremented by one.
If the reference count is decreased to zero, then the module ID is invalidated and you cannot
access the module through GetExternalModuleAddr or RunExternalModule. If, in
addition, the module file is not in the project and not loaded as an instrument, the external
module is removed from memory.
If you want to unload the module regardless of the reference count, call
UnloadExternalModule rather than ReleaseExternalModule. Use
ReleaseExternalModule when multiple calls may have been made to
LoadExternalModule on the same module and you do not want to unload the module in
case it is still being used by other parts of the application.
Parameter
Input moduleID integer The module ID returned by LoadExternalModule.
Return Value
status integer Indicates the result of the operation.
Return Codes
> 0 Success, but the module was not unloaded. The value indicates the number of
remaining references.
0 Success, and the module was unloaded.
-5 The module cannot be unloaded because it is referenced by another external
module that is currently loaded.
-9 Invalid module ID.