Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Call Library Function Node

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info
Download Help (Windows Only)

Calls a DLL or shared library function directly.

The Call Library Function Node supports a large number of data types and calling conventions. You can use it 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 VI with the Property Node and the Invoke Node. The Call Library Function Node is expandable and shows data types for the wired inputs and outputs, similar to the Bundle function.

Details  Example

path in identifies the path to the DLL or 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.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
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. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.
return value is an example return value of the library function.
param 1..n output are example output parameters of the library function.

Call Library Function Node Details

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 return return value, the top pair of terminals 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.

Example

Refer to the Call DLL VI in the labview\examples\dll\data passing\Call Native Code.llb for an example of using the Call Library Function Node function.


Resources

WAS THIS ARTICLE HELPFUL?

Not Helpful