LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enqueue element only if it is an updated value

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!

 

0 Kudos
Message 1 of 19
(2,904 Views)

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):

 

enqueue new data.PNG

 

That's the simplest way I can think of.

Message 2 of 19
(2,888 Views)
In the example above, the enqueue have to be in the False case, to get what jmsolanof wants "I just want to enqueue non-repeated data".
Message 3 of 19
(2,878 Views)

Yes.  Good catch.  Thank you.  It was supposed to be a "not equal" function, I grabbed the wrong one from the pallette.

0 Kudos
Message 4 of 19
(2,872 Views)

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.)

 

0 Kudos
Message 5 of 19
(2,866 Views)

Virtual wires are made of copper?!

 

Smiley Surprised

0 Kudos
Message 6 of 19
(2,857 Views)

@DianeS wrote:

Virtual wires are made of copper?!

 

Smiley Surprised


Only the orange ones. The blue ones are Cobolt.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 19
(2,841 Views)

@Yamaeda wrote:

@DianeS wrote:

Virtual wires are made of copper?!

 

Smiley Surprised


Only the orange ones. The blue ones are Cobolt.

 

/Y


I'm afraid to ask what numeric cluster wires are made of


"Should be" isn't "Is" -Jay
Message 8 of 19
(2,819 Views)

All cluster wires are made of yarn and class wires are braided from any flexible material.  Variant wires are superconductors.

 

Lynn

0 Kudos
Message 9 of 19
(2,808 Views)

Great- to save money on consumables I will now use as many global and local variables as I can.

 

 

Spoiler

And consume a lot more cost in debugging labor.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 10 of 19
(2,800 Views)