Example Code

Insertion sort and use of pointers for memory addressing with LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Description

Insertion sort and use of pointers for memory addressing with LabVIEW

 

This demo application shows the use of the LabVIEW dll library functions for creating pointers and memory addressing by implementing the insertion sort algorithm. Primitive VIs to memory allocation and deallocation as well as for reading and storing data have been implemented. Malleable VIs are also used to allow the use with different data type without changing in code.

 

 

Prepended data size provides high flexibility simplifying the use of primitives, especially with unbounded data types, at the expense of the overhead of 4 prepending bytes for the length.

 

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