LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete From Array Simple question

Solved!
Go to solution

Ok so I promise I am not an idiot but at the monment I might be lying.  I have an array, one demisional well orgenized, that I need the unique elements from.  I have writen an admitedly a little messy of a method to do such a thing but Logically to me it works,  mostly.  The array currently has 69 elements and at the moment there are only two unique values.  I could just enumerated them but that would mean I would have to roll out updates every time a new brand comes out.  So currently when I run my program it will delete about half the array and then decides that it doesn't have to obey logic anymore and keeps the rest.   I have compied the segment of code that is probelm and saved it as a VI for your pursoual and I have wired in a copy the avictive array so that you can see what I mean. The code works swimmingly for the first 35 Iterations of the for loop and then something goes terriably wrong.  

 

Anyone got a clue 

 

Mark R 

0 Kudos
Message 1 of 7
(3,709 Views)
Solution
Accepted by topic author markhrussell

MIght I just suggest a much more simple way to do what you are trying to do.  Use Conditional Indexing Tunnels.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 7
(3,703 Views)

Hi Mark,

 

it is never a good idea to delete elements from an array when you want to rely on the index numbers...

 

Try this:

check.png

Best regards,
GerdW


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

@crossrulz wrote:

MIght I just suggest a much more simple way to do what you are trying to do.  Use Conditional Indexing Tunnels.


Ok Crossrulz I like this approach but these ideas are new to me I have never seen two of these things.  what is the Arrow? Is that just a feed back node.  and what is the empty string attached to? 

 

Thanks,

 

Mark 

0 Kudos
Message 4 of 7
(3,683 Views)

It is a feedback node, and it is attached to the initialization terminal of that feedback node.  Personally I hate that this piece can be pulled off making a visual disconnect, but what ever.  It is bascially the same as an initialization of a shift register.

0 Kudos
Message 5 of 7
(3,675 Views)

@markhrussell wrote:

Ok Crossrulz I like this approach but these ideas are new to me I have never seen two of these things.  what is the Arrow? Is that just a feed back node.  and what is the empty string attached to? 


Yep, a feedback node.  I just did a right-click on your shift register and then clicked Replace With Feedback Node.  I then right-clicked on the feedback node and told it to change directions (makes it easier to read).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 7
(3,671 Views)

Ok The Feedback node inside the shitfregistar was new to me Thanks for the help.

 

Mark R 

0 Kudos
Message 7 of 7
(3,668 Views)