2. After the Specify path on diagram parameter is checked, a terminal named path in appears on the Call Library Function. This terminal accepts the path to the DLL that you want to call. When that Call Library Function is executed, the DLL specified in the reference is loaded into memory.
3. The path in input can be used to unload a previously referenced library from memory. You must wire an empty path constant or null path constant to the path in input of the same Call Library Function node that initially called your DLL. The picture below shows an example. The first call loads the DLL and the boolean unloads the DLL as well as stops this code. The false case, not shown, has timing but no code.
This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
If the VI that uses the Call Library Function Node is closed, the reference to the DLL will be released. Therefore, if you have a VI dynamically calling a secondary VI with the DLL reference you can close the secondary VI, releasing the memory of the DLL's handle, without a need to close the primary VI. For more information on how to achieve this using the Open VI Reference you can refer to Dynamically Calling a VI in the LabVIEW product documentation.
If an empty or invalid path is wired to a different Call Library Function node than the one that initially called your DLL it will not unload the DLL from memory. The picture below shows an example of what not to do:
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.