Host Engineering Forum
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 22, 2012, 04:07:33 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Timer event  (Read 480 times)
PStiles
Full Member
***
Posts: 31


« on: December 01, 2010, 08: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","",""
Logged
b_carlton
Internal Dev
****
Posts: 388



WWW
« Reply #1 on: December 01, 2010, 10: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
Logged

An output is a PLC's way of getting its inputs to change.
PStiles
Full Member
***
Posts: 31


« Reply #2 on: December 02, 2010, 08:44:42 am »

Thank you
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM