To download NI software, including the products shown below, visit ni.com/downloads.
1. Overview
ArrayLists are collection objects in .NET that are based on objects. Getting LabVIEW data in and out of them can be somewhat confusing at first. This example shows a simple insertion and retrieval.
2. Description
So, in the previous post, we saw the difference between the AraryList and the array. The question is, "How do I convert an ArrayList into a LV array" - and quickly. It is reasonable to just iterate through the ArrayList and build up a LV array manually, if there are only a few elements in the list. But what if there are 1,000? 10,000? etc.. The example shows how to do this. The first section is an artifact necessary to create an ArrayList with some data in it - you can ignore it since you should already have your ArrayList. But the next two sections show how to convert the ArrayList into an instance of an Array class, and then convert the Array class to a LV array.
3. Requirements
4. Steps to Implement or Execute Code
5. Additional Information or References
**The code for this example has been edited to meet the new Community Example Style Guidelines.**
Description-Separate-2Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.