3/9/2016 6:01 AM | |
Joined: 10/7/2005 Last visit: 4/30/2024 Posts: 3004 Rating: (1046) |
Hello Lorney your Timer T 70 behaves exactly as expected and lets start with two statements of fact:
In your case, 20ms is the timer setpoint which means its actual time value will be decremented in 10ms intervals as 10ms is the lowest timebase these type of Timers can have (this dates back to S5 days where these inbuilt Timers already existed). As such, 10ms (timers timebase) is also the accuracy (or error) you can expect and here's best and worst case scenarios: Best case: Your program starts the Timer at a moment in time right after the operating system had its internal 10ms update pulse issued. The first time your Timer is updated is now very close to 10ms after you started the Timer it and it will overall run for just under 20ms. Worst case: Your program starts the Timer at a moment in time just before the operating system is about to issue its internal 10ms update pulse. Your Timer is now immediately updated (counted down by 10ms right after it was started) and will overall run for just over 10ms. In short, expect your T70 have runtimes of anywhere from 10ms to 20ms and anything in between. Program scantime only add to this once when your logic checks for T70 to be expired and drives the output, but still has an effect too. Usage of IEC Timers will better the result and have a look at Simatic Timers vs IEC Timers more on this. Still better though is usage of cyclic interrupt OB's.
|
Cheers |
|
This contribution was helpful to4 thankful Users |
Follow us on