LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shift register has negative value?

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

 

 

 

part1.jpgr.

0 Kudos
Message 1 of 7
(3,637 Views)

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.

Message 2 of 7
(3,636 Views)
What is the representation of the "zero" diagram constant you use to initialize the SR? (It is not I32, that's why you get a coercion at the index input of replace array subset, and it is not I16, because you get a coercion at the indicator). Make it I32! As you can see, a picture is not really sufficient to debug this, so please attach some real code next time. Thanks!
Message 3 of 7
(3,620 Views)

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 😃

Message 4 of 7
(3,612 Views)

Thanks for your reply. It worked ok now. Harry

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

Thanks for your reply. It worked ok now. Harry

0 Kudos
Message 6 of 7
(3,572 Views)

Alex,

 

Thanks for your reply and example! I'll give it a try!

 

Rgds

 

Harry

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