S7-315 FC Timers

Daynada

Member
Join Date
Nov 2005
Location
Wisconsin
Posts
28
I have an FC that I call in 18 different instances. I need to add a timer to the FC now. It appears as though if I just enter a timer, say T10, then this timer follows through for each instance and of course causes a problem since I need it to be individualized. Is there a way to make the Timer a "variable" with the interface menu?

Thank you.
 
Lancie, an FC is a Function Call in the Siemens S7 world. It's basically a function with associated static data like a Function Block would have.
 
Thank you. I just "discovered" that and have already tested. Seems to work good. I simply select "out" rather than "in/out" is this OK?

Also since I'm here...

I now have to add 4 timers per FC. Isn't there a way to have this done internally within the function so that I do not need external inputs for the timers? Perhaps it would need to be an FB?

Newbie to S7.

Thanks again.
 
Sure, you can do just about anything. One of my projects uses over 300 timers, and I don't explicity declare any of them. But if you are a newbie, I wouldn't go down that road right now. But just to give you something to think about, you can address timers indirectly.

For instance, if you passed in an int called something like "TimerInstance" and entered "10", you could point to the timer indirectly like this:

A T[#TimerInstance]

If you needed, say, five timers in this function, you wouold just have to increment TimerInstance:

L #TimerInstance
+ 1
T #TimerInstance

A T[TimerInstance]

You would now be pointing to Timer 11, and so on.
 
Daynada said:
I now have to add 4 timers per FC. Isn't there a way to have this done internally within the function so that I do not need external inputs for the timers? Perhaps it would need to be an FB?

Yes, convert to a function block and use the IEC timers SFB4/5 - you can then have as many as you like in each function block without having to worry about timer numbers.
 
This post explains how to embed FBs within another FB. This is called multiple instance.
http://www.plctalk.net/qanda/showpost.php?p=50741&postcount=16
If you add the IEC timers (SFBs) in the same way as in the example, then you do not have to worry about assigning the timers for each time you call the FB with the embedded IEC timers. They get assigned automatically to the instance DB of the calling FB.

edit: Actually, the example shows double multiple instance (an SBF, within an FB, within an FB). I dont hope that confuses you :)
 
Last edited:
I personally like using Multi-Instance FB but seeing as your new to Step 7 you could use FC80 Timer located in TI-S7 Library. You'll find the SCAN time is published by CPU in OB1. Move that to Global memory area and pass scan time into FC80...it will do the rest.

You'll need to pass in work memory for status but this will allow you to call FC80 for each timer you need in your block.

Nick

FC800.JPG

 

Similar Topics

Hi, I am using CPU315-2DP.There are 256 timers only in it. I need more timers to use in my program.How can I get more timers. I have used the...
Replies
21
Views
4,887
I have a project that I am going to need a timer that runs from 0-30hrs. I need to load a timer Setpoint Value and I need to display the current...
Replies
2
Views
2,639
Dear sir, I am using SIMATIC 300, CPU 315-2DP , (6ES7 315-2AF03-0AB0) VIPA 603-1CC21 A1.0 RAM 32KB, Firmware=V4.0.8 The problem Im using MPI...
Replies
2
Views
167
Hi , Looking for some help. We have a 343-1 PN Lean Card & 315-2DP connected to an external system collecting data. After a recent shutdown...
Replies
0
Views
65
Got a VIPA 315-2AG23 that i try to go online with but can't seem to make it work through a network. I can go online if i'm plugged directly in the...
Replies
4
Views
272
Back
Top Bottom