Page 1 of 1

convert every constant signal to pulse only when signal turns on

Posted: Sat Jun 13, 2020 6:40 am
by varundevan
hi,

This might be a simple question, but i could not find the exact answer i need.

I have 5 different signals namely 1, 2, 3, 4, 5 coming in a green wire. the time period of this signal is not definite as it depends on train unload time in the station.

the signal 1 may hold for 5 secs , and signal 2 may hold for 5 mins. whenever any of the 5 signal is generated , i want to have an output where only a pulse of that signal is generated.
a pulse of that signal should be generated when the signal is on and no pulse is needed when the signal turns off.
i searched in the forum to find ways to generate pulse, but none suits my exact need.

Thanks for reading and your answers.

Re: convert every constant signal in the network to pulse

Posted: Sat Jun 13, 2020 7:58 am
by tobsimon
Trying to translate your requirement to more technical terms. You want to output the signal for one tick only, if it has changed from the previous state? Then you need to delay the input for one tick (i.e.with an arithmic combinator set to any +0), substract that delayed value from the original signal, so you get a value unequal zero for one tick only if something changed (this is the pulse generator), then normalize the output to one and multiply with the original signal (equally delayed by two combinators, otherwise the first instance of consecutive changes is lost).

Note that the pulse is also generated, if the signal changes back to zero, however the output would be zero as well, so this event is lost.

Re: convert every constant signal to pulse only when signal turns on

Posted: Sat Jun 13, 2020 8:15 am
by DerGraue
Directly above this post are sticky posts. One of them is called "Combinators 101 (Link)". You might want to read that one.

Re: convert every constant signal to pulse only when signal turns on

Posted: Sat Jun 13, 2020 9:06 am
by varundevan
DerGraue wrote:
Sat Jun 13, 2020 8:15 am
Directly above this post are sticky posts. One of them is called "Combinators 101 (Link)". You might want to read that one.
thank you , i just searched and found it useful ..