Step7: How to make custom SFC\SFB\Component Blocks your self?

kas_

Guest
K
Hi all :)
I`m working on a project and I need a time puls function:
I`ll get a variable time cycle 0,01-30.sec from the operator, and i need a 500ms puls every time cycle.

And I made this function by dividing the variable cycle time in two, and set one SD_timer(T1) and on SF_timer(T2) with this halftime, and set the second SF_timer(T3) with T2 to set the 500ms puls.
This is no problem, but I program in FBD so i had to use 3 networks for this puls job, and i have to use this function some more places.

Sow back to my question, can i make my own SFC\SFB\Component-Block with this puls function??
If thats the case, does anybody have a .PDF "how to" guide or somthing on making custom FC\SFB\Component-Blocks in Simatic Step7?

Regards
KAS





 
Last edited:
You could do a FB or a FC wich you can parametrizese (bad spelling I know)

In your case a FC would be enough..

Just declare Three inputs as timers and then declare one input as your halftime..

Then declare an output from the last timer..

Then call this FC as many times as you like each time with a different set of timers as inputs...

If you make an FB you could use the iec timers and thus no need for timernumbers as inputs but if you do not multiple instance those fb then you would need one db per call..
 
Do it with FB's using SFB4 (TON). Now you don't have to eat Timers that you need to manage and someone might step on. Stop using S5Timers and you'll be a happy guy.
 
You can not. SFBs and SFCs are exactly the same as FBs and FCs, but they are built in to the operating system of the PLC. To make SFBs and SFCs yourself you would have to change the OS of the PLC. Simply make FBs and FCs, they have the same possibilities, but can be custom made by yourself.

Kind regards,
 
If you want to make custom blocks and hide the code (as SFC's and SFB's), then once you have written and tested the block, then you can make it KNOW_HOW_PROTECT.
 
Tnx for the reply guys :)
Okey, as i understad i have to use FC or FB`S.
And for your reply "bara_hence", I`m a "beginner" programer, I mostly use PLC`s for faultfinding, sow i did not folow your advise...

"PeterW" Hi, I found it under "Object propertis->General-part2" but i could not stroke the option...


I`m attaching a picture to show what i want to learn how to make :)
does any one have a HowTo guid for making fuctions like this, and maby in making Motor_Blocks?

I hope I`m not a lost cause subject... :)


EDIT:
Actualy this is not the whole program I made, because i hade to use INT_DIV (20s\2=10s) and INT-S5T converter for the 10s halvtime to get a 20s cycle. But I don`t have this in my Library on my home PC I made this example picture on.
whyxpc.jpg

 
Last edited:
Look at attached example may give you some ideas..

I will look for the tips and tricks that describes how this is done...

Please note that I may have done some errors there is late here time to get some sleep..

If i find the tips and tricks documents only in swedish is this still something useful for you??

EDIT Links to examples in swedish.. Hope these help when I started programming these where worth gold.. You can find even more useful on weborder.siemens.se if Swedish is fine..

http://weborder.siemens.se/Item/UploadFiles/1317/Parametrerbara block - FC_5_2_1.pdf
http://weborder.siemens.se/Item/Upl...ng med Step7 - Funktions block - FB_5_3_3.pdf
 
Last edited:
Tack bara_hence. This looks great, I`ll will sit down and study the .PDFs :)
Swedish works fine, I`ll think 30% of manuals in Norway is in swedish :p

If you have some more tips and tricks documents that could be useful, then I would be greatful.

Regards
Kas
 
Yeah, but you guys can read eachothers stuff so why make "translation" from swedish to norwegian when only few letters change :D
 

Similar Topics

is there any free trial version available for step7 professional and wincc comfort v17. i searched and downloaded TRIAL Download STEP 7...
Replies
1
Views
100
Hello. I need your help. I work at STEP7. There are two CPU 317-2 PN/DP controllers (317-2EK14-0AB0), working on PROFIBUS, as Master (CPU_1) and...
Replies
6
Views
206
This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
194
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
176
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
177
Back
Top Bottom