The S7-1200 CPU is cleverly designed with a diverse range of block types designed to perform automated tasks efficiently. As a bridge between the operating system and the user's program, the Organization Block (OB) is programmed to precisely control the behavior of the PLC. These OBs are automatically invoked by the operating system and allow the user to create program logic that is scheduled to execute or respond to specific events.
The S7-1200 is subdivided into seven key block types according to functional differences: main program loop block, startup initialization block, delayed trigger interrupt block, periodic cycle interrupt block, hardware event response interrupt block, diagnostic fault interrupt block, and time abnormal interrupt block. At startup, some OBs will be accompanied by the output of system information, which provides a basis for developers to process them.
First of all, the startup initialization block is executed only once when the CPU switches from the stopped state to the running state, and is often used for initialization configurations, such as setting default values. Multiple OBs of this type can be deployed, and they contain start-up related status information.
Second, the main program loop organization block, such as OB1, is the starting point for the execution of the user's program. The OB is invoked once per scan cycle to ensure that it continues to run. Although multiple round-robin OBs can be configured, OB1 has the lowest priority and is susceptible to interruptions by other events. It's important to note that the main-loop OB doesn't come with startup information.
Circulating tissue blocks continue to run during the scan cycle until they are interrupted by a higher priority. Interrupt handling follows the principle of priority queuing to ensure efficient and orderly.
The delay-triggered interrupt block is activated after a preset delay, providing users with a flexible timed execution scheme that supports up to four instances and also has no startup information.
Periodic cycle interruption blocks run the program independently at regular intervals, with phase adjustment for delayed start-up, configurable up to four, again without start-up information.
The Hardware Event Response Interrupt Organization block focuses on the rapid response to specific hardware events, such as high-speed counting or input changes, and supports multi-event mapping to single OB and single-OB to multi-event listening, with a maximum number of up to 50 and no startup information output.
The Diagnostic Fault Interrupt Tissue block is triggered when a module fault is detected, providing an error handling mechanism. The OB is invoked both when the error occurs and when it is resolved, and contains startup information, but only for the OB82 singleton.
Finally, the time anomaly interrupt tissue block responds to system problems such as loop timeout and interrupt queue overflow, which is implemented through OB80, contains startup information, and is the only instance.
To sum up, there are a wide variety of organizational blocks in the S7-1200 CPU, each performing its own role, and together building a powerful automation control system.