Hi CZZ,
The valve driver firmware doesn't support timed pulses - so all timing information has to come from the state machine.
If you're manually delivering between trials, or while not running a session, you can create a function to do the override:
function OverrideValveModule(valveID, valveDuration)
sma = NewStateMachine();
sma = AddState(sma, 'Name', 'ValveOpen', ...
'Timer', valveDuration,...
'StateChangeConditions', {'Tup', 'ValveClose'},...
'OutputActions', {'ValveModule1', ['O' valveID]});
sma = AddState(sma, 'Name', 'ValveClose', ...
'Timer', 0,...
'StateChangeConditions', {'Tup', 'Exit'},...
'OutputActions', {'ValveModule1', ['C' valveID]});
SendStateMachine(sma);
RawEvents = RunStateMachine;
To open valve 3 for 0.5s, you'd call it from the command line as:
OverrideValveModule(3, 0.5);
The situation is a bit more complicated if you want to manually override while a trial is running.
You'd add the states above to your state machine description, and trigger them from MATLAB using a soft code as in this example.
If you can't have an interruption of the valve-open time, you can link the valve open and close instructions to a global timer as in this example, then step into a state to trigger the global timer and immediately step back to resume the flow of states in your protocol.
You can also create a GUI button to trigger the soft code, as we use to manually flash the port lights in the LightChasing example protocol.
I hope this helps!
-Josh