PLC - Endless timer loops

bmillerx94

Member
Join Date
Feb 2017
Location
United States
Posts
26
Hello,

Before I make my inquiry, allow me to introduce the setting of my question... I am doing a senior project with PLC for college. I am also interested in PLC and automation so this project is a hobby as much as it is a "project".

I am not a complete noob with PLC. I have some experience in school. I understand basic electrical and how to write basic ladder logic. But I am having an incredibly frustrating issue...

First, I havent bought the PLC, but I dont need anything too over the top. I plan to go with a CLICK PLC from Automation Direct with an I/O expansion. All discrete outputs.

The software I am using to write the ladder logic is "LogixPro" - a cheap PLC programming simulator.

So, onto the question. I keep getting a timer loop. Basically, what I am trying to do is turn an output off that is ON in a previous rung, with an output from a timer later in the logic. And no matter what I do, I keep getting a loop. Even when I use a fake output after the last timer, which is turned on by the done bit, to shut off the previous rung output with a NC contact, it still loops.

I have attached a picture of what I am speaking too. If any more information is required, please let me know.

Thank you all

15qry52.png
 
Hi,

The contact enabling the timer is a switch or some other input device. The timer is a TON.

Regardless of the input device to enable the timer, there is virtually no way I can find around this loop. I tried supplementing ACC bits, TT bits, EN bits and none work. This is also known as a "cycle timer" loop, which is actually quite useful for pulsing an output or cycling outputs. A good learning experience but I'm absolutely puzzled and need a solution to get around this.

Thanks for the reply.
 
We really do need to see the logic/addressing used here. We can all guess a few ways that this timer is causing issues, but without seeing the whole picture you will likely not get a complete answer.

Best guess, you are checking if O:2/0 is on in the timer enable line:
1)timer completes, turns O:3/0 on,
next scan,
2)turns off O:2/0, resets timer and turns off done bit, O:3/0 turns off
Next scan
3) since O:2/0 is off, timer restarts.
 
Hi,

You might be onto my problem. Anyway, I've attached 2 circuits Ive just made demonstrating this logic. This exact problem can easily be reproduced using any timer bit at a previous rung as an NC contact.

Regardless of the logic in between, the TON bit (DN, TT, EN, ACC) will loop the program if it is placed as an NC contact in previous lines of the program. Any output that is enabled via the TON directly or indirectly in the logic will have the same effect. See below.

Thanks

54uijm.png



o87ya0.png
 
Yes, as long as your Input is on, it's going to cycle. That's what you've programmed. What are you wanting it to do? Because what you have is this (the second example):

Input On, Motor Off, Turn on Retract Solenoid.
Retract Solenoid runs Timer...200 ms later, DN bit is on
DN bit is on, Turn on Extend Solenoid AND Motor
Next Scan, Motor is now ON, so Retract Solenoid goes Off
This Also turns off timer and DN bit
So Extend Solenoid Turns Off as does Motor

Rinse and Repeat
 
Hi,

Thanks for your reply.

So, I guess what I am asking is, how might I program this to do what I desire? So I want the output solenoid to retract at start of program. When the timer is finished, I want that solenoid retract to shut off. and then the solenoid extend to turn on?

I want to do this without adding any additional physical inputs or outputs. Is this possible?

What I don't really understand is why the DN NC bit in rung 1 doesn't cut power to the timer when it's finished. I suppose this has to do with my lack of knowledge towards scanning.

Thanks for the help.
 
I'm not following what you are trying to do. What is the physical sequence of events you want your solenoids to do, in plain English. There may be a better way to achieve your goal than what you are attempting, but I am not following what your goal is.
 
Hi,

Thanks for your reply.

So, I guess what I am asking is, how might I program this to do what I desire? So I want the output solenoid to retract at start of program. When the timer is finished, I want that solenoid retract to shut off. and then the solenoid extend to turn on?

I want to do this without adding any additional physical inputs or outputs. Is this possible?

What I don't really understand is why the DN NC bit in rung 1 doesn't cut power to the timer when it's finished. I suppose this has to do with my lack of knowledge towards scanning.

Thanks for the help.

The DN Bit is doing what it supposed to do but has nothing to do with your timer logic. The TON instruction runs when the output O:1/0 is on. When the timer completes, the DN bit comes on. But that DN bit only stays on as long as the TON is enabled meaning output O:1/0 remains on. As soon as output O:1/0 turns off in Rung 1, the timer turns off also and so does the DN bit. It's no longer DN because the timer isn't running now.
 
I don't know what you mean by 'loop the program'.

Your program looks like if I:1/0 is ON, the O:1/0 will be on. 2 seconds later, the Timer will set the DN bit. This will turn on O:2/0. Then next scan O:1/0 will be off and the timer resets. The next scan the cycle repeats with O:1/0 being on again.
 
So all you need to do to fix this is put a parallel branch of XIC T4:0.EN around the condition of XIC O:1/0 on the timer rung. Once the timer starts timing (is enabled), the enabled latch will keep it on forever. You'll need to break the latch with some other condition if you need to reset this cycle for any reason.
 
If you are trying to make it so when you push a button, the cylinder extends for an amount of time, then retracts, you could try something along these lines of the attached image.

Capture.PNG
 
What you have programmed as 'method a' is equivalent to the attached image. As stated, I as long as the input is on the timer will cycle repeatedly.

timer loop.PNG
 
Hi folks,

I am not able to test your claims at the moment. I will report back in 12 hours or less.

To better explain myself, my reasoning for adding the NC TON DN bit in the first rung is that it's the same as using any NC output. For instance, suppose that the NC contact was a regular old NC output that is INDEPENDENT of the timer. When that output became true at the bottom of the program., the NC would cut the power to the solenoid on rung 1. Correct?

So, that was my "logic" for using the DN bit the same way. But apparently that does not work.

If I wasn't clear on what I'm trying to do: turn on first solenoid for a period of time. Turn it off after that time is over. Then turn on the other solenoid.

Thanks for all the help.
 

Similar Topics

GitHub Link: Open Industry Project This is a side project I've been working on for some time. The goal is to provide an open platform for...
Replies
0
Views
41
Dear All, Currently i'm working with Endress Hauser flowmeter and AB PLC and try to integrate with 2 items. Flow meter spec using is Promass...
Replies
3
Views
67
Can I connect two A-B Panel View 7 to a A-B PLC. Same graphics etc. One on the local control panel and the other Panel View 7 in a remote control...
Replies
2
Views
50
Hello, I'm working with Studio 5000 and ME Station, and I'm trying to find a way to detect if the PC with the HMI is shut down or not. I've tried...
Replies
5
Views
131
Hi all smart and knowledgeable people.I have a hmi connected to 2 Plcs via ethernet.These 2 Plcs connected to control 2 systems in one machine...
Replies
2
Views
109
Back
Top Bottom