Simatic Timer (S_ODT) inside a FB

ASF

Lifetime Supporting Member
Join Date
Jun 2012
Location
Australia
Posts
3,921
Hi all,

Another question relating to my difficulties with translating my S7-1200 FB's to S7-300 FB's :)

In my S7-1200 FB I have two IEC timers (TON). I have defined them as Static Tags of type TON so that each instance DB that is created when I drop in a new instance of the FB has it's own timers. This all works well.

In the S7-300, I can't use IEC timers. No problem, I can use a Simatic Timer - S_ODT. But I have to change my Static tags to match the new data type. I've tried "Timer", "S_ODT", "SIMATIC_Timer", none of them have worked. Can anyone tell me what data type I have to make them? Or should I be approaching this differently?

Thanks!
 
Hi Jesper,

I'm not sure how to do this in TIA portal - could you explain further?

Even before doing this, I can already use an IEC timer in OB1, and it will compile without errors. But if I try to use it inside an FB, it all appears OK but when I compile I get the error "This use of IEC timers / IEC counters is not possible in this target system."
 
OK. Turns out that the timer really wasn't the problem. The problem was that I can only drive one coil from the timer output. I was trying to drive two in parallel - as soon as I removed one the error went away:

Code:
              ________________
|----| |------|IN    TON    Q|----------(  )---|      = good
              |              |
              |PT__________ET|

              ________________
|----| |------|IN    TON    Q|-----*----(  )---|      = bad
              |              |     |
              |PT__________ET|     L----(  )---|

Don't you love how helpful and specific error codes can be 👨🏻‍🏫
 
I was assuming you were programming the S7-300 with STEP7 Classic.
With Classic you have to include the SFBs manually, whereas TIA handles it for you automatically.

I am guessing that the translation from german explains why the text is not so clear.
It does not say you cannot use IEC timers with S7-300.
It says that this (kind of) use of IEC timers is not possible with S7-300.
For this reason I prefer to read the german documentation. Some of the translation errors I have seen in the past have been quite grave.
 
Yeah, I always get the impression that if I could read German, Siemens would make a lot more sense :)

A few other things you can't do with IEC timers in an S7-300:

Code:
               ________________
|----| |---+---|IN    TON    Q|----------(  )---|  = bad!
           |   |              |
           |   |PT__________ET|
           |
           |   ________________
           +---|IN    TON    Q|----------(  )---|
               |              |
               |PT__________ET|



|----| |---+---| |-----| |-----------------+----(  )---|  = bad!
           |                               |
           |                               |
           |                               |
           |          ________________     |
           +---| |----|IN    TON    Q|-----+
                      |              |
                      |PT__________ET|

               ________________
|----| |-------|IN    TON    Q|------| |------(  )---|  = bad!
               |              |
               |PT__________ET|

so basically it would seem that the only thing you can do with an IEC timer in an S7-300 is contact...timer...coil. Not incredibly useful, especially when you can do all of the things above in an S7-1200 with no issues.

I'm also not a fan of the fact that it'll let you put the rung in, and the little red X goes away (so you think your rung is fine), and it's only when you compile that it raises 30 "you can't do that with a timer" errors. Sigh.
 

Similar Topics

Dear Sir, can you explain that how can we implement the timer s5t Timer time base changes in plc working program. as i have changed the timer...
Replies
8
Views
2,478
Dear All, I have a problem with the Simatic Timer. I'm writing a program to check the pulse signal input, if the input signal is keep changing...
Replies
12
Views
2,839
Hi guys, Good day! I've been working with this problem for quite some time now but still I can't find the solution. I need a timer where I...
Replies
3
Views
4,194
Hello I'm programming something in STEP 7 package for S7-300 PLC and I'm having some problems with timers. One of my function blocks (written...
Replies
10
Views
7,838
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
81
Back
Top Bottom