Program Cycle Ob; Startup Ob - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

PLC concepts
4.1 Execution of the user program
4.1.3.1

Program cycle OB

Program cycle OBs execute cyclically while the CPU is in RUN mode. The main block of the
program is a program cycle OB. This is where you place the instructions that control your
program and where you call additional user blocks. You can have multiple program cycle
OBs, which the CPU executes in numerical order. Main (OB1) is the default.
Program cycle events
The program cycle event happens once during each program cycle (or scan). During the
program cycle, the CPU writes the outputs, reads the inputs and executes program cycle
OBs. The program cycle event is required and is always enabled. You might have no
program cycle OBs, or you might have multiple OBs selected for the program cycle event.
After the program cycle event occurs, the CPU executes the lowest numbered program cycle
OB (usually "Main" OB 1). The CPU executes the other program cycle OBs sequentially (in
numerical order) within the program cycle. Program execution is cyclical such that the
program cycle event occurs at the following times:
● When the last startup OB finishes execution
● When the last program cycle OB finishes execution
Table 4- 2
Input
Initial_Call
Remanence
4.1.3.2

Startup OB

Startup OBs execute one time when the operating mode of the CPU changes from STOP to
RUN, including powering up in the RUN mode and in commanded STOP-to-RUN transitions.
After completion, the main "Program cycle" begins executing.
Startup events
The startup event happens one time on a STOP to RUN transition and causes the CPU to
execute the startup OBs. You can configure multiple OBs for the startup event. The startup
OBs execute in numerical order.
Table 4- 3
Input
LostRetentive
LostRTC
86
Start information for a program cycle OB
Data type
Description
Bool
True for initial call of the OB
Bool
True if retentive data are available
Start information for a startup OB
Data type
Bool
Bool
Description
True if retentive data are lost
True if date and time are lost
System Manual, 03/2014, A5E02486680-AG
S7-1200 Programmable controller

Advertisement

Table of Contents
loading

Table of Contents