[?]: To call SFB from within FB

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Scarch
Posts: 103
Joined: Fri Aug 31, 2007 8:17 pm
Location: Europe

[?]: To call SFB from within FB

Post by Scarch »

How could I do something like this?:

Code: Select all

L 25
T XX
CALL SFB 4, DB [XX]

I need to use 600 timers in such way, and would like to do it from a FB, by assigning the DB number from that FB. The DBs can be created previously.
I don't think it is possible, am i right?
sania
Site Admin
Posts: 1387
Joined: Sat Aug 13, 2005 6:15 am

Re: [?]: To call SFB from within FB

Post by sania »

insert sfb4 to stat of fb -> 1timer
2 sfb`s -> 2timers
.....
n sfb`s -> n timers
Scarch
Posts: 103
Joined: Fri Aug 31, 2007 8:17 pm
Location: Europe

Re: [?]: To call SFB from within FB

Post by Scarch »

Hi sania,
I insert the SFB OK, but how to link it to any external DB?

Thanks
sania
Site Admin
Posts: 1387
Joined: Sat Aug 13, 2005 6:15 am

Re: [?]: To call SFB from within FB

Post by sania »

why you need external DB?
600 Timers = 600 DB`s
your 1 DB`s have 58 byte x600 = 34800 byte!!!

you can use so:
make 1 FB with 100 Timers & call it 6 times with 6 instance DB`s.
now in your programm only 6 DB ,not 600 !
1 DB have 2236 byte x6 = 13416 byte
Image
of course in your programm you can have use LAD not only STL
Image
Scarch
Posts: 103
Joined: Fri Aug 31, 2007 8:17 pm
Location: Europe

Re: [?]: To call SFB from within FB

Post by Scarch »

It works very well. I just do not know what you say about not using STL. why not?

Many thanks
sania
Site Admin
Posts: 1387
Joined: Sat Aug 13, 2005 6:15 am

Re: [?]: To call SFB from within FB

Post by sania »

of course "It works very well." it`s from my programm ,not sample (suc)
Scarch wrote:what you say about not using STL. why not?
i corrected my post : not only STL :haha:
you are welcome (thnx)
Scarch
Posts: 103
Joined: Fri Aug 31, 2007 8:17 pm
Location: Europe

Re: [?]: To call SFB from within FB

Post by Scarch »

In fact, I use that system to convert IEC to SV timers by means of using flags. You saved me a lot of time. Many thanks ! :)