PLC_N00B_5

Reset a timers Elapsed time to 0

10 posts in this topic

i have been attempting to reset a timing functions ET to zero with no such luck. I would like to stop the timers output from firing when an E-stop has been hit 

Share this post


Link to post
Share on other sites

TON and TOF do this automatically when the In value changes. Accumulation timer requires a reset signal.

If your E-Stop is in series with the timer input you should be fine without resetting the ET.

Share this post


Link to post
Share on other sites

after the start  input has been and the estop input has been triggered, the output of the TOF timer still accumulates and fires output (10). disregard the MOV function i was testing to see if i could shove a (0) into the ET of the TOF timer to reset.  

line 1 logic everburn.PNG

Share this post


Link to post
Share on other sites

TOF is "unstoppable" with the input switched false. I would either switch the timer type or use your ESTOP in series with the output.

Share this post


Link to post
Share on other sites

what other type would you suggest. the end goal of this is to have a line either run for a set amount of time or to run until stop is pressed.

Share this post


Link to post
Share on other sites

Not Sure I fully understand your application needs but I would do something like this:

Capture.JPG

Share this post


Link to post
Share on other sites
On 11/3/2021 at 6:38 AM, PLC_N00B_5 said:

i have been attempting to reset a timing functions ET to zero with no such luck. I would like to stop the timers output from firing when an E-stop has been hit 

In the OMRON world,

Can you use a "MOVE" instruction when E-stop bit is active that will move Timer's "Preset" value in to Timer's "Accumulated" value? In theory, that should cause timer's "DONE" flag to be set. Right?

 

 

Edited by skyfox

Share this post


Link to post
Share on other sites

Yes, it's possible. The original poster wants the output to be off though. He was attempting the wrong thing when trying to set ET (or PT) to zero. Photovoltaic's solution is a fine example.

Share this post


Link to post
Share on other sites
9 hours ago, skyfox said:

In the OMRON world,

Can you use a "MOVE" instruction when E-stop bit is active that will move Timer's "Preset" value in to Timer's "Accumulated" value? In theory, that should cause timer's "DONE" flag to be set. Right?

 

 

I don't believe so. The timer block will constantly overwrite the  ET and the done bit comes from within.

Share this post


Link to post
Share on other sites

Quite late to the party, but thought I would post in case someone else needed this in future.

Normally I would also just put my "stop" contacts after the TOF output. But I came across a scenario where I really needed to be able to cancel a TOF timer when another function block completed its task (SQL inserts etc). So I created a Function Block for it.

It goes inline in the ladder logic just like any other timer. There are 3 variables: "Initial Time" is the value that you would normally allocate to the PT of a regular TOF. "Delay Time" is the time between when the cancel bit is triggered and the TOF timer is cancelled (I needed this for my program, feel free to remove it if you don't need it for yours). "Cancel Trigger" is the bool that cancels the TOF.

So lets assume "Delay Time" was set for 2s. If "Cancel Trigger" changes to True, 2 seconds would elapse before the timer output changes to False. 

The block contains a standard TOF timer. When the "Cancel Trigger" bool changes to True, the PT on this timer changes to 0.1s, which causes the output to turn off. When the "Cancel Trigger" changes back to false, the PT value changes back to the "Initial Time" input value. As far as I can tell, when the PT changes to 0.1s, the output turns off and doesn't wait another 0.1s. I could be wrong about that, but either way, it worked for me :-).

As for writing a value to the ET of a TOF timer, Sysmac Studio will throw errors during the program build, as you can't write to the output of a Function Block.

Cancellable TOF Timer.smc2

Edited by BE
Uploaded SMC2 File

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