Configure Call Library Function Node for Function Returning Pointer

Updated Aug 18, 2023

Environment

Software

  • LabVIEW

In my LabVIEW VI I would like to call a function from a C language DLL using the Call Library Function Node. The header file shows that function returns a pointer of "unsigned char" type. Such data type is not available on when I am configuring the data type of the return parameter on the Parameters tab of the Call Library Function configuration dialog. What data type should I configure in this case?

In this case use the following settings:
  1. Double click the Call Library Function Node to display the Call Library Function configuration dialog.
  2. On the Parameters tab click return type in the parameter list.
  3. Set Type to Numeric.
  4. Set Data type to Signed Pointer-sized Integer.

Additional Information

For more information about passing and receiving pointers between C/C++ DLLs and LabVIEW please refer to community example: Passing and Receiving Pointers with C/C++ DLLs from LabVIEW - Developer Center Resources.
The term dereferencing describes the process of accessing data that is referenced by the pointer. You can use LabVIEW's Memory Manager function MoveBlock to dereference data directly withinlab your LabVIEW VI. Please refer to the community example Dereferencing Pointers from C/C++ DLLs in LabVIEW - Developer Center Resources for more information.