You would need Digital I/O instead of switch(es).
This article may give you some useful information about using Digital I/O for Test, Control, and Design
The CASE, with DAQmx Write in it, will not be executed at when the control boolean is switched to FALSE. And, when it is TRUE, the CASE is continuously being executed...
You need to check for Boolean value change (by shift-register or by event). When boolean value is changed, it executes the "TRUE" CASE and the last/ latest boolean value is to set the digital line using DAQmx Write. Likewise for when boolean is changed to FALSE.
See attached sample of simple boolean value change and action... for your reference 😉