From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-08-2021 08:31 PM
This VI is going to be part of a larger program. It's fairly simply, as it is initializing and array, passing that array into a while loop and into a case structure, where, in the True case, the Insert Into Array VI adds the loop count to the index equal to the loop count. I have also made it so that when the case is false, the array is wired straight through to the shift register. The problem is, when I use a button starting on the True case, then switch to the False case, and then go back to the True case, the Insert Into Array VI no longer inserts values into the Array. How can I fix this? I have attached my code below.
Solved! Go to Solution.
12-08-2021 08:53 PM
I cannot see your code because I don't have LabVIEW 2021. Consider "save for previous".
To append data to an existing array you would use "built array". I assume you are using a shift register to hold the array between iterations, else you are starting with the same old short array again in the next iteration, right? Where do you get the insert position from? hopefully not [i], because that will be outside the valid elements once you skip an insertion.
(Using insert into array is useful if you need to insert an element somewhere in the middle, moving all higher element up one slot.)
12-08-2021 09:06 PM
I have attached a version saved for 8.0 here. Yes, you are right that I am using a shift register to hold the array between iterations and it seems that I am inserting at the position [i]. Would a solution be just to append 0's to the array in the false case, or is there a cleaner solution with another function?
Thanks.
12-08-2021 09:17 PM - edited 12-08-2021 09:17 PM
You need to start with the basic tutorials!