Simple timer reset RS5000

rscott9399

Member
Join Date
Aug 2017
Location
in space
Posts
114
So i am a EE and mostly work in protections. I recently got thrust into more of a controls roll and need to start learning some logic.

What better place to start then making something blink

Im using RS5000 and a compact logix rack to mess around

I built this tiny little simply bit of logic.
I assumed the done bit of the TON timer would trigger my timer reset coil

Alas it will not work.
If i remove the reset the timer works fine of course. If i replace the reset with just a memory bit the done bit will toggle when the timer is done
However, when the reset is in place, the accumulator never reaches 1000 and the done but never turns on. However the timer somehow manages to reset itself and start over. I have no clue how

Can someone explain to me what is going on

img.php
[/URL][/IMG]
 
Last edited:
You need two timers. One for your on time and another for the off time. It could be done with one timer too,but your output rung would look different. Try this.

flash.jpg
 
Hi there
Many thanks for the reply

I have seen that approach and many others like it
What I'm really interested in here is why my method does not work.
In my years of engineering I have found its not only important to understand why things work but also why they don't work
 
However, when the reset is in place, the accumulator never reaches 1000 and the done but never turns on. However the timer somehow manages to reset itself and start over. I have no clue how[The acc does reach 100 and the done bit does turn on it just happens so fast your screen will never show it.The done bit is only on one scan or about 5ms./QUOTE]
 
However, when the reset is in place, the accumulator never reaches 1000 and the done but never turns on. However the timer somehow manages to reset itself and start over. I have no clue how
The acc does reach 1000 and the done bit does turn on it just happens so fast your screen will never show it.The done bit is only on one scan or about 5ms. Start a trend of the two tags and you will see this.
 
Humm.. I just tested it to be sure and it works fine.

Keep in mind the Done bit comes on really fast and you won't see it on your screen then the timer goes back and re-start to time again.
 
So i am a EE and mostly work in protections. I recently got thrust into more of a controls roll and need to start learning some logic.

What better place to start then making something blink

Im using RS5000 and a compact logix rack to mess around

I built this tiny little simply bit of logic.
I assumed the done bit of the TON timer would trigger my timer reset coil

Alas it will not work.
If i remove the reset the timer works fine of course. If i replace the reset with just a memory bit the done bit will toggle when the timer is done
However, when the reset is in place, the accumulator never reaches 1000 and the done but never turns on. However the timer somehow manages to reset itself and start over. I have no clue how

Can someone explain to me what is going on

img.php
[/URL][/IMG]

To fully understand this, what better place to start than for you to act as the processor of the code.

Take each instruction as it occurs in your much slower timescale, then amplify it to the speed at which the code is actually executed.

The following is a roundup, the numbering is rung:instruction

0:1 Read that the tag "test" is true

0:2 Enable the timer. Note that enabling the timer, or even the presence of the timer instruction, has no effect on the rung condition true or false, so the timer's "Enable_In" is mapped to the timer's "Enable_Out".

0:3 The rung is true, so the OTE instruction writes a "1" to the output tag.

1:0 Inspect the timer's DN bit, on this and many more scans, it will be false, so the rung logic continuity (RLC) becomes false

1:1 The previous instruction made the RLC false, so the RES instruction does nothing.

Now we need to skip a few thousand scans of the logic, nothing is ever "held up" waiting for timers etc.

Some time later, in this case XXXX mS...

0:0 "test" is still true, so pass RLC = True to the next instruction.

0:1 The timer remains enabled, but this time around, it has reached or exceeded its preset time period, and it turns on its .DN flag... but still the Enable-In is passed through to the Enable_Out, nothing has made the rung false, so RLC = True

0:2 RLC being True, the OTE again writes a "1" to the output bit (which it has done every single scan of the logic up to now).

1:0 The XIC of the .DN bit is now true, so RLC = True is passed to the next instruction.

1:1 RLC is now true, so the timer is reset.

