Autor Thema: Delay a pulse (beginner question)  (Gelesen 2417 mal)

Offline fentini

  • Newbie
  • *
  • Beiträge: 4
Delay a pulse (beginner question)
« am: November 28, 2022, 16:05:21 Nachmittag »
Hello,
I'm a beginner and I was programming the following.
When M02 delivers a continuous signal, I want this to be transformed into a pulse to M03, but 5 seconds after that the signal came in. I got it working now with attached timers. But there must be an easier solution with only one timer? (or not?)
Regards Chris

Offline Simon Tyrcha

  • Jr. Member
  • **
  • Beiträge: 40
Antw:Delay a pulse (beginner question)
« Antwort #1 am: November 30, 2022, 23:32:38 Nachmittag »
can you describe the process dictating the timer triggers in more depth?

It likely will require 2 timers, however, depending on the control requirements, might be written differently.

Rule #1 for any type of coding is; IF IT WORKS, DON"T FIX IT; but there are multiple methods for skinning this goat.

Offline fentini

  • Newbie
  • *
  • Beiträge: 4
Antw:Delay a pulse (beginner question)
« Antwort #2 am: Dezember 01, 2022, 11:13:54 Vormittag »
Thanks for your answer.
M02 delivers a pulse (and sometimes a continuous signal), whatever it does I want this to be transformed to a pulse to M03 but 5 seconds after the pulse came in.
So what I have done now is:
M02 delivers signal, the first timer is a pulse timer. It will send out a 6 seconds pulse. Then timer 2 is a delayed timer. It will start sending after 5 seconds, so because timer 1 sends out for 6 seconds, timer 2 will send out a 1 second pulse after 5 seconds. I hope I explained it well.
I was hoping I could do this with one timer, so it is easier to change. On the other hand you are right, it works.

Offline Simon Tyrcha

  • Jr. Member
  • **
  • Beiträge: 40
Antw:Delay a pulse (beginner question)
« Antwort #3 am: März 28, 2023, 21:58:31 Nachmittag »
What is the trigger to end the pulse created by timer 1?

I might suggest that M2 triggers the timer which is your initial delay, and if the pulse generated in your M3 is still required, then trigger your 6 second pulse timer following your initial delay. Use an on-delay timer as your initial delay, and a flashing timer as your pulse.


So m2 starts timer 1 which is set to your 5 second delay, and then activates timer 2, which flashed your 6 second pulse, generating your m3.

I apologize for the delyed reply. I was away from my desk.