kb:labview:sharedlibraries
Table of Contents
13 Shared Libraries (DLLs)
Calling Shared Libraries
Source: Calling Shared Libraries
A shared library is a file containing executable program modules that any number of different programs can use to perform some function. You can call these program modules, or shared library functions, from LabVIEW by using the Call Library Function Node. Call a shared library function when you want to accomplish any of the following tasks:
-
Using functions written in another programming language within LabVIEW
-
Performing tasks that LabVIEW cannot perform with its own functions and VIs, such as calling system routines
-
Completing tasks that are better suited for text-based languages
[..]
General Approach to Calling Shared Libraries
Calling a shared library function in LabVIEW includes the following actions:
-
You obtain or create a shared library.
-
You configure a Call Library Function Node to call a function within the shared library.
-
LabVIEW calls the function when the Call Library Function Node executes.
-
LabVIEW passes input data from the block diagram to the executable code.
-
LabVIEW returns data from the executable code to the block diagram.
Limitations on Calling Shared Libraries in LabVIEW
-
Shared libraries must use either the stdcall or C calling convention. You can use any language to write shared libraries as long as the shared libraries can be called using one of these two calling conventions.
-
Shared libraries execute synchronously. You cannot reset a VI that is running a shared library until execution completes. If you want to write a shared library that performs a long task, be aware that LabVIEW cannot perform other tasks in the same thread while the shared library executes.
-
VIs that call shared libraries are platform specific. VIs that call functions within shared libraries execute on different platforms only if you have a corresponding library for each platform. If you move a VI that call a shared library with a Call Library Function Node to another platform, you must update the node to specify the version of the shared library that is compiled for the new platform.
Debugging DLLs
On Windows, you can use the Dependencies tool to inspect and debug DLLs.
Resources
-
LabVIEW Help
-
NI Forums
kb/labview/sharedlibraries.txt · Last modified: 2025/03/25 23:20 by joerg.hampel