06-28-2023 08:20 PM
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
06-28-2023 09:33 PM
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 .
06-29-2023 01:42 AM
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.
06-29-2023 02:49 AM
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.
06-29-2023 09:10 AM - edited 06-29-2023 09:10 AM
@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!
06-30-2023 04:12 AM
@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.