Example Code

Retrieve Data from a C Array Pointer in LabVIEW

Code and Documents

Attachment

This example demonstrates how we may access the data reference by a memory pointer returned by a C DLL in LabVIEW.

For this example a CVI project is used to build the DLL. The DLL allocates memory for an array of integers, fills the array with data and then returns a pointer to the array. This pointer is passed to LabVIEW as a 32bit integer from the Call Library Function Node.

This memory referenced by this array pointer is then copied to an array in LabVIEW using the LabVIEW internal "MoveBlock" function through a second Call Library Function Node.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors