Today is...
Thursday, December 18, 2014
Welcome to Control.com, the global online
community of automation professionals.
Advertisement
Featured Video...
Featured Video
A quick introduction to EtherCAT for motion control and I/O...
Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive
Siemens S7 IEC Timers
Where do I find IEC Timers for Step 7

Has anybody used IEC Timers when programming in Step 7? If so, do you have to program in SCL to utilise them?

I am setting up a redundancy system which specifies that I cannot use the usual S5T# type timers.

By Koen Toorenburg on 17 October, 2002 - 6:15 pm

By my knowledge, the S7 doen't support IEC-time.
I usually make my own counters in scl as a function. In adds 1 to an integer value every clockpulse. Once the value has reached the preset-value it sets a bit. The clockpulse can be made by using an one shot-trigger linked to a time-pulse from the CPU.
If you redundancy-system is another S7, they can share the memories with the integer counter-values.
Due to the slow program-execution of the S7, the timebase of the counter is at least 100ms.

Have "fun" with the S7

Of course there are IEC timers. Look under
Libraries- Stardard Libray- System Function Blocks.

There are your TON, TOF timers ..etc

I have since found some IEC format timers and counters in \Standard Library\System Function Blocks\SFB's 0-6 which seem to work ok...

By Dobrowolski, Jacek on 23 October, 2002 - 4:07 pm

Koen Toorenburg wrote:
<...>
By my knowledge, the S7 doen't support IEC-time.
<...>

As far as S7-300/400 is concerned you are wrong.

<...>
I usually make my own counters in scl as a function. .....Due to the slow program-execution of the S7, the timebase of the counter is at least 100ms.
<...>

Possibly you could improve your timers by using OB1_PREV_CYCLE variable - depending on you program scan time it could be up to 100 times
shorter time base.

Best regards,

Jacek Dobrowolski, M. Sc. E. Eng.
Software Eng.

P.S. And good luck with having "fun" with S7, whatever this means for you.

By Eric Buysse on 18 October, 2002 - 11:54 am

TIME (IEC time)IEC time in steps of 1 ms, integer signed
example
L T#0D_1H_1M_0S_0MS
Or
L TIME#0D_1H_1M_0S_0MS

Greetings
Eric

By Ronald Nijssen on 20 October, 2002 - 2:29 pm

No, you can use them in any Step7 language: LAD, IL, FDB, SCL, CFC Please see my answer to a similar question on Sept. 1, 2002 (look for "IEC Timers" in the Archive")

Consider using them in Multi-Instance form, this means declaring them in the STATIC part of a FB Header, this will give a much more efficient memeory (DB-nr) usage

Regards
Ronald

By Dobrowolski, Jacek on 23 October, 2002 - 9:42 am

Hi,

You can use them in any S7 language. But there're two ways of doing that:
1) calling them as FBs with a instance DB,
2) defining variable of type of desired timer in a FB static data area and calling the timer from this FB body.

Regards,

Jacek Dobrowolski, M. Sc. E. Eng.
Software Eng.