10-24-2011 05:22 PM
Hi,
How can I enqueue an element only if it is an updated value? I mean, I have a lot of data incoming and I just want to enqueue non-repeated data.
Thank you!
10-24-2011 06:47 PM - edited 10-24-2011 06:49 PM
Store the previous incoming data in a shift register. Compare the previous data to the new incoming data. Stick your "Enqueue Element" inside the "True" case of a case structure. Update the shift register with the most recent data.
Here's a picture (incomplete, obviously, as there's no timing in the loop, nor does it have a stop button, plus the queue has no input queue reference, but I expect you can handle those parts nicely on your own):
That's the simplest way I can think of.
10-24-2011 07:44 PM
10-24-2011 08:05 PM
Yes. Good catch. Thank you. It was supposed to be a "not equal" function, I grabbed the wrong one from the pallette.
10-24-2011 08:35 PM - edited 10-24-2011 08:35 PM
At todays copper prices, a solution with less wires is preferable. 😄
I typically use a globally initialized feedback node. Make sure to initialize it with something that normally does not occur in your data (NaN, Inf, empty string, -1, etc.)
10-24-2011 09:20 PM
Virtual wires are made of copper?!
10-25-2011 03:10 AM
@DianeS wrote:
Virtual wires are made of copper?!
Only the orange ones. The blue ones are Cobolt.
/Y
10-25-2011 04:46 PM
10-25-2011 05:25 PM
All cluster wires are made of yarn and class wires are braided from any flexible material. Variant wires are superconductors.
Lynn
10-25-2011 05:44 PM
Great- to save money on consumables I will now use as many global and local variables as I can.
And consume a lot more cost in debugging labor.
-AK2DM