LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with event structure

I have a problem when I try to execute this event structure, I find that when a boolean is ON, the internal program is executed, the boolean must be sent to on from another while but I cannot get the event to be activated, what could I do? Thanks for your support 

 

                                                                                        FILE_REF.PNG

0 Kudos
Message 1 of 6
(1,085 Views)

Events are primarily for user interactions. An indicator change does not fire it. One workaround would be to wire to a signaling property, but are your stage of learning, don't even try and it would be very problematic with your code because they would trigger even if the value is unchanged .

0 Kudos
Message 2 of 6
(1,068 Views)

If you want to fire the event when the user do something, make the event of the button the user klick, if the button is just a normal bolean variable, you need to do the polling, frequently reading the value, only when it's toggled, do some thing.  Check out the Notifier Operations.

0 Kudos
Message 3 of 6
(1,031 Views)

As said, the way you're trying to do it, you much use the Value(signalling) property to trigger the event.

As a unrelated tip, you don't need to extraxt the Error status for your Or-function, just wire the error wire directly.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 6
(1,018 Views)

@Yamaeda wrote:

As said, the way you're trying to do it, you much use the Value(signalling) property to trigger the event.

As a unrelated tip, you don't need to extraxt the Error status for your Or-function, just wire the error wire directly.


That would fire the event with every iteration of the lower loop (sorry, cannot look at the VI), even if the indicator value does not change, or even if it goes from true to false. Most likely, the event is configured to lock the panel until the event completes, so the stop cannot be pressed to stop the inner loops and we are locked up forever.

 

One "solution" (in big quotes!) would be to change the event to "Boolean2:changed" and wrap a case structure around the inner code so it only executes if the new value is true (FALSE case is empty), and configure the event to not lock the panel and limit the event queue size to one. 

No, I don't recommend any of that! A "house of cards" is not a sane code architecture!

0 Kudos
Message 5 of 6
(977 Views)

@altenbach wrote:

@Yamaeda wrote:

As said, the way you're trying to do it, you much use the Value(signalling) property to trigger the event.

As a unrelated tip, you don't need to extraxt the Error status for your Or-function, just wire the error wire directly.


That would fire the event with every iteration of the lower loop (sorry, cannot look at the VI), even if the indicator value does not change, or even if it goes from true to false. Most likely, the event is configured to lock the panel until the event completes, so the stop cannot be pressed to stop the inner loops and we are locked up forever.

 

One "solution" (in big quotes!) would be to change the event to "Boolean2:changed" and wrap a case structure around the inner code so it only executes if the new value is true (FALSE case is empty), and configure the event to not lock the panel and limit the event queue size to one. 

No, I don't recommend any of that! A "house of cards" is not a sane code architecture!


Yeah, you probably want to add a simple "check if changed" and only write to the property node if that's the case. 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 6
(950 Views)