LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arrays

Solved!
Go to solution

Hello Fellow Labview-ers...

 

May someone please help me figure arrays out?

My problem:

I have a for loop, and I want to insert the output of it (which is a double) to an array each time the for loop executes. But I want to see in the array all of the previous elements, not just the current one.

Can someone help me with this, or should I be using a matrix? And how?

 

 

0 Kudos
Message 1 of 6
(3,616 Views)

Hi boy,

 

when you want to "insert" into an (existing) array you should not initialize the array…

And instead of "inserting into an array" you surely want to "build an array by appending new elements"!

 

Please do the basic LabVIEW courses to learn about array handling.

And learn about i/o tunnels of loops and the options they provide!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,605 Views)

Yes, thank you for replying to me...

However you telling me to review the videos that I already watched doesn't help me... If it's so easy then would you be able to show me a sketch of what I should do for my code?

Please?...

0 Kudos
Message 3 of 6
(3,582 Views)
Solution
Accepted by topic author waterboyz2men

I figured it out. If it helps anyone, attached is the picture of a simplified version of inputting elements to an array. The first element out of the for loop was 1.5, and the last was 6.

0 Kudos
Message 4 of 6
(3,567 Views)

Here are some other methods to achieve the same thing. Not sure, I assume you don't, want to keep things from previous runs. See what happens when you run your VI a few times. (Hint: Download the pict and drag it into block diagram.)

 

Snip.png

 

PS Don't mind GerdW. His idea of wit is nothing but an insightful comment placed with impeccable timing.

0 Kudos
Message 5 of 6
(3,555 Views)

Hi,

 

I think I mentioned all functions waterboy needs to solve his problem…

 

@mcduff: Why don't you use autoindexing and polymorphism?

check.png

(There's a reason why I also mentioned the basic LabVIEW courses!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(3,522 Views)