PLC - Endless timer loops

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.

The DN bit is like any other....you're not comprehending. The DN bit is turning ON only when the timer logic is true AND the timer finishes. As soon as the logic ahead of the timer is false, then the DN bit is back off, and your first rung is true again. The DN bit doesn't stay on just because the timer completed once. So as soon as your solenoid output goes false in the first rung (which you say you want), then the timer is now off again, and so is the DN bit...just as it was when the first scan occurred.
 
The DN bit is like any other....you're not comprehending. The DN bit is turning ON only when the timer logic is true AND the timer finishes. As soon as the logic ahead of the timer is false, then the DN bit is back off, and your first rung is true again. The DN bit doesn't stay on just because the timer completed once. So as soon as your solenoid output goes false in the first rung (which you say you want), then the timer is now off again, and so is the DN bit...just as it was when the first scan occurred.

Ah OK. That makes sense. It's difficult for me to visualize a lot of this, as I'm fairly inexperienced programming. But that makes sense. Well at least I found a way to make a loop. I'll use this logic in this program to pulse a light bulb.

Anyway, thanks for the explanation. As I said, I'll return back later to see if I can write the logic how I intend.
 
i'm using method a - simpler to type and understand.
Print out your logic and follow the logic through the entire program it 1 rung at a time.
look at each rung and forget what you think is does.
follow the logic.

1. input I:1/0 turns on output O:1/0
2. O:1/0 starts a timer t4:0
3. when t4:0 is done, it turns on output o:2/0
4. you are now at the end of the program.

Now, you must start back at the beginning.
5. rung 0, input i:1/0 is on
5a. timer t4:0 has now timed out and the timer done bit is on, so there is no power going to output O:1/0
6. rung 1 - output O:1/0 is now off which turns off timer t4:0
7. rung 2 - t4:0 is off, so output O:2/0 is off.
8. end of program.

We are now at the start of the program.
look at rung 1, what is the state of timer t4:0 at this point in time???

another way to look at this is thing of your program as a jk flip flop in digital circuits.
output O:1/0 sets the jk flip flop and turns on output O:1/0
timer T4:0 resets the flip flop and turns off O:1/0

hope this helps,
james
 
Last edited:
Print out your logic and follow the logic through the entire program it 1 rung at a time.
look at each rung and forget what you think is does.
follow the logic.
+1

Also, it's not cheating to use a pencil and paper to make notes of the states of various elements as you go along (especially the initial state) to help remember states from the previous scan.
 
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.

Thank you Helliana. Your logic works great. I don't know why I didn't think of this.

Thanks to everyone else for the tips, suggestions, and help understanding the problem!
 
So it looks to me like you are on the right track with your method 1, except for a few details.

Your timer DN bit is going to go low if the timer loses power, so you will turn on Q2.0 for one scan cycle.

There's multiple ways to accomplish your goal:

Use sets and resets.
Use sequence steps and reference the sequence values with comparators to operate the outputs.

You are close and using some SR instructions will probably be the easiest.

Good luck
 

Similar Topics

I've come across a system running omeron cx-programmer version 9.42. Am I going to need to find a legacy version of the software to edit and...
Replies
0
Views
25
I have an old Sentry Palletizer (S/O Number 3007 / Serial Number 1172) that has lost its program as the backup battery died years ago. I can...
Replies
0
Views
56
Hello, good morning, I have been having two problems with the Tia Portal software. The first is that I have installed it on my computer and...
Replies
1
Views
51
I have 2 PLCs. One is networked to our plant, and the other is networked to the first PLC via a 1756-EN2T. I could easily get the second PLC...
Replies
3
Views
49
I have got an Rockwell PLC 1769-L36ERMS . I have assigned a IP address to it . But every-time I Reboot the PLC it looses Communication to my PC...
Replies
1
Views
61
Back
Top Bottom