PLECS please add a Stopwatch Block

You can create simple timers / edge detectors using basic components in PLECS like delays and integrators. See the attached example of a very basic “stop watch” and “edge counter”. You would probably want to expand on these designs based on the characteristics of the signals you are trying to measure.

For the triggered capture, it is about determining the appropriate trigger condition. If you want to ensure you always capture the first trigger and not have the data overwritten, then perhaps one could have a Programmable Value block output as the trigger. The trigger would be set initially, and then reset only once the getCaptureTriggerCount() associated with the desired Capture block increases. You could pass the timestamp into a Capture block as a signal.

simple_timer.plecs (21.4 KB)