S7 IEC timer - RESET functionality.

JesperMP

Lifetime Supporting Member + Moderator
Join Date
Feb 2003
Location
ᚴᚬᛒᛅᚾᚼᚬᚠᚾ
Posts
16,223
Hi,

I have an S7 IEC timer question (again):

The normal usage of the S7 IEC timers is fairly straightforward. But a collegue if mine need to do something that is not so normal - at least for S7 IEC timers.
He has to convert an existing AB PLC5 program to S7, and he has used AB timers with a lot of RES (reset) instructions to reset them.
Is it possible to get a similar RESET functionality for an S7 IEC timer ?

I was thinking about clearing the .STATE, .STIME, and .ATIME stat variables. Will that do the trick ?
see picture below to see the "innards" of an S7 IEC timer:
[attachment]

iectimerdb.gif
 
Jesper,

I'm not familiar with the A-B RES instruction. What does it actually do? The IEC definition of an TON timer does not include any control features other than the ENable, IN, and PT parameters. If the A-B timer has a RES command then presumably it's not an IEC-compatible one ...? You may (sorry, your colleague may) be trying to replace a function with one which has different functionality.

There are others timers available in STEP7 : either the built-in firmware timers which mimic the behaviour of S5 code; or the software timers which mimic the behaviour of the inherited TI timers. You'll find these latter ones as FC80 in the TI-S7 Converting Blocks library, and they do have a specific RESET input parameter exactly as TI timers do.

Regards

Ken M.
 
Right - PLC5 timers and IEC timers doesnt have much in common :D

But my friend has a large PLC5 program he must convert as "straight" as possible.
The PLC5 RES instruction is simply a short way to clear .ACC .EN .DN and .TT variables (the variables doesnt translate 100% to similar IEC timer variables).

A little bit of experimenting has told me that you CAN make a do-it-yourself RESET instruction for the IEC timers.
You just have to clear the .STATE and .Q variables.
edit: Also have to clear .ET !

I will have a go at the FC80 block that you mentioned. Thanks for pointing it out (y)
 
Last edited:
Why does your collegue need to use IEC-timers? all the other timers have RESET inputs?
You can change the IEC time to S5 time by using the FC40 block...
 
There are a number of reasons:
1. S5 timers times DOWN. IEC timers times UP like the AB timers do.
2. You can embed an IEC timer inside an FB. You have to "pass" the S5 timer into an FB.
3. The BCD format of the S5 timer is archaic compared to the simple millisecond format of the IEC timer. To use the FC40 TIM_S5TI block would only make sense if we were talking about a few timers.

Both methods have their advantages and disadvantages, but after everything considered, we prefer the IEC timers.
 

Similar Topics

Hello all. This is my first post. I want to enter a time (in seconds) from an MP and use it as a preset for an IEC timer. I can't get ProTool...
Replies
2
Views
4,275
I recently discovered that when downloading an online edit [S7-1500] that requires the initialization of the modified FB's iDB, an IEC timer whose...
Replies
36
Views
11,756
Tried Googling and searching this forum for the answer to this, but no luck, so figured start a new post to see if anyone can help me...or confirm...
Replies
8
Views
3,313
After a previous post I have been trying my best to set up a simple s7 IEC timers within a FB (Timings) and then use it from a FC (FC1). I have...
Replies
24
Views
3,326
Hi all, :huh: How the IEC timer works? I tried to simulate the IEC timer SFB4 in FB but it seems its hard for me to analyse where I...
Replies
6
Views
4,339
Back
Top Bottom