97BPLC concepts
4.1 Execution of the user program
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
65
$
%
&
'
(
)
ཱ
ུ
ཱི
ི
STARTUP
RUN
A Clears the I (image) memory area
①
Writes Q memory to the physical outputs
B Initializes the outputs with either the
last value or the substitute value
②
Copies the state of the physical inputs to I
memory
C Executes the startup OBs
③
Executes the program cycle OBs
D Copies the state of the physical inputs
to I memory
④
Performs self-test diagnostics
E Stores any interrupt events into the
queue to be processed after entering
RUN mode
⑤
Processes interrupts and communications
during any part of the scan cycle
F
Enables the writing of Q memory to the
physical outputs
STARTUP processing
Whenever the operating mode changes from STOP to RUN, the CPU clears the process
image inputs, initializes the process image outputs and processes the startup OBs. Any read
accesses to the process-image inputs by instructions in the startup OBs read zero rather
than the current physical input value. Therefore, to read the current state of a physical input
during the startup mode, you must perform an immediate read. The startup OBs and any
associated FCs and FBs are executed next. If more than one startup OB exists, each is
executed in order according to the OB number, with the lowest OB number executing first.
Each startup OB includes startup information that helps you determine the validity of
retentive data and the time-of-day clock. You can program instructions inside the startup
OBs to examine these startup values and to take appropriate action. The following startup
locations are supported by the Startup OBs:
Table 4- 1
Startup locations supported by the startup OB
Input
Data Type Description
LostRetentive
Bool
This bit is true if the retentive data storage areas have been lost
LostRTC
Bool
This bit is true if the time-of-day clock (Real time Clock) has been lost
The CPU also performs the following tasks during the startup processing.
●
Interrupts are queued but not processed during the startup phase
●
No cycle time monitoring is performed during the startup phase
●
Configuration changes to HSC (high-speed counter), PWM (pulse-width modulation), and
PtP (point-to-point communication) modules can be made in startup
●
Actual operation of HSC, PWM and point-to-point communication modules only occurs in
RUN