Owning Palette: Libraries & Executables VIs and Functions
Requires: Base Development System
Calls a DLL or shared library function directly.
The Call Library Function Node is expandable and shows data types for the wired inputs and outputs, similar to the Bundle function. You can configure the Call Library Function Node to specify the library, function, parameters, return value for the node, calling conventions, and function callbacks.
|path in identifies the name or path of the shared library you want to call. You must place a checkmark in the Specify path on diagram checkbox in the Call Library Function dialog box for this input to appear on the connector pane. |
Although you can specify the shared library to call by name or by path, these techniques use different search algorithms for locating the shared library and have different ramifications on distributing the shared libraries with stand-alone applications. Ensure that you choose the proper technique for your use case. For example, always specify system shared libraries, such as kernel32.dll, by name.
|error in describes error conditions that occur before this node runs. This input provides standard error in functionality.|
|param 1..n are example input parameters of the library function.|
|path out returns the path to the called DLL or shared library. You must place a checkmark in the Specify path on diagram checkbox in the Call Library Function dialog box for this output to appear on the connector pane.|
|error out contains error information. This output provides standard error out functionality.|
|return value is an example return value of the library function.|
|param 1..n output are example output parameters of the library function.|
Error I/O operates uniquely in this function, which will not execute if an error enters the node. Error 7 occurs if you provide a path that does not exist for dynamic DLL loading. Error 1097 occurs if the Call Library Function Node calls external code that contains an exception.
The Call Library Function Node supports a large number of data types and calling conventions. You can use this node to call functions in most standard and custom-made DLLs and shared libraries. If you want to call a DLL that contains ActiveX objects, use the Automation Open function with the Property Node and the Invoke Node.
The Call Library Function Node consists of pairs of input and output terminals. You can use one or both terminals. If the node does not generate return value, the top terminal is unused. Each additional pair of terminals corresponds to a parameter in the parameter list of the function you call in top-to-bottom order. You pass a value to the function by wiring to the left terminal of a terminal pair. You read the value of a parameter after the function call by wiring from the right terminal of a terminal pair.
Right-click the node and select Configure from the shortcut menu to display the Call Library Function dialog box, which you can use to specify the library name or path, function name, calling conventions, parameters, and return value for the node. When you click the OK button, the node automatically resizes to have the correct number of terminals and sets the terminals to the correct data types.
|Note LabVIEW reserves Windows messages WM_USER through WM_USER+99 for internal use only.|
You can use the Call Library Function Node to call code written in text-based programming languages.
Refer to the External Code (DLL) Execution VI in the labview\examples\Connectivity\Libraries and Executables directory for an example of using the Call Library Function Node function.