LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pb with events

Solved!
Go to solution

Hello,

 

I have 2 while loop one with a program with a boolean indicator, ans an other with a timer.

I would use an events structure to launch a timer in the second loop when I put the boolean at 1 (when I turn on the light).

 

I edit my structure Events and I put the conditions "boolean value change" to start my timer, but this d'ont work, so I seen that this condition work only with a "command" (push button) and not with an "indicator" (boolean indicator), have you a solution to start the timer when the value of the INDICATOR change, and not the value of a COMMAND ????

 

I saw that I could send a notification but I have never used it and I don't know if it's usefull...

 

Best regards.

0 Kudos
Message 1 of 25
(4,643 Views)
Solution
Accepted by topic author leo2b

The property node

 

Value Signalling

 

Will fire any event associated that object changing.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 25
(4,639 Views)

Do you mean right clik on my indicator, then property node and then value?

I haven't be able to resolve my problem with that...

 

I put put it an example of my problem.

 

0 Kudos
Message 3 of 25
(4,631 Views)

No it's ok I have just find the solution. 🙂

 

 

Best regards.

Message Edité par leo2b le 08-04-2009 08:11 AM
0 Kudos
Message 4 of 25
(4,627 Views)

Sorry, but I have an other problem with the property node it seems that it start like if the value was change, and I want that the program start like if the value had not change yet...

 

Do you have a solution for this problem ?

0 Kudos
Message 5 of 25
(4,604 Views)

First, put a small wait statement in your upper loop so it doesn't consume 100% of the CPU cycles.

 

Second, the name of the value change event can be slightly misleading.  Anytime you send a value to the value(signalling) property node, it fires the value change event even if the value has not actually changed.  You can do a comparison of the old and new values to see if the value actually changed.

0 Kudos
Message 6 of 25
(4,592 Views)

I put my example here.

In fact I want to count how many states are finish, I have a big problem with this property node...

0 Kudos
Message 7 of 25
(4,588 Views)
You can also do the comparison in your other loop and only do the write to the value signalling property node if the value actually changes.  You should also use an event for your stop button in the loop containing the event structure.  Also, make sure wires generally run from left to right.
0 Kudos
Message 8 of 25
(4,580 Views)
"You can also do the comparison in your other loop and only do the write to the value signalling property node if the value actually changes.  You should also use an event for your stop button in the loop containing the event structure.  Also, make sure wires generally run from left to right."
I don't mean to hijack, but this discussion is the closest I've found so far to my problem--and I'm hoping my issue stems from a simple misunderstanding of LabVIEW, and can be dispatched in a brief response.
From one subVI I update a component of a cluster and use a value (signaling) node to write the cluster to the top-level VI immediately above it in the hierarchy. Another subVI (at the same level in the hierarchy as the first subVI) has an event structure registered for value changes of some of the components of the top-level cluster, but not the component whose value is being updated in the other subVI. These are individual event cases per component of the cluster, derived by reading a Controls[] property node, indexing the array of references for the desired control references, and then dynamically registering each for its own event.
The problem: while none of these components' values change, they all fire when one of the other components of the cluster changes. Of course, this behavior violates the intent of my design. What am I missing here?
Much thanks for any response.
Elton
0 Kudos
Message 9 of 25
(4,219 Views)

aliasThree, instead of using references to the Main VI's controls (that's like sneeking on the top level VI, which does not sound like a very robust approach, expecially if you want to change your Main VI) you could instead have the Main VI send Dynamic Events to the sub VI each time one of the cluster components is modified. You would have to first define the Dynamic Event in the Main VI and find a way to pass the reference to that Dynamic Event to the Sub-VI (usually done via a LV2 global or even a global variable) so that it can register to it. You would have one event for each component (for instance the type of the event could be an enum listing the components you are interested in).

My 2 cts,

X.

0 Kudos
Message 10 of 25
(4,175 Views)