9/20/2012 7:55 AM | |
Joined: 3/24/2009 Last visit: 7/9/2024 Posts: 535 Rating:
|
Dear Mojtaba.Sahraean, you can use SFBs in the same way as 'normal' FBs. How you do this depends on the language you are using (STL / LAD / FBD / SCL / CFC / ...), but usually you can drag and drop the SFBs from the 'Program elements'-card (Libraries -> Standard Library -> System Function Blocks) into your FB. If you enter a DB-name (e.g. 'DB100'), the editor will automatically create it with the correct type. For further information please refer to the manual 'STEP 7 - Programming with STEP 7' chapter 4 ("Basics of Designing a Program Structure") and 10 ("Creating Logic Blocks"). Best regards, yy1 |
9/20/2012 8:33 AM | |
Joined: 10/7/2005 Last visit: 9/12/2024 Posts: 3020 Rating:
|
Hello Mojtaba.Sahraean apart from the way Marcjanexplained, you can also do this: - Drag the SFB into your FB - Right click on it and select "change to Multiple instance call" (assuming LAD or FBD is used). You may also find theFAQ How do you create and update multiple instances? helpful. |
Cheers |
|
This contribution was helpful to
1 thankful Users |
9/20/2012 7:21 PM | |
Joined: 8/1/2012 Last visit: 9/2/2024 Posts: 179 Rating:
|
hello this is a simple project http://s1.uplod.ir/files/6/opbya3rhl06t7u/sfb_in_f.rar |
Last edited by: Mojtaba.Sahraean at: 9/20/2012 7:23 PM |
|
9/20/2012 9:10 PM | |
Joined: 8/1/2012 Last visit: 9/2/2024 Posts: 179 Rating:
|
hello I checked it (the link),it works properly here is the ZIP file AttachmentSFB_in_1.zip (159 Downloads) |
Last edited by: Mojtaba.Sahraean at: 9/20/2012 9:13 PM |
|
9/21/2012 2:02 AM | |
Joined: 10/7/2005 Last visit: 9/12/2024 Posts: 3020 Rating:
|
Hello Mojtaba.Sahraean The simple fix is to change all three TEMP variables(i.e. #m1, #m2 & #m3) from TEMP to STAT variables. TEMP variablesare only valid while the Block is executed and do NOT retain teir value from one call to the next and the "Golden rule" for their usage is tointialise them (i.e. unconditonal write access before read access). I hope this helps |
Cheers |
|
Follow us on