LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Events and Clusters


@pierroil wrote:

http://www.ni.com/cms/images/devzone/tut/a/95de74b4575.gif

 

 

What the...

 

The Queue out is never pushed to the consumer loop... How is data added on to the input wire...

 

Trippy...

 


 

The queue wire is a refernce to the queue itself. It is not the not the data you are posting to the queue. An Enqueue places data into the queue and teh Dequeue removes the data from the queue. That is how the data gets transfer from one loop to another. When using queues you can have multiple things enqueuing data but should only have one thing remove data from the queue. Otherewise you have a race condition and you have no guarantee which task will get the data.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 11 of 19
(813 Views)

@pierroil wrote:

http://www.ni.com/cms/images/devzone/tut/a/95de74b4575.gif

 

 

What the...

 

The Queue out is never pushed to the consumer loop... How is data added on to the input wire...

 

Trippy...

 


I don't understand what you mean by this.  A queue is based on the reference.  The producer loop "Enqueues" the data onto the FIFO (queue).  The consumer loop "Dequeues" the data from the FIFO that the producer put on it.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 12 of 19
(813 Views)

Reference was the key.

 

Didn't know that, have yet to use Queues

 

0 Kudos
Message 13 of 19
(810 Views)

@pierroil wrote:

Ok the whole point of using events was to be able to detect event changes withuot me having to write a bunch of OR and Ands or compare and use shift registers to save my old data etc etc.

 

Is there no way to trigger the Vaue change event only when the value has actually changed.

 

And lol... I<m actually currently stepping through and I found this "value change bug" rather confusing... Been triggerring events even if there was no change...

 I guess in other words: What's the point of events, fi at the end of the day, the signalling function triggers it which ends up just being Polling all over again.

 


It is not a bug. It is kind of confusing that it triggers a value change event. But the property name is Value (Signaling) and not Value Changed (Signaling).

=====================
LabVIEW 2012


Message 14 of 19
(807 Views)

Here is my code.

 

There's a bunch of garbage in there - sorry.

 

Here is what you need.

 

OPEN Go To Full.vi and Pierre2.vi.

 

You will also need to change the top level file paths to match your computer.

 

The problem is in Pierre2.vi, I need to understand how to get the event triggers working.

 

Make sure you read GO TO FULL.vi and the important note on the front... seriously, don't say I didn't warn you 😛

 

0 Kudos
Message 15 of 19
(804 Views)

"

The behavior is also different in that the event will trigger with every value(sgnl) call, even if the new value is the same asn the old.
 
It seems you only want to trigger the event if the result is different to the previous result. Easiest would be to use a shift register, compare old and new, and place the code in a case structure that only runs the relevant code if new and old differ (no event structure needed).
If you still want to use an event structure, place a case structure inside it, compare old and new from the event terminal, and execute the empty frame if they are the same."
From Altenbach in 2008.
This works.
This is exactly what I had before and my code worked fine. I went to events to avoid having to play with 102912019 different shift registers. It got pretty cumbersome
I guess I could put a structure inside the event... still that's really annoying...
0 Kudos
Message 16 of 19
(798 Views)

I don't have the time to edit or modify your VIs at this time. I recommend that you look at the examples that explain queues. You may also want to look at the examples for user events. Either of these would allow you to achieve what you want.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 17 of 19
(794 Views)

Yep. I'm already on it :).

 

Thanks anyway.

 

I learned a lot in this conversation alone.

 

0 Kudos
Message 18 of 19
(791 Views)

Ok so I ended up simply putting a case structure inside my event. Comparing the cluster to see if anything changed and then using the index of the change as the case selector.

 

Works I guess. Not elegant, but works.

 

0 Kudos
Message 19 of 19
(786 Views)