LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does my event structure not react on a "value change" event?

Solved!
Go to solution

Hi

 

I created a VI with 2 while-loops and 1 event structure integrated. The first while-loop creates a square signal and the value of the signal changes periodically - that event is registered by a property node and additionally shown on a indicator. I linked the secound event called "Mode-Number:value changed" to that signal and tried various ways to "activate" the event structure (I tried to use event dynamic registration, property nodes, register for events tool etc.

 

Attached to this message is a png-File from the VI.

 

Any idea what could be wrong?

 

Thanks a lot 🙂

 

Bruno

0 Kudos
Message 1 of 11
(5,772 Views)
Solution
Accepted by topic author sciu

You need to use 'User Events'. You also need to look at some of the tutorials/examples on how to use them, see here: http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/creating_user_events/

 

What you have done is try to register for a value change event in both structures - this doesn't actually generate a value change event. Value change events are generated when you (as the user) change a value of a control on the front panel.

 

You can also use the 'Value (signalling)' property which will allow you to update the value of an indicator and also generate the value change event. I think in your case though you're better off using user events.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 11
(5,759 Views)

You aren't using the Value(Signalling) property node.  That is the one that allows you to programmatically trigger the Value Change event case.

0 Kudos
Message 3 of 11
(5,739 Views)

You should also use the value from the event, not the shared variable for writing to your other shared variable.  That is a classic race condition That you are best off avoiding.


GCentral
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
0 Kudos
Message 4 of 11
(5,722 Views)

Thanks a lot for your advices. Unfortunately it still doesn't work with the Value Signaling Property. Did I put the node in the right place?

 

Attachement

 

Thank you again a lot 🙂

0 Kudos
Message 5 of 11
(5,680 Views)

Do not put the value signalling node int he event structure.  You're creating an infinite loop.  The event fires, triggers another event and so on.  If your event gets fired once, it will continue firing until you abort your application.

 

Also, the Value signalling node outside the event structure is disabled, this will not do anything whend isabled.

0 Kudos
Message 6 of 11
(5,675 Views)

I also tried to run example vi from NI but even these vi's didnt run properly - it might be another problem...

0 Kudos
Message 7 of 11
(5,666 Views)

Thank you for your support. It worked. For some reason I couldn't establish a event structure setting with value signaling property node...but nevertheless there was a solution :-).

0 Kudos
Message 8 of 11
(5,646 Views)

Could you share the solution so that future generations may benefit?

0 Kudos
Message 9 of 11
(5,628 Views)

of course. here is the VI.

 

cheers

0 Kudos
Message 10 of 11
(5,613 Views)