LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building 1D array with scalar elements

Solved!
Go to solution

I must be overlooking something here, but I cannot seem to build a 1D array from scalar elements, here's an example of what I'm trying to do...

 

Capture.PNGCapture2.PNG 

 Instead of having the scalar element appended to the first element of the array I would like each scalar element to be added to each element of the array (the array should read: {0,1,2,3,4}).  The help file is a little misleading here... "If all the inputs are scalar elements, Concatenate Inputs is automatically deselected and cannot be selected, and the output is a 1D array containing the elements in order", but instead of putting them in order it just writes over the previous one.

 

Any help is greatly appreciated! 

0 Kudos
Message 1 of 5
(5,971 Views)
Solution
Accepted by topic author cmersits

Try  this.

 

Untitled.jpg    Untitled2.jpg

Note you have to enable indexing

Message 2 of 5
(5,965 Views)
aha! I knew it was something simple that I was missing, thanks for your help!
0 Kudos
Message 3 of 5
(5,951 Views)

Hi all..  

 

Does anyone know how to build an array, from a set of scalar values, in the same way, but without the knowledge of how big the array is going to be?

 

I have a routing that will create values, from a formula, and place them one by one into the array.  But, the number of values changes each time, so I can't write a value to 'N' in the for loop.

 

How can I get around this? 

 

 

Cheers!

 

Paul.. 

0 Kudos
Message 4 of 5
(5,923 Views)

Use a while loop and determine when to exit the while loop.

 

Per default indexing is disabled on a while loop but you can activate it  (right click on the tunnel)

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 5 of 5
(5,919 Views)