I would like to model railway interlocking. The counter recieves impulses with the following parameters:
- length of signal:260 ms
- short break:130 ms
- long break: 520 ms
Here is the signal generator:
These are the block paramaters: Sine:
4-impulses:
And this is the sign in which I would like to count the impulses:
In the example I would like to count 4 impulses in one period because we know that one period is 1950 ms.
CodePudding user response:
This feels fairly convoluted, but it's hopefully easy to follow and adapt.
Essentially you can check how long the pauses are, and if that pause duration satisfies your criteria then increment a counter.
Comment groups added for what each group of blocks is doing, might be possible to simplify this using some latched timers but I didn't explore the block library so this uses all very fundamental blocks.
Diagram (click to enlarge)
Scope: