From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Rotate Input Array Using 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

Download All

Overview

This VI rotates Input Array by cyclic left shifting every Array element and creates a reversed Output Array

 

Description

The Output Array is being initialized first. Then in each loop iteration, it is being rotated and an input element is being inserted to the beginning, and lose the last element so the array stays the same size.

It does this by rotating the array so each element moves up one index except the last value moves to the first index (index 0). This is then over written by the new value.

 

Requirements

LabVIEW Full Development System 2012 or compatible

 

Steps to Implement or Execute Code

1.Run the VI

2.Observe how the Array elements are being rotated right

Note: You can change the colors of the Input Array elements 

 

Additional Information or References

VI Block DiagramRotate Input Array LV2012 NI Verified BD.jpg

 

 

 

**This document has been updated to meet the current required format for the NI Code Exchange. **

 

 

Rico P
Smiley Very Happy

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