which OB to use in S7

goxx

Member
Join Date
Jan 2005
Posts
84
i posted a thread earlier about changing STL to LAD, i want to create a OB just for my use, not to be downloaded in the PLC. even if it was, it won't be called, so it wouldn't affect anything, i think. my question is, i know siemens uses certain OB's, FB's, FC's and so on for certain functions, am i free to create any OB i want? my program is using OB 1, 80, 82, 85, 86, 87, 121, 122. i want to use OB4, is this gonna cause any problems? thanks!
 
I guess my first question would be "Why do you want to do this?"

And second, why does it need to be an OB?

I have never thought about it before, but I don't think you can create your own OBs. But that isn't to say that you can't include any code you want in a standard OB. But if the block isn't even going to be downloaded to the PLC, why don't you use an FC instead?
 
Why on earth would you want to do it ? use an FC as suggested , and either call it or don't dependent on requirements - you run the risk of total confusion with differing online and offline partners.
 
it's a S5 program converted to S7, all in STL. our guys can read ladder ok, but STL is like chinese arithmetic. just trying to simplify it for everybody. i know the simple solution would be for everybody to learn STL, but that ain't gonna happen. none of us do programing for a living, just maintenance in general. i think that as far as programming goes, you either have an interest in it, or you don't. plus, when they say "we have a guy that does that, why should i do it", i am that guy. that's one reason i hang out at this site so much. most of the time i don't know what the heck folks are talking about, but i can dig into it for a bit and learn some stuff. i think folks really appreciate the help all you guys offer.

ok, i will use a FC. thanks!
 
kirso said:
Mainly concerned with s5, But isnt an OB automatically scanned and run ?

No, only OB1 is scanned everytime, the other OB's that deal with interupts, faults, etc are called as and when required.

To the original poster,

I assume that you wish to add an FC for you to practice programming in, if this FC is not going to be used within the PLC, just create a new project, don't edit your original one because as Fred states, this could cause problems with the online and offline partners.

Paul
 
The hierarchy of code execution in S7 always starts with the operating system. It decides when to activate the Organisation Blocks. Every Organisation Block has a pre-defined trigger condition that will cause it to be activated. In the case of OB1, this trigger is OB1 itself completing, or OB100, OB101 or OB102 (Start-up OBs) completing. For OB35 it is a defined time-interval from the last time OB35 was executed. For OB40 it is a defined hardware interrupt signal from an I/O module. For OB121 it is the detection of a programming error. And so on. Not every CPU in the S7 family supports every OB. You can not create 'new' OBs with arbitrary numbers. You can not decide when or how an OB is to be triggered - that is designed in as part of the S7 operating system. Different OBs have different levels of priority, so certain ones can interrupt the processing of others in order to deal with more important tasks. With an FC or FB you can change the number and the block itself will work exactly as before. If you were to change the number of an OB you would change its signature to the operating system and so it would get triggered under entirely different circumstances.

What you do from there on down in terms of FCs and FBs is entirely your choice. Even Siemens' own library functions can be renumbered if you wish. But it's up to you to do the housekeeping on changes of numbering and purpose.

Regards

Ken.
 
It sounds like you have already gone through some of the pain, converting S5 to S7. I have converted quite a few S5 to S7 projects and then went to LADDER. For a program with 1000 I/o, I figure a little more than 40 hours, including some documentation. If you want me to take a "look-see" and help you along, go to my web site @ VegasAutomation.com and use my email link and send me your S5 and S7 projects, including any documentation. I can't guarantee it will be 100%, but I can get you going. If it's small enough, I'll knock it out for you.
 
thanks for the help everybody. i did create a FC and copied another FC to it. it's in STL, i am trying to convert everything to ladder. i'm creating a new network for each coil, each set and reset. most networks are converting, but some of them, which i think should convert, just ain't doing it.

mr. robbins, i appreciate your offer. i will send you a couple of these networks. i have converted them to ladder by hand, instead of using the VIEW, it would be good if i can double check myself.

this S5 to S7 change was made by outside contractor, there is no documentation, that's something i am going to have to do also. i work the night shift, and most all of this kind of work is done during the day.
 
Back
Top Bottom