From: Joaquin on
I need to produce a 3 second single pulse whenever a toggle switch transitions from the OFF to ON position. I don't see in Simulink a way to do this easily. Has anyone faced this issue before? any recommendations? thanks
From: Phil Goddard on
It's a little complicated, but you could do the following:

Have your on/off switch feed the trigger port of a triggered subsystem.
When a trigger occurs have the output of the subsystem go positive.
Use that signal to enable a counter (made from an enabled unit delay block, a summation block, and a constant block).
At the output of the counter have a comparson block that makes the output 0 if the counter value is less than the length of your required pulse and 1 if it is greater.
Do 2 things with that signal:
a) Feed it back into the trigger port of the triggered subsystem as a second trigger that makes the output (of the triggered subsystem) zero when it goes high.
This will disable the counter.
b) NOT the signal, which will give you the pulse length you require.

Phil.