09-28-2018 03:22 AM - edited 09-28-2018 03:27 AM
Hello, I am new to LabView and was to create some basic VI's . I was able to make a search and replace Program but now I want a counter to indicate how many elements were found and replaced. How do I do that?
Thank You
09-28-2018 04:17 AM
You need while loop and shift registers.
In your code for loop works as many times as array length, but you need stop if already no elements.
Also your program never replaces first element
09-28-2018 04:39 AM
Not Maintained Search Order anyways it will Once replaced with new number it wont alter the array values, so search can be started from zero it wont create difference.
09-28-2018 05:09 AM
@PalanivelThiruvenkadam wrote:
Not Maintained Search Order anyways it will Once replaced with new number it wont alter the array values, so search can be started from zero it wont create difference.
Those controls should be outside the loop.
And of course passing the start index in a shift register will make a difference! Starting over form 0 will cost CPU cycles, which is not necessary. This will make more difference as those arrays grow in size.
09-28-2018 05:28 AM - edited 09-28-2018 05:28 AM
And of course passing the start index in a shift register will make a difference! Starting over form 0 will cost CPU cycles, which is not necessary. This will make more difference as those arrays grow in size.
Exactly! this why I use second shift-register
09-28-2018 06:13 AM
Those controls should be outside the loop.
And of course passing the start index in a shift register will make a difference! Starting over form 0 will cost CPU cycles, which is not necessary. This will make more difference as those arrays grow in size.
Thanks Points Taken, Suggested points are taken into consideration.