06-09-2015 09:56 AM
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
Solved! Go to Solution.
06-09-2015 10:03 AM - edited 06-09-2015 10:06 AM
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.
06-09-2015 10:31 AM
You aren't using the Value(Signalling) property node. That is the one that allows you to programmatically trigger the Value Change event case.
06-09-2015 11:13 AM
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.
06-10-2015 02:02 AM
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 🙂
06-10-2015 02:25 AM
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.
06-10-2015 02:31 AM
I also tried to run example vi from NI but even these vi's didnt run properly - it might be another problem...
06-10-2015 03:36 AM
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 :-).
06-10-2015 04:39 AM
Could you share the solution so that future generations may benefit?
06-10-2015 06:29 AM
of course. here is the VI.
cheers