04-25-2012 05:26 PM
Hello,
I am trying to search a one-d array to replace those elements that meet certain conditions with 0 s, so I can process the array later. My array size is about 1000,000 or more.
I found that, when monitoring how many elements being replaced, the shift register (Number of replace) some times show negative values, which i don't understand how it can happen. It seems if my array is small, like 60000 element, the shift register behaving ok. Can someone give me some suggestion what is wrong here? Thanks
Rgds,
Harry
r.
04-25-2012 05:30 PM - edited 04-25-2012 05:34 PM
Hi,
Read about data types. You use I16 indicator. The amount of #replaced probably gets out of range.
You should not use the Amp Cutoff control in the loop. Move the Amp Cutoff off the for loop, so the control gets read only once.
Why do you wire the N for loop count if you have indexed tunnel?
Check the example.
04-25-2012 07:20 PM
04-25-2012 08:47 PM
That is strange to analyse i-th element of the array and replace another element (Did you mean "I terminal" instead of "Current number of replacements" for index of Replace array subset?).
And funny solution in the attachment. If memory is not an issue and number of replacements just for debugging, it is nice 😃
04-26-2012 03:58 PM
Thanks for your reply. It worked ok now. Harry
04-26-2012 03:59 PM
Thanks for your reply. It worked ok now. Harry
04-26-2012 04:08 PM
Alex,
Thanks for your reply and example! I'll give it a try!
Rgds
Harry