Set Toggle state

Hello,

I need to set the Toggle state (on/off), is it possible ?

The reason for my request is the following : the toggle on state starts a treatment. When the treatment ends, if the toggle is always on, the treatment will be restarted one more time if the user does somethings on the Human UI window.
The solution I imagine is to set the toggle to Off when the treatment is finished.

Thanks in advance,
JLH

As an easy solution you can use the logical operator AND to restart if the toogle is True and also another value (the state you want to consider, maybe another toogle to set if restart) is True. This way if the toogle is True but the state is false, the AND will give false.

1 Like

You mean to set the state of the Toggle with the CreateToggle component plugged into input with the Value Listener current value ? It doesn’t work because it creates a cyclic execution in the definition. So, we need a “Set Toggle” component, as there are “Set Label Contents”, “Set Check Box”, …)