News:

  • May 17, 2024, 02:11:58 AM

Login with username, password and session length

Author Topic: OneShot & Pulse Timers (AKA: The long-way, subroutine & structure example)  (Read 2151 times)

Mike@Forshock

  • Sr. Member
  • ****
  • Posts: 58
EDIT: See next post for integrated functions within Domore.  Left this up as a rough example of structures, subroutines and my own humility.


I could not find a built in OneShot* or Pulse Timer, so made a subroutine.** 

Uses the TICKms() math function for timing, in theory can be millisecond resolution.
Uses the SIM for the example.
Press the X0 to initiate the process.
Y0 is one shot, Y1 is pulsed.

*OneShot timers typically continue regardless of the Input/Enable for the specified duration. This is not the case with this example and the Output will drop as soon as the Input does.  If the need arises where I would need the continuation after I may make an alteration.

**I am sure it is not the most efficient scan time wise, but is reusable code for use with multiple items and purposes.
« Last Edit: September 21, 2021, 12:05:49 PM by Mike@Forshock »

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 685
  • Hmmm...
    • Host Engineering, Inc.
Re: OneShot & Pulse Examples
« Reply #1 on: September 21, 2021, 08:40:26 AM »
I didn't look at your program. However, there are, in the instruction set of the Do-more PLCs:
  • Leading-edge (as well as Trailing-edge) One-shot Contacts: Shift-F2, Shift-F3 respectively
  • FLASHER instruction that will cycle an output ON/OFF for specified ms times
  • TIMEDOUT instruction that will time an output
  • On the BRX there are interrupts that can do pulse functions to a microsecond resolution for Input Events as well as One-Shot/Recurrent Timers
Does this help?
« Last Edit: September 21, 2021, 08:43:04 AM by Greg »
There are two types of people in the world; those that can extrapolate from incomplete data sets.

Mike@Forshock

  • Sr. Member
  • ****
  • Posts: 58
Re: OneShot & Pulse Examples
« Reply #2 on: September 21, 2021, 12:02:20 PM »
I didn't look at your program. However, there are, in the instruction set of the Do-more PLCs:
  • Leading-edge (as well as Trailing-edge) One-shot Contacts: Shift-F2, Shift-F3 respectively
  • FLASHER instruction that will cycle an output ON/OFF for specified ms times
  • TIMEDOUT instruction that will time an output
  • On the BRX there are interrupts that can do pulse functions to a microsecond resolution for Input Events as well as One-Shot/Recurrent Timers
Does this help?

Thanks, I searched for pulse in the help as this is the most common term I come across in many platforms.  FLASHER is definitely the answer to that.

Leading-edge coils (ND/PD) are not what I was going for as they are not time controlled, just scan (I came across those)
The TIMEDOUT is almost exactly what I was looking for on when I had my process in mind. 

So, in all, Do-more had them all along just not with terms I was accustomed too haha.

Thanks Greg!