Hi Mangg,
use a button and set it's switching behaviour to "switch until released".
Then you can use an event structure to detect each value change event and use them to en-/disable your "function"…
General recommendation: Put more text into the message body and less into the thread title!
Best regards,
GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019