Running send samples once with a hardware trigger puts the DAQ into a waiting mode. If the send samples command is run a second time, an error is generated. It is not clear to the user what has happened. There should be some way of stopping this. Two options
Ideally it is possible to read back from the DAQ that it's waiting for a trigger and we do not run sendSamples if this is the case.
Alternatively we implement this in software. Setting a bool to true after sendSamples runs and false when stopOptoStim is run. The downside here is the user can't switch between stimuli quickly, which possibly they will want to do.
3af409ddd5c1407bea2e73085f2055e5ca563ed8 makes this the case for finite stimuli. For continuous it will switch from one stimulus set to the other with out warning. Maybe this is OK?
Running send samples once with a hardware trigger puts the DAQ into a waiting mode. If the send samples command is run a second time, an error is generated. It is not clear to the user what has happened. There should be some way of stopping this. Two options