Time a Continuous Event

dskplc

Member
Join Date
Aug 2013
Location
New Zealand
Posts
119
Hello,
I need a horn to go off .5 sec and on .5 sec continuously for total of 2 min. At first I thought it was an infinite event until a stop button was pressed so I created the code as seen using a RES instruction. Now I realized this on/off event needs to go off after a set time. I am stuck for ideas. How do I turn this off after a certain time? Thanks for your help.

timer.jpg
 
Add a counter which is reset by a XIO of AllClearTrip. Have it count the number of times AllClearOffTmr.DN turns on. Set the counter for the number of seconds. Place an XIO of the counter DN bit in line with the horn/light.
 
Your "event" lasts 2 minutes, so create a timer that runs for 2 minutes (Preset 2*60*1000 = 120000)

While that timer is timing, use bit 11 of the timer acc value to control your horn.

Admittedly it is 4.1 secs on, 4.1 secs off, but who's going to notice ?

2014-02-26_014037.jpg
 
Last edited:
Thanks

Hi, I really appreciate these replies! @Bernie. This works great except that when I put the controller in run mode the All Clear event comes on without prompting so I need a start bit to say there's an All Clear needed instead it automatically coming on but if I add an XIC on rung 0 it kills everything...still learning. Why?
Thanks for any help.
 
More info

Hi Bernie,

Good point. The idea is if there is an All Clear Event is needed after an evacuation then I want a Horn and Light to be off/on for 1/2 sec for 2 minutes. I noticed after downloading the routine the timers start timing before I need an all clear horn. Here is what I came up after reading your originally post. I can stop it but can't start it except in "auto mode". Please forgive my ignorance in how to do this.

timer1.jpg
 
Got It!

I figured it out! Thank you. I also liked Daba's idea but when I tried it the on/offs where not equally spaced for some reason.
 
I figured it out! Thank you. I also liked Daba's idea but when I tried it the on/offs where not equally spaced for some reason.

Any bit in a timer accumulator will have an equal ON/OFF time, that is the way binary counting works.

I am now concerned how you determined this was "not equally spaced".

4.1 seconds is a long time in PLC terms, and if you could perceive a different on/off ratio, then something strange is happening with your I/O.

But remember this, if you watch this logic working in RSLogix5000, the update rate (to your PC screen) is typically 0.5 seconds or slower, so what you see on your PC is usually not be what is actually happening in the PLC.

I stand by the the solution I provided, it works in real applications, I've done this scenario many times.
 

Similar Topics

Hi Guys, I'm new to controls and PLCs and this might have a trivial answer. I have a small project with a PLC and a inverter. The inverter...
Replies
25
Views
3,685
Curios on the thoughts of using Continuous vs Periodic tasks. . The old SLC-500's mostly only had Continuous tasks. . The Compact & Control...
Replies
49
Views
13,845
Can anyone explain to me why Rockwell thinks a Continuous task is better than a Periodic task? That is what it defaults to. It may cause your...
Replies
10
Views
2,905
I've got an SLC500 running a 1746-hstp1 controlling a stepper motor. What's the best way to set the motor to run continuously? I only see Jog...
Replies
10
Views
3,147
We have a cutting machine that we designed in house. It uses an encoder to follow the motion of the product and a cam instruction to cause the...
Replies
20
Views
8,209
Back
Top Bottom