News:

  • April 16, 2026, 12:14:24 PM

Login with username, password and session length

Author Topic: Timer event  (Read 7022 times)

PStiles

  • Full Member
  • ***
  • Posts: 31
Timer event
« on: December 01, 2010, 07:55:21 PM »
I am trying to use my D405 PLC with 440 processor to turn on a security light. I have a motion dector that is 24 VDC and can turn on a output when it is tripped. The problem is I want to keep the security light on for 5 minutes, and then reset the output. I can set and reset the outputs, the problem I am having is the inout is only active for 5 seconds. When the output stops being active the timer is reseting and the outputs are never truned off.

What I need to have and do not know how to program it is to have the timer star running when the input is active and keep running regardless of the state of the input, until it times out.

My program is below.


PLC 440

// Rung 37
// Address 215
STRN X20
STR X30
OR X31
ANDSTR
SET Y33
SET Y34
SET Y35
TMR T34 K50

// Rung 38
// Address 225
STR T34
RST Y33
RST Y34
RST Y35


#BEGIN ELEMENT_DOC
"UB0","t18","",""
"UB1","T28","",""
"X20","Daytime","",""
"Y0","BYL1","",""
"Y1","BYL2","",""
"Y2","BYL3","",""
"Y3","BYL4","",""
"Y4","BYL5","",""
"Y5","BYL6","",""
"Y6","BYL7","",""
"Y7","BYL8","",""
"Y10","SYL1","",""
"Y11","SYL2","",""
"Y12","SYL3","",""
"Y13","SYL4","",""
"Y14","SYL5","",""
"Y15","SYL6","",""
"Y16","SYL7","",""
"Y17","SYL8","",""
"Y20","FYL1","",""

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Timer event
« Reply #1 on: December 01, 2010, 09:35:47 PM »
The attached will keep t34 on at least for the amount of time in T34's Preset. If C100 is already used adjust to some unused bit location.

PLC 440

// Rung 1
// Address 0
STRN X20
STR C100
ANDN T34
ORSTR
STR X30
OR X31
ANDSTR
SET Y33
SET Y34
SET Y35
TMR T34 K50
OUT C100

// Rung 2
// Address 14
STR T34
RST Y33
RST Y34
RST Y35

// Rung 3
// Address 18
NOP


#BEGIN ELEMENT_DOC
"UB0","t18","",""
"UB1","T28","",""
"X20","Daytime","",""
"Y0","BYL1","",""
"Y1","BYL2","",""
"Y2","BYL3","",""
"Y3","BYL4","",""
"Y4","BYL5","",""
"Y5","BYL6","",""
"Y6","BYL7","",""
"Y7","BYL8","",""
"Y10","SYL1","",""
"Y11","SYL2","",""
"Y12","SYL3","",""
"Y13","SYL4","",""
"Y14","SYL5","",""
"Y15","SYL6","",""
"Y16","SYL7","",""
"Y17","SYL8","",""
"Y20","FYL1","",""

#END
An output is a PLC's way of getting its inputs to change.

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Timer event
« Reply #2 on: December 02, 2010, 07:44:42 AM »
Thank you