6 Organization Blocks6.1 OverviewOBs (Organization blocks) are the interface between the operating system of the CPUand the user program. For the main program OB 1 is used. There are reserved numberscorresponding to the call event of the other OBs. Organization blocks are executed corre-sponding to their priority. OBs are used to execute specific program sections:n On start-up of the CPUn On cyclic or clocked executionn On errorsn On hardware interrupts occur6.2 Main6.2.1 OB1 - Main - Program CycleThe operating system of the CPU executes OB 1 cyclically. After STARTUP to RUN thecyclical processing of the OB 1 is started. OB 1 has the lowest priority (priority 1) of eachcycle time monitored OB. Within the OB 1 functions and function blocks can be called.When OB 1 has been executed, the operating system sends global data. Beforerestarting OB 1, the operating system writes the process-image output table to the outputmodules, updates the process-image input table and receives any global data for theCPU.Cycle time is the time required for processing the OB 1. It also includes the scan time forhigher priority classes which interrupt the main program respectively communication pro-cesses of the operating system. This comprises system control of the cyclic programscanning, process image update and refresh of the time functions.By means of the Siemens SIMATIC manager the recent cycle time of an online connectedCPU may be shown. With PLC > Module Information > Scan cycle time the min., max.and recent cycle time can be displayed.The CPU offers a scan cycle watchdog for the max. cycle time. The default value for themax. cycle time is 150ms as scan cycle monitoring time. This value can be reconfiguredor restarted by means of the SFC 43 (RE_TRIGR) at every position of your program. Ifthe main program takes longer to scan than the specified scan cycle monitoring time, theOB 80 (Timeout) is called by the CPU. If OB 80 has not been programmed, the CPU goesto STOP. Besides the monitoring of the max. cycle time the observance of the min cycletime can be guaranteed. Here the restart of a new cycle (writing of process image of theoutputs) is delayed by the CPU as long as the min. cycle time is reached.The CPU's operating system forwards start information to OB 1, as it does to every OB, inthe first 20 bytes of temporary local data. The start information can be accessed bymeans of the system function SFC 6 RD_SINFO. Note that direct reading of the startinformation for an OB is possible only in that OB because that information consists oftemporary local data.The following table describes the start information of the OB 1 with default names of thevariables and its data types:DescriptionFunctionCycle timeScan cycle monitoringtimeAccess to local dataLocal dataVIPA SPEED7 Organization BlocksMain > OB1 - Main - Program CycleHB00 | OPL_SP7 | Operation list | en | 18-30 71