Home of RF and Wireless Vendors and Resources

One Stop For Your RF and Wireless Need

Labview programming basics Tutorial-Creating Array

This Labview programming language tutorial covers how to create array in labview. It also covers various array operations.This labview tutorial covers following topics:
Labview data types
Creating SubVI
Creating Array and Array operations
Cluster concepts in labview
Various plots in labview
File I/Os
For loop,while loop and case structure
Local variable vs Global variable concepts

Working and manipulating with Arrays is an important part in LabVIEW development. Arrays are very powerful to use in LabVIEW. In all your applications you would probably use both One-Dimensional Arrays and Two-Dimensional Arrays.

On the Front Panel using the Control palette we can create an array as follows (Array, Matrix & Cluster sub-palette).


array labview fig1

You drag and drop the empty Array on the Front Panel, next you find a Control or Indicator (Numeric, String, Boolean, etc,) and drag it into the empty Array. You can create an Array of (almost) any kind of Control or Indicator. 2D or multidimensional Array? Just drag the mouse in the Index display to the left and increase the dimension.


array labview fig2

On the Block Diagram we have the following Array palette available from the Functions palette in LabVIEW:


array labview fig3

Use the Array functions to create and manipulate arrays. The most useful Array functions are: All these functions are basic (but very useful) array functions you will probably be using in all your applications and VIs.

2D array creation using for loop

The figure below mentions how to create 2D array using for loop.


array labview fig6

Array Operations


array labview fig4

Let us understand some of the basics array operations such as Build Array, index array, array size, auto indexing etc.

Build Array

Build Array: This function returns the element or subarray of n-dimension array at index. It is always useful to find a specific value in an array. The Index Array is extendible, so you can drag it out to find more than one elements. Try the simple example below.


array labview fig5

Index Array

Index Array: This function returns the element or subarray of n-dimension array at index. It is always useful to find a specific value in an array. The Index Array is extendible, so you can drag it out to find more than one elements. Try the simple example below.

Array Size

Array Size:This function returns the number of elements in each dimension of array. Try the simple example below. The example finds the size of an arbitrary array.

Auto indexing

Auto-indexing: If you wire an array to a For Loop, you can read and process every element in that array by enabling auto-indexing. You also can enable auto-indexing by configuring a For Loop to return an array of every value generated by the loop. Create a simple example in order to see the difference.

Download Labview Source code of this array operations example

Download Array Operations labview VI file

Related Links

•   What is Labview
•   National Instruments Labview
•   Download Labview, http://www.ni.com/downloads/products/

               

Useful Links to Labview Source codes

Refer following as well as links mentioned on left side panel for useful labview source codes.

Hex to Binary labview VI      Decimal to Binary labview VI
Number Generator labview VI      Binary to Decimal labview VI
Binary number generator     modulator-demodulator
FFT     up and down sample

Cellular Telecommunications Tutorials -
RF Wireless World

WLAN  802.11ac  802.11ad  wimax  Zigbee  z-wave  GSM  LTE  UMTS  Bluetooth  UWB  IoT  satellite  Antenna  RADAR 


Share this page

Translate this page