Jump to content

Timer doesn't stop after RLO of FBD down


timboekhorst

Recommended Posts

Controller: US7-B5-T24, Unilogic

When the PackML states "Execute," "Completing," and "Completed" are active, the function EM10 M1100 is invoked.

Knipsel1.png

Inside the function M1100, there is a TA timer (stage timer) that becomes active during specific steps in the program.

Knipsel2.png

When the PackML states are not true (not in "Execute," "Completing," or "Completed" states), the timer inside the function stops. However, the problem arises when one of these conditions becomes true again, as the timer appears to have jumped ahead, as if it had never stopped in the first place.

Link to comment
Share on other sites

  • MVP 2023

Let us know if "Stage Timer" is a local or a global variable.

Putting a timer inside a UDFB is not recommended as the local variables are created and destroyed with the function call.  I don't know what's going on in your case.  Is "Stage Timer" used anywhere else?

I would roll my own global accumulator using an Add block and a system time variable as a pulse.  If this function is called in many places you'll have to add code to load and unload the value of the time accumulator in your function.

Joe T. 

 

Link to comment
Share on other sites

The TA Stage Timer is an Input Variable in the UDFB, which is linked to a Global Variable. The reason to make it globally is indeed to preserve its value. The Stage Timer is only used in this function.

Example situation:

Step 1: PackML State Execute: Func call M1100: Timer starts counting down (preset 00:30:00:000).

Step 2: PackML State Hold: Func M1100 is not active anymore. Looking at a global variable list the timer is stopped (example time: 00:28:21:532).

Step 3: PackML State Execute active again after two minutes, meaning Func M1100 is also active. The timer jumps to 00:26:21:532) and continues counting down.

Any ideas?

 

 

Link to comment
Share on other sites

hi timboekhorst,

seems strange...or better I never had problem with timers like you described...in my opinion you have to perform some debugs like:

check if the "current" variable of your timer is call somewhere in the program

insert one or more "activation counter" in the same row where your UDFB is called...to be sure that BITs command are not flikering for some reasons.

Link to comment
Share on other sites

I also did a test...with USP-070-x10/x08 and Unilogic App 1.33.348 and when i use a timer inside a UDFB it works as described by timboekhorst.

then i downgrade at version 1.26.90 and the problem still be present...also if the timer is managed as FunctionIn variable, so inside the UDFB i have a local timer, the counter still count...and every timer works in the same way...for example the TON doesn't restart when the RLO is off...with the timer in the main function block all seems works fine.

hope that is helpful for the debug...

Link to comment
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
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.