Example Code

Programmatically Update Array Index Indicator

Code and Documents

Attachment

Overview 

This example shows you how you can programmatically update the indicator of your array index on your front panel.  This allows you to alter what values are visible in your array during run-time. 

 

 

Description

In this example the Index Values property node is used to update the value of the array index on the front panel to reflect the current element being updated in the array.  For this VI the value in the array are not being updated, only the index is as a proof of concept.

 

 

Requirements

LabVIEW 2012 (or compatible)

 

 

Steps to Implement or Execute Code

Open and run the VI "Update Array Index Value Programmatically_LV2012_NI Verified"

 

 

Additional Information or References

BD.PNG

 

 

 

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

 

Cheers,
Kelly R.
Applications Engineer
National Instruments

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

Comments
VImen
Member
Member
on

This method doesn't work if the array is a strict typedef in which case the property "Index Values" is read only.

altenbach
Knight of NI Knight of NI
Knight of NI
on
  • That loop also needs a small delay (wait), else only the last position is ever noticeable.
  • The array should have some illustrative default data. Just scrolling an empty default array is relatively uninteresting.
  • It would seem more reasonable to just built the array inside the loop and eliminate the shift register and array manipulations (see picture below).
  • Programmatic scrolling of an array is more suitable for an indicator. If it is a control, it could intefere if the array is scrolled while it is operated.
  • ...

ScrollArray.png