Siemens SIMATIC S7-200 System Manual page 39

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Reading the Inputs
Digital inputs: Each scan cycle begins by reading the current value of the digital inputs and then
writing these values to the process-image input register.
Analog inputs: The S7-200 does not update analog inputs from expansion modules as part of the
normal scan cycle unless filtering of analog inputs is enabled. An analog filter is provided to allow
you to have a more stable signal. You can enable the analog filter for each analog input point.
When analog input filtering is enabled for an analog input, the S7-200 updates that analog input
once per scan cycle, performs the filtering function, and stores the filtered value internally. The
filtered value is then supplied each time your program accesses the analog input.
When analog filtering is not enabled, the S7-200 reads the value of the analog input from
expansion modules each time your program accesses the analog input.
Analog inputs AIW0 and AIW2 included on the CPU 224XP are updated every scan with the most
recent result from the analog-to-digital converter. This converter is an averaging type (sigma-delta)
and those values will usually not need software filtering.
Tip
Analog input filtering is provided to allow you to have a more stable analog value. Use the
analog input filter for applications where the input signal varies slowly with time. If the signal is a
high-speed signal, then you should not enable the analog filter.
Do not use the analog filter with modules that pass digital information or alarm indications in the
analog words. Always disable analog filtering for RTD, Thermocouple, and AS-Interface Master
modules.
Executing the Program
During the execution phase of the scan cycle, the S7-200 executes your program, starting with the
first instruction and proceeding to the end instruction. The immediate I/O instructions give you
immediate access to inputs and outputs during the execution of either the program or an interrupt
routine.
If you use subroutines in your program, the subroutines are stored as part of the program. The
subroutines are executed when they are called by the main program, by another subroutine, or by
an interrupt routine. Subroutine nesting depth is 8 from the main and 1 from an interrupt routine.
If you use interrupts in your program, the interrupt routines that are associated with the interrupt
events are stored as part of the program. The interrupt routines are not executed as part of the
normal scan cycle, but are executed when the interrupt event occurs (which could be at any point
in the scan cycle).
Local memory is reserved for each of eleven entities: one main, eight subroutine nesting levels
when initiated from the main, one interrupt, and one subroutine nesting level when initiated from
an interrupt routine. Local memory has a local scope in that it is available only within its
associated program entity, and cannot be accessed by the other program entities. For more
information about Local memory, refer to Local Memory Area: L in this chapter.
Figure 4-3 depicts the flow of a typical scan including the Local memory usage and two interrupt
events, one during the program--execution phase and another during the communications phase
of the scan cycle. Subroutines are called by the next higher level, and are executed when called.
Interrupt routines are not called; they are a result of an occurrence of the associated interrupt
event.
PLC Concepts
Chapter 4
25

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents