07-18-2012 09:18 AM
Hi,
I am using a cluster with 5 controls to trigger an event.
I am feeding a Cluster Reference to this VI and from there I am writting to a local variable. The change on this local variable is being monitored by my event loop. Unfortunately this is not working.
Am I doign something wrong?
If it is not possible to use his local variable appraoch to simulate a new control, how else can I trigger evenst based on wires? ---> Note I don't want to create 5 User events.
07-18-2012 09:22 AM - edited 07-18-2012 09:23 AM
Writing to a local variable will not trigger an event. If you do not want to use user events then write to the Value(Signaling) property.
07-18-2012 09:30 AM
What would be the event if I use value (Signalling)
07-18-2012 09:31 AM - edited 07-18-2012 09:35 AM
It will trigger a value changed event.
Edit: Some clarification. This is called value changed but the event will trigger even if you write the same value that the control already has. I have seen this cause confusion before.
Also you probably don't need to create five user events. You can create a single user event and make the datatype a cluster. You can put a typedef enum or just a string to indicate the source or type of event. Then in the user event case you unbundle that and feed it to a case selector.
07-18-2012 09:32 AM
Other question.
How else can I transfer wire data from 1 loop to another. That is, if I have some data that is craete within a while loop, how can I push it to another parralel while loop?
Local Vars don't seem to work.
And I don't want to use References + Property nodes since I read they have slow run time and I'm designing a rather large application.
07-18-2012 09:37 AM
I edited my post while you were writing yours.
Local variables should be able to transfer data from one loop to another as long as the loops are in the same VI. Otherwise you can use global variables. Better yet use something like events, notifiers or queueus. You could also use a functional global.
07-18-2012 09:48 AM - edited 07-18-2012 09:49 AM
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.
07-18-2012 09:53 AM
@pierroil wrote:
How else can I transfer wire data from 1 loop to another. That is, if I have some data that is craete within a while loop, how can I push it to another parralel while loop?
This sounds like a Producer/Consumer.
07-18-2012 09:56 AM
@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.
This is starting to sound like an architectural issue. Care to share some code and maybe we can find a better solution for you.
07-18-2012 09:56 AM
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...