S7 FC incorporating SFB4 SFB5

Daynada

Member
Join Date
Nov 2005
Location
Wisconsin
Posts
28
I like the concept of how the called FC looks in the ladder. The interface is easy for the "next guy". He can see exactly what is assigned to each in and out. But how do I integrate TON and TOF with these so that I don't end up with a bunch of DBs. If I call SFB4 from within the FC it seems I have to assign a data type of Block_DB and then when the FC is called insert DB after DB and populate it. There must be an easier method while still maintaining the FC outline that I like.
 
Use FB's instead of FC's and then use multiple instances to call SFB4 - all instance data can be shared in one big instance DB.
 
No. FB has the same interface as FC, but, FB also has STAT area for storing data in the instance DB.
 
Great. Thank you. If I am going to call the FB a total of 25 diffent times is there a way to get all of the SFB4 to reference only one DB.
For instance..

CALL FB10 , DB10
in1:=m1.0
out1:=m1.1

CALL FB10, DB10
in1:=m2.0
out1:=m2.1

Crude, but I hope that conveys my question. Will this work so DB10.dw0-19 is for the first and DB10.dw20-39 for the second or do I need a different DB each time the FB is called.
 
Create a marshalling FB, say FB9
In the STAT area declare all 25 calls to FB10 by name.
Call all 25 instances using the relevant name.
Call FB9 from OB1 and assign the instance DB.
One instance DB contains all the instance data for all 25 calls.
 

Similar Topics

Hi All I managed to use SFB4 in a FC using the IN_OUT interface, but I would like to improve if possible. Can I determine where the "timer area"...
Replies
9
Views
3,147
Hello! I have used two instances of the iec function block SFB4. They are defined as STAT instances within a calling function block. The presets...
Replies
1
Views
1,606
Hi! Is it possible to declare several SFB4 (TON) in a UDT and then create several DB of type (from our UDT)? I was hoping not to have them...
Replies
4
Views
2,211
If I want to force a TON (SFB4) to be complete can I use a one-shot to initiate a move where I will take the PT value and place it in the ET...
Replies
12
Views
4,541
Hi, I have a simple function block that does not function when I use multi instance SFB4 IEC Timer On Delay. I could not attached a zip of the...
Replies
7
Views
9,089
Back
Top Bottom