07-30-2020 10:45 AM
I looked for this topic, but nothing stood out as to guide me in solving this. I have an array in which I want to increment each element by 2.
On top I started with the basic concept to see it functioning. I placed this in a for loop. It seems to be working when running but the values change back to what they were originally after each iteration. It seems the only element that changes it the last iteration of the loop. Basically I want
Array Input = {0,1,2,3,4}
Array Output = {2,3,4,5,6}
This seems like a basic concept but, I cannot get this. Any help would be great thanks!
Solved! Go to Solution.
07-30-2020 10:54 AM
Read the detailed help for each node and you will find all the functions in the numeric palette can accept an array as in input. Dispense with the FOR loop and wire the array right to the node you are using. (I can't tell what it is - I don't have LV 2019 on this PC.)
07-30-2020 11:02 AM
Thanks. I attached a snapshot now . I notice in the file I sent I placed the input in the loop
placed outside produces the same reslut.
07-30-2020 11:06 AM
Are you just looking for the add node?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-30-2020 11:08 AM - edited 07-30-2020 11:09 AM
As Bill was stating, you don't need a loop at all because the Add function will accept an array and a scaler. It will add the scaler to all elements of the array.
07-30-2020 11:23 AM
Wow. I thought I tried that but aparently not. So I was just overthinking things .
Thanks so much everyone. !!
07-30-2020 11:31 AM
@Montn wrote:
Wow. I thought I tried that but aparently not. So I was just overthinking things .
Thanks so much everyone. !!
That's why it's always better to have more than one pair of eyes look at an issue. 🙂
07-30-2020 12:47 PM
While your algorithm problem has been solved easily, you really need to learn basic operations. Your code shows complete lack of understanding of loops and array operations. LabVIEW is much easier than you seem to think, so if you can describe the operation in one sentence, the code should not be larger than a postage stamp. If it fills the screen, be very suspicious! 😉
Your next problem might not be solvable by polymorphism alone, so here are some comments:
I recommend going back to the basic tutorials. Good luck!