cauchy Posted June 27, 2006 Report Posted June 27, 2006 Im new with Siemens. I couldnt understand OB,FB, etc. blocks structures and couldn't find using of these in manuels. How will I use these blocks when I generate a new program? Help please... Sorry I haven't indicated that I will use S7-300 so I've Step7 software Quote
JesperMP Posted June 27, 2006 Report Posted June 27, 2006 Hi cauchy. OB1 is the main program that is scanned cyclically by the CPU. You call other FBs and FCs from OB1. The other OBs are called by the CPU upon special events such as errors or interrupts. It is a good idea to consider which errors you want to catch so that the CPU doesnt stop with a fault. For example: If you dont want to stop the CPU if the cycle time is too long, then add OB80 to the blocks included in the project. To see all OBs, open Libraries .. Standard Library .. Organisation Blocks. Select a block and hit F1 to get help for that block. There are standard FBs and FCs with special functions (SFBs, SFCs). To see all SFBs/SFCs, open Libraries .. Standard Library .. System Function Blocks. Note: Not all SFBs/SFCs are available on all CPUs. Quote
Groo Posted June 27, 2006 Report Posted June 27, 2006 (edited) A bit of extra info on FC's (Functions) and FB's (Function Blocks). Siemens describe them as blocks with memory (FB's) and blocks without memory (FC's). Basically what this comes down to is a couple of things. Both have: IN = Inputs OUT = Outputs IN/OUT's = Input updated as Outputs TEMP's are temporary scratch flags that you can identify in the block and use. but must be conditioned before use. FB's have additionally STAT parameters, these are dedicated flags used only in the block. When an FB is called in the program, you must specify a Data Block as its 'Instance' Data Block, the DB will be generated by the step7 program for that individual call and will contain a 'memory' for all IN's. OUT's. IN/OUT's and STATs. A FC does not need this. Main differences. Because of instance DB's, FB's can be more memory and scan greedy, especially in smaller S7300 systems. In an FB, you can use an OUT parameter, before it is conditioned as its state would have been remembered in the instance DB, in an FC you cannot, as the state of the OUT parameter is unknown until you condition it in the block. Anything put in as a IN would not be updated on completing the block if you change its state in the block. If you want to do any of those things in an FC it must be an IN/OUT parameter. Edited June 27, 2006 by Groo Quote
stplanken Posted June 28, 2006 Report Posted June 28, 2006 This almost seems to indicate you cannot use STAT addresses anywhere but in the FB in which they were declared. You can, of course, use addresses from instance DBs anywhere. Quote
cauchy Posted June 28, 2006 Author Report Posted June 28, 2006 Thanks everybody I will examine.... Quote
Groo Posted June 28, 2006 Report Posted June 28, 2006 ssshhhh, don't complicate things. New a programmer who called a group of FB's without inserting any addresses for the four IN parameters, called it 5 times on a trot without a single IN parameter addressed. He actually set the IN parameters in another place in the code via the DB's, saved him making flags for it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.