Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Timer reset

sarathbabu
2012-03-14
2014-08-21
  • sarathbabu - 2012-03-14

    How to reset a ton or toff timer in codesys?Help would be great

     
  • kberlin - 2012-03-14

    They are reset when you lower the input IN from TRUE to FALSE.

     
  • shooter - 2012-03-15

    you can not stop these timers, as they are running from system timer. but reset is done indeed via the IN
    be aware of cycletime when resetting as this is added to your time.
    for better timers look at w www.oscat.de w

     
  • sarathbabu - 2012-03-20

    Hi correct we cannot stop these timers if we turnoff input.Am facing problem with a toff timer where input is off but when the sequence enters again to same place , timer is triggering even I have stopped the input.Any solution for this issue.Am really looking for a solution.

     
  • shooter - 2012-03-20

    put an ANDNOT timer.Q behind your trigger and before the INPUT. This will stop triggering when the timer is running.

     
  • sarathbabu - 2012-04-10

    You can easily reset it by ondelay(in:=false) at the entry action of the SFC,so that it will reset.

     
  • saimir - 2014-07-18

    I am trying to introduce a time delay between two consecutive steps in sfc and the diffuculty that I am having is that the timer output Q remains high after the step is scaned and the next time there is no time delay. Can anyone help .
    Regards

     
  • shooter - 2014-07-18

    In SFC only the active steps are done and scanned, thus when a timer is in a not active step it will not be seen.
    meaning when you leave a step when timer is expired (normal) the input is not reset, as you left the step.
    To overcome this two ways:
    use the timers from a step itself, or use a timed action from the IEC_sfc.lib
    When viewing the status it will not be updated as you left the step, so the info is wrong.

     
  • saimir - 2014-07-19

    Hi Shooter.
    Thanks for your quick reply. Just to clarify, when you say use the timer from the step you mean that I have to program the step itself and not the action associated with the step it is not clear to me.
    Thanks
    Sam

     
  • shooter - 2014-07-19

    that depends on if you use IEC steps.
    if using IEC steps the programming of all actions is outside the step, in a separate action (you may call it subroutines)
    these actions can be timed, like with a L, D etc.

    If you use doubleclick you can also make a 'subroutine' however you will have to watch the timers, the status is tricky, as soon as the step is left, the timers are not updated anymore, and if you get into the same step again, the timer is not initialised, but depending on the status something will happen.

    make yourself a sfc with 2 transitions you can do with a mouseclick.
    as soon as you go to step 2 the timers in step 1 are stopped and the times on screen are not updated anymore, so they can be anything where they were left.
    also please watch not to use the timer twice as status is unknown. (declaration is in main)

     
  • jzhvymetal - 2014-08-21

    IF you are using SFC start you sequence steps with parallel branches. Then put the Timer FB in the first parallel step to be scanned all the time which creates a cyclic branch. In the second branch put your original sequence that has steps that can be any state. This way the timer is always executed no matter which step you sequence is currently being executed. In your sequence SFC branch you can set/resest the Timer IN pin to start and stop the timer. This method will cause the timer's TIME to be off one scan. If you are worried about one scan you can always set/reset the timer IN pin by the using the following MyTimer(IN:=FALSE); or MyTimer(IN:=TRUE);

     

Log in to post a comment.