News:

  • June 09, 2026, 02:14:24 AM

Login with username, password and session length

Author Topic: Delay D4-16TR output 1 Sec before turning on.  (Read 16509 times)

PStiles

  • Full Member
  • ***
  • Posts: 31
Delay D4-16TR output 1 Sec before turning on.
« on: August 29, 2010, 02:59:37 PM »
I am using A D4 unit with a 440 CPU to control some outdoor lighting. I have a simple that turn the light on when a photo sensor activates input Xo. What I am asking is how can I delay each output by 1 sec before turing on. For example, the first out output would turn on, the 1 sec later the 2nd would turn on, then 1 sec later the 3rd and so on.

Thanks ,

Paul

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Delay D4-16TR output 1 Sec before turning on.
« Reply #1 on: August 29, 2010, 07:59:07 PM »
There's two ways to attack this:

The first would be visually obvious. Have X0 turn on a timer with a preset of 1 second. Its 'done bit' would turn on the first output and also start a second timer with a preset of one second etc. This would be, as I said, visually obvious to the casual person seeing this program. If it is only you and you have a lot of space go for it. Individual delays between outputs turning on would be changeable merely by changing presets.

The second would start only one timer at the turn on of X0. It's preset would be equal or greater than the sum of the delays you mentioned. After the timer would be a series of rungs comparing the accumulated time of the timer to some value. If still as you described the first comparison would be one second. If Equal to or greater than that preset turn on the first output. The next rung would perform a similar comparison but to the sum of the two presets (2 seconds for example). When that was true the second output would be turned on.

Either way, with appropriate documentation it becomes a choice of your particular style.
An output is a PLC's way of getting its inputs to change.

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Delay D4-16TR output 1 Sec before turning on.
« Reply #2 on: August 30, 2010, 08:47:09 AM »
I would prefer to use the 2nd option, would you be able to tell me where I can find the documentation for ths option?


b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Delay D4-16TR output 1 Sec before turning on.
« Reply #3 on: August 30, 2010, 09:31:04 AM »
There is no specific documentation other than the CPU manual itself, and my paragraph. In the CPU manual read about timers, their accumulated value and comparison instructions. Start writing the program beginning with the first rung. Post if you have problems.
« Last Edit: August 30, 2010, 10:00:42 AM by b_carlton »
An output is a PLC's way of getting its inputs to change.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Delay D4-16TR output 1 Sec before turning on.
« Reply #4 on: August 30, 2010, 11:37:37 AM »
This is a natural application for a drum (timed version), but might be a slight overkill for what you're trying to do.  If you want to look into it, look at the help for the instruction at

Help -> Help -> 05/06/105/205/350/405 Instructions -> DRUM
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Delay D4-16TR output 1 Sec before turning on.
« Reply #5 on: August 30, 2010, 01:33:38 PM »
I guess I am missing something here. I read the ocumentation on timers in the Direct Soft manual and it it not working. Here is the program, it is simple until I get the timer element working.

PLC 440

// Rung 1
// Address 0
STRNI X0
TMR T0 K1000
OUT Y0
TMR T1 K100
OUT Y1

// Rung 2
// Address 9
END

// Rung 3
// Address 10
NOP

// Rung 4
// Address 11
NOP

// Rung 5
// Address 12
NOP

// Rung 6
// Address 13
NOP

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Delay D4-16TR output 1 Sec before turning on.
« Reply #6 on: August 30, 2010, 02:05:51 PM »
Try this:

PLC 440

// Rung 1
// Address 0
STR X0
TMR T0 K100

// Rung 2
// Address 5
STR T0
OUT Y0
TMR T1 K100

// Rung 3
// Address 10
STR T1
OUT Y1

// Rung 4
// Address 12
END

// Rung 5
// Address 13
NOP

// Rung 6
// Address 14
NOP

// Rung 7
// Address 15
NOP

// Rung 8
// Address 16
NOP
An output is a PLC's way of getting its inputs to change.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Delay D4-16TR output 1 Sec before turning on.
« Reply #7 on: August 30, 2010, 02:08:47 PM »
Will your input stay on the entire time that the outputs should be on? If not please describe exactly the timing relationship between the input and the outputs.

By the way - my posting of the program is an example of the beginning of the first 'option' I mentioned. You would just continue adding timers and outputs.
« Last Edit: August 30, 2010, 02:29:32 PM by b_carlton »
An output is a PLC's way of getting its inputs to change.

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Delay D4-16TR output 1 Sec before turning on.
« Reply #8 on: August 30, 2010, 02:34:47 PM »
That worked, thank you.