MVP 2022 Flex727 Posted October 4, 2015 MVP 2022 Report Share Posted October 4, 2015 I seem to be seeing an issue with the TON function. Any timer that is running when the PLC gets power cycled or rebooted will immediately trigger when the PLC comes back on. The timers are set for "Retained". Shouldn't they just continue timing from where they left off? Quote Link to comment Share on other sites More sharing options...
ofer.yishai Posted October 4, 2015 Report Share Posted October 4, 2015 I found the same issue with retained TA timer. if the timer is not counting (running) when the PLC reset's or power cycle, then the current value retained as should be. But! if a retained direct contact is used to trigger the timer, and its status is "1" when the PLC Resets/Power cycle, then the TA timer status returns with current value off ZERO (instead of continue the countdown as expected), and the output bit is "1", all before the preset time actually elapsed. I guess there is a bug with timers, if triggered on the initial cycle its behave unexpectedly (current value become zero) Quote Link to comment Share on other sites More sharing options...
Robin P Posted October 6, 2015 Report Share Posted October 6, 2015 I need some of my timers to resume from their last Current value following a system reset (which can happen following a software upgrade). If I just retain them they simply re-initialise. I think I can achieve this as follows: 1) Set the timer T to Retained. This just affects the Preset value. 2) In the main scan regularly store a copy of T.Current into a retained tag TC. 3) On the Ladder Initial Cycle (which happens following reset): 3.1) Store T.Preset into a temporary location TP 3.2) Store TC into T.Preset 3.3) Reset timer T. It's Preset and Current values are both now equal to TC 3.4) Store TP into T.Preset. Timer T is now running with its Current value at TC and its Preset at TP, which is where they were prior to reset. In my (limited) testing so far, this works for Reset, Reboot and Power Off. Robin Proctor Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted October 6, 2015 Author MVP 2022 Report Share Posted October 6, 2015 ofer.yishai, I've found a workaround to the timer bug. The timers are being triggered on the Initial Ladder Cycle when active on bootup. If you place an inverted contact for "General.Ladder Initial Cycle" in front of the timer logic, then the timer will behave as it should (reset on bootup without triggering the Out bit, and continue timing). 2 Quote Link to comment Share on other sites More sharing options...
ofer.yishai Posted October 6, 2015 Report Share Posted October 6, 2015 Thanks Robin, It sound good as a workaround, but definitively this will be "work more do less", in opposite of the whole new concept. don't you agree? Should the retained only affect the preset value? ..I wonder... because its sometimes affect current value as well (TA at least..), but only if timer is not running when the power is lost? should current value be retained, I'm not sure, but it is not consistence.. I think it worth some official reference from Unitronics. Another workaround would be to abandon the use of timers, and prefer Inc/Dec functions as time counter with retained or non retains tags depend on the needs. Ofer Quote Link to comment Share on other sites More sharing options...
_MELLON_ Posted March 29, 2019 Report Share Posted March 29, 2019 Does this issue was fixed on the new software release ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.