If most of the OB blocks provided in S7 libraries can cause the S7-318 to stop if not programmed in the project window. Why do most programs include only OB 86 and OB 100 along with the OB 1 Block?
The OB's are called by the operating system. OB100 is called once at startup so this usually contains set-up instructions. OB86 is called
when there is a Profibus DP fault e.g. a slave is disconnected or powered down. OB80 to OB87, OB121 and OB122 are called on various
hardware/programming fault conditions. If any of these conditions are met and the OB is not present in the PLC, the PLC will go to a safe
state i.e. stop. A full list of the OB designations can be found in the help file within the Step7 software suite. Alternatively the manual can be downloaded from the Siemens web site at "www.ad.siemens/support":http://www.ad.siemens/support by entering 1096378 in the search field.
OB100 is the startup OB, when the PLC starts up OB100 is processed ones.
OB86 is the error handeling OB for the profibus network, if you have a profibus network and the netwotk create a hardware failure ob86 will
be called automaticaly by the system, if not programmed the PLC will go into stop
OB's in S5/S7, here S7, do different things.
OB1 has to be present to run a program. Erase the memory completely the PLC will reproduce the ob1, empty.
In the case of OB86 (Rack_Fault), when present, the S7 won't go to stop if it has a Rack_fault. If a rack_fault is present a special
program, or not can be done. If stop is wanted use - CALL SFC 46 - in the ob.
OB100 is for a complete Restart or if when the PLC goes from stop to run, it does this ob. Must not be present but could be used to i.e.
In -library-stdobs-<ap-off> are all ob's. Use detail view and <F1> to find out about other OB's.
I wouldnt say that most programs contain these 2 OB's but they are very common.
OB100 is the warm restart or first scan OB.
So if you need to set certain bits or values- this is where to put your logic for those functions.
OB86 is a rack fault OB. "The operating system of the CPU calls OB86 whenever the failure of an expansion rack, a DP master system, or a
station is detected in the distributed I/Os (both when entering and outgoing event)".So if your shutting off a remote profibus rack and
still need your CPU to RUN then insert this OB.
Look through all your (318 CPU) OB's. They are very powerful.
I can only imagine that the programmer has decided not to cause all Errors to be managed by the system, but wants the PLC to go to stop and have a maintenance engineer check the reason in the PLC diagnostics
Extensive knowledge of the functionality of all Exception OB's is not required anymore to use them, in the latest versions of Step7 a Wizard has been added that will generate all Exception Handling and Alarming because of System, Program, Communication, IO Network, IO card, IO channel (assuming this functionality is provided by the modules) The, comprehensive, wizard generates OB's and several standard Functions to cover all this. The OB's and logic generated are specific for the used CPU
Please contact your Siemens rep. if you need more info
It's not the OB blocks (or lack of them) what causes a S7 CPU to stop. There are many faults detected by the CPU's operating system which are "recoverable" if their OB blocks are programmed. But when not programmed (which means no fault handling routine exists) - operating system will stop CPU with error. If a programmer uses those special OB blocks, it's his responsibility to react to all faults in a proper way. Otherwise really erratic and potentially dangerous operation of a PLC can occur.
A call to an out-of-range memory location is performed in a program (due to programmer's error) - read value is indeterminate. Then the operating system calls OB 121. If OB 121 exist (it can be even empty - no code at all) - CPU will continue program execution. Now think what can happen if that value is a setpoint for a temperature control of a product - whole production can be wasted or something like that.
Jacek Dobrowolski, M. Sc. E. Eng.