On the next scan of the logic....

0:0 "test" is still true, so RLC true is passed to the next instruction...

0:1 RLC is true, so the timer is enabled, RLC true is passed to the next instruction...

0:2 RLC is true, so the OTE writes a "1" to the output tag.

Repeat ad nausiem...

Summarising - It is clear from the above narrative, if you can get your head around it, that at no time, ever, does the rung logic continuity ever become false to write a "0" to the output tag, so that tag will never become "false", even for a few microseconds, there simply isn't a case where it is ever turned off.

Have you noticed that the only thing that ties the instructions together is the current state of the rung, the RLC ?

Instructions in the code do not know what precedes them, or what succeeds them, they are only told what the RLC is, and they may, or may not change the RLC. There is a definition that "conditional" instructions (i.e. "test something") can change the RLC, but "unconditional" instructions (i.e. "do" something") cannot change the RLC. In your example the timer is an unconditional "do" instruction, which maintains RLC.
 
Communication from the PLC to the RSLogix program takes place after the scan is completed. The timer reaches 1000 and the /DN bit turns ON. In the next ring the timer is reset which clears the accumulator to zero and reset the /DN bit. Only after this can the RSLogix program ask for the value of the /DN bit and the accumulator. But they are zeroed out by that point.

If you want any chance to see the value get to 1000 and the /DN bit on place the reset rung BEFORE the timer rung. But this still will show this only occasionally.
 
Last edited:
As the reason your logic isn't working has already been explained, I just wanted to show another example of a blink timer. This is a single branched rung, the output blinks on a half second interval (on for half a second, off for half a second). Easier to watch than an OTE on for a single scan :ROFLMAO:

Blink.jpg
 
Last edited:
Thanks for all the replies

I tried something different today.
I must say i am infuriated by the details of this ladder business

with this circuit if one were to draw a simple XY plot and plot the following 4 items on a 1 second time scale
Timer[0] Enable
Timer[0] Done
Timer[1] Enable
Timer[1] Done

you should get the following results

In the Plot picture i uploaded the point i circled should actually stop the circuit and not allow it to continue.
The first rung has a "true if off "
When the done bit of the second timer is triggered it should invalidate Rung #1

For some reason this circuit is actually working.
I have no idea why

timer2.jpg timer3.jpg
 
Last edited:
I came from programming DCS before I played with PLC so I understand the frustration. Keep in mind though, ladder is just another language with different grammar. In DCS programing or even in standard software programming, even if event driven, the way the program is scanned or interpreted is very different than how ladder is handled.

Since you are an EE, think of ladder as relay replacement. How would a timer relay behave if wired as you programmed it?

OT: anyone seen the movie Arrival? It got great discourse on how language influence one's way of viewing the world.
 
In the bottom footer below the text box is a "Go Advanced" button

Capture.png

then this button here at the top

Capture 2.PNG

this will open
Capture 3.PNG

then go back here

Capture 4.PNG
Select

Have fun
 
You need two timers. One for your on time and another for the off time. It could be done with one timer too,but your output rung would look different. Try this.

This is essentially what i tried below
Looking at a plot of this circuit it should not actually work

As i said below the done bit of timer 2 or the bottom timer whatever you want to call it should invalidate the rung of the top timer

How is it possible for this to work
 

Similar Topics

I need a better understanding of the reset function for wiring a specific circuit for my dad's shop. I understand simple logic and the concept...
Replies
23
Views
7,563
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
215
I want to replace a Grasslin timer with something that Communicates via EtherNet/IP™ I keep getting schedule changes that force me to go out and...
Replies
2
Views
1,588
Hi guys, i've a simple action to do with a air punch. When power on the machine with a toggle (always true), timing should be on adjustable about...
Replies
5
Views
2,055
Hi all. Stumbled upon this site during a few PLC beginner searches and it looks like a great community. I have a simple beginner question about a...
Replies
3
Views
2,833
Back
Top Bottom