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

How to Copy and Paste Elements in an Array

Code and Documents

Attachment

Overview

This example VI demonstrates the use of Event Structure to copy and paste array elements.

 

Description

This example is intended for applications where an array of clusters is used.  Sometimes it can be beneficial to set up one cluster in the array and then copy and paste the values from that cluster into separate elements.  This code uses a combination of custom run time engines for copy and paste along with position calculation to determine the array index.  Next the element is pulled out and placed in a shift register.  Once paste is pressed the code determines the new element and replaces the values of most controls with the copied cluster.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Download the attached folder to your computer
  2. Open the VI " Copy and Paste Array Elements 2012 NIVerified.vi"
  3. Run the program
  4. Set one cluster's values to something other than default

 

Additional Information or References
VI Block Diagram

 

Block Diagram.PNG

 

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

 

Regional Account Manager
NI

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

Comments
UMASO
Member
Member
on

This example is very much helpful.  Thanks much for sharing this with us.