Sign in to follow this  
Followers 0
immunoman

Trouble with timers

14 posts in this topic

I'm counting cans on a conveyor using a photelectic eye, and need to turn on an alarm if 1 isn't counted within 3 seconds. The problem I'm having is in activating the done bit when a can isn't detected while at the same time resetting the timer when a can is detected. Can anyone show me the ladder required to perform this seemingly basic task? Edited by immunoman

Share this post


Link to post
Share on other sites
The first occurrence of the input turns on a timer (with a Preset of 3 seconds) and latches it on using its own TT (Timer Timing) bit. Each occurrence of the input also clears (CLR) the accumulator of the timer. (If it's important that the 3 second be from 'turn on' to 'turn on' then one-shot the input and use that to clear the accumulator). This is the key. You DON'T reset the timer. Once started it runs all the time. The presence of new input prevent is from timing out. If the timer ever times out (the DN bit becomes TRUE) then you have detected your error. Edited by b_carlton

Share this post


Link to post
Share on other sites
It seems that by clearing the accumulator using the same input that starts the timer prevents the timer from ever starting. This seems to be the core of my problem. Either I can't get the timer started, or I can't get it to reset using the input that performs the count. That is, the done bit becomes true disallowing me to continue to counting. Edited by immunoman

Share this post


Link to post
Share on other sites
I threw this together, not tested, may not work, the seal in may fix your issue though.

Share this post


Link to post
Share on other sites
If I understand the above correctly ( big if) then see below for another solution. This does not take into account various what-ifs. Like what happens when a second can is missing before the first alarm is reset. What is the alarm supposed to do, light,horn, HMI indication? Is this a real system or student exercise? See picture below
1 person likes this

Share this post


Link to post
Share on other sites
This is what I tried based on your advice, but still I can't figure how to get the timer to reset using the same trigger to initiate the count. Either the timer goes done regardles of trigger, or timer won't begin because trigger initiates reset. This is a student excercise. See picture below

Share this post


Link to post
Share on other sites
Thanks, your solution definitely solves the biggest part of my problem even though it's agonizing me for its simplicity. The only thing now is that with the xio instruction the timer starts as soon as I go on line even without a trigger.

Share this post


Link to post
Share on other sites
have not looked at your code, but maybe you need to inhibit the fault timer when the line is "down".

Share this post


Link to post
Share on other sites
I agree with Ken. As I stated in a previous post the example does not account for various what-ifs. In the real world their will be a whole lot more.

Share this post


Link to post
Share on other sites
You've been helpful on a few of my posts, and I appreciate it. The truth is I'm not sure if I'm on the right path in landing a career using plc's. Do you think there is opportunity using plc's for someone who self-teaches himself how to program, and knows a little bit about industrial controls? My sense is that the most opportunity is for mechanics and technicians, and I don't know if I have the experience required to land that kind of job.

Share this post


Link to post
Share on other sites
It is very unusual for someone to "start" with PLC's. Virually everyone that works with PLC's came from some other discipline (electrician, mechanic, engineer) and more or less became "self taught" along the way out of necessity. I'm a plant engineer. I don't know of any university you can attend with a "plant engineering" degree. Some plant engineers don't have college degrees. There are no schools that I'm aware of that teach you to be an "industrial mechanic" or an "industrial electrician" either. Usually companies that hire on apprentices hire people who can more or less demonstrate an aptitude for it...they can demonstrate either a history or an interest. If the apprenticeship includes a related 2-year technical degree (electrical or mechanical), it can sometimes shorten the "apprenticeship" down to about 3 years. But there is absolutely NO substitute for on-the-job training. This stuff is highly skilled and you can't acquire a skill except by doing the activities. Programming and controls takes a different but related aptitude altogether. Only about 10-20% of the good electricians and mechanics (never mind engineers) have the required aptitude to do well with PLC's. Among engineers since the thought patterns are similar it perhaps goes up to as high as 25% at the most. Also keep in mind that troubleshooting itself is a skill, although it's a skill set that combines logical thinking with experience and knowledge. AND, it is a different skill altogether from programming. Again, there is some crossover and relation but it's not a strong one. A lot of really good troubleshooters write some of the worst programs I've ever seen.
1 person likes this

Share this post


Link to post
Share on other sites
immunoman, Do you have a "system running" bit? or "system enabled", etc...?

Share this post


Link to post
Share on other sites
Try this retriggerable monostable circuit timer.bmp Steve

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0