S7-300 timers and scan cycle time

TomTom

Member
Join Date
Oct 2009
Location
The Hague
Posts
18
Hi all,

I probably have some short questions for you. I'm trying to understand timers and the Siemens operating system in more detail.

Introduction:
We use a Siemens S7-300 PLC. In the program I use timers of various lenght, between 200 and 900ms.
The scan cycle time on avarage is 5ms.
The timing of our timers is important.

Questions:
- I understand from postings in this forum that timers update asynchronously. So if a timer reaches its set value and the program is in its cycle the changing value of the timer will be used in that particular cycle, from that point on, as I understand. Is this correct?
- If the timer reaches its set value and the conditions in the program using this timer have just past, the timer has a delay of maximum 1 scan cycle time. Is this correct? This would mean that my timers have an accuracy of +5ms in this example? (The respons time of actuators is not taken in consideration here)
- Is there a way to avoid this 'inaccuracy'?

Thanks in advance.

Cheers, Tom
 
Hi if you require accuracy below 5mS then i would suggest that a PLC isnt the way to go
 
Well, that's an interesting point of view and I agree.
But then again, I'm still interested in understanding these timing processes inside the PLC better. Just for the sake of understanding and learning.
What do you think of my other questions? Or can you explain a little more about 'the flow of the program' concerning timers?
Thanks in advance.

Ciao, Tom
 
You are probably talking about the IEC timers.
The IEC timers are accurate to 1ms.

But your logic that is called by OB1 does not update more often the approx 5 ms. That gives you an "inaccuracy" of the execution of the logic of approximately half of the 5 ms, so 2.5 ms on average.

If you have something that must update faster than 5 ms, then you can consider to use cyclically timed interrupts. Depending on the CPU you can get cyclical updates down to 1 ms. The IEC timers will still be accurate to 1 ms.
 
You need to consider the scan time....

Consider SFB4, TON The timer is looked at every scan (provided it is in a called block) so the PLC will process the timers DB accordingly and once the preset has been reached, will turn on the.Q

The .Q will then stay on so if timing is critical then put the critical code immediatley below the timer call in your logic. It will take 1 scan to populate the complete code where yuou have used the .Q

Like wise when the timer enable goes off the .Q will immediatly reset but will take 1 scan to turn off other coils etc where you have used the .Q

Therefore you cannot avoid upto 1 scan time error but you can minimise it by careful coding
 
Last edited:
I understand from postings in this forum that timers update asynchronously.

This means that if you check the state of a timer in one part of your program it may not be the same in another part of the program.
 
Does VPA have a timer with µs resolution ?

Yes, SFB 7 and SFC 53 provides µs Resolution within the Speed7 based PLCs.

If µs resolution is required for measurement of external events or controlling outputs: VIPA SLIO I/O System provides µs based I/O Control also for SIEMENS PLCs.
 

Similar Topics

I've used the following timer code in S7-300's for a long time. When migrated to an S7-1500 plc, the timer behaviour changes so that I no longer...
Replies
22
Views
5,397
Dear all colleagues and members I have worked for a company and I created a program for them for small automation but they dont want to give my...
Replies
12
Views
4,710
Hi, I'm looking for a way to pause the timers I have in my PLC. I'm making a program which has a safety switch which is supposed to pause the...
Replies
5
Views
2,148
Hello, I need to be able to write time directly to a Siemens TON SFB4 timer. How can I do that through Wonderware Intouch using DasSiDirect...
Replies
2
Views
4,749
Hello friends I start newly plc programing with S7 300 but I dont know how to set and S_CU up counter, can any one help me about that with all...
Replies
4
Views
6,103
Back
Top Bottom