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","",""