Siemens S7 IEC Timers

P

Thread Starter

Paul Darby

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.
 
K

Koen Toorenburg

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
 
P
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...
 
E
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
 
R

Ronald Nijssen

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
 
D

Dobrowolski, Jacek

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.
 
D

Dobrowolski, Jacek

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.
 
Top