Chapter2 Structure Programming
Chapter2 Structure Programming
Structure
Programming
SIMATIC
S7-1500.
• Load memory:
Load memory is
non-volatile
memory for code
blocks, data blocks,
technology objects
and the hardware
configuration. This
load memory is
located on the
SIMATIC memory
card.
http://phenikaa-
uni.edu.vn
• Work memory: The
work memory is volatile
memory that contains
the code and data
blocks. The work
memory is integrated
into the CPU and cannot
be extended. Work
memory includes Code
work memory and Data
work memory.
http://phenikaa-
uni.edu.vn
• Retentive memory:
The retentive memory
is non-volatile
memory for saving a
limited amount of
data in the event of
power failure
http://phenikaa-
uni.edu.vn
• Additional memory areas include process images
and temporary local data.
http://phenikaa-
uni.edu.vn
How to access to
data memory?
http://phenikaa-
uni.edu.vn
How to access to
data memory?
http://phenikaa-
uni.edu.vn
An address is a label or number that
indicates where a certain piece of
information is located in memory.
Physic-based addressing
schemes are used with
Siemens SIMATIC S7.
Tag-based addressing is used with
SIMATIC S7 controllers.
SIMATIC S7 1500
addressing format.
SIMATIC S7 1500
addressing format.
IBa
Memory
Byte number
areas(I, Q, M…)
SIMATIC S7 1500
addressing format.
IWa
Memory
High byte number
areas(I, Q, M…)
SIMATIC S7 1500
addressing format.
ID a
IW a IW a+2
Memory
High byte number
areas(I, Q, M…)
SIMATIC S7 1500 data types.
SIMATIC S7 1500 data types.
SIMATIC S7 1500 data types.
SIMATIC S7 1500 data types.
SIMATIC S7 1500 data types.
SIMATIC S7 1500 data types.
SIMATIC controllers consist of operating
system and user program
Code Blocks
Organization blocks
(OBs) forms the
interface between the
operating system of
the CPU and the user
program. The
organization blocks
determine the order
in which the user
program is executed.
Code Blocks
Functions (FCs) are
blocks without cyclic
data storages.
Code Blocks
Function block (FB)
is a code block with
static data. An FB
allows you to pass
parameters in the
user program.
Code Blocks
Data blocks (DBs) are
data areas in the user
program that contain
user data.
Section 4.4
Application Example
EX1: Mixer Process Control Problem
A mixer motor is to
be used to
automatically stir the
liquid in a vat when the
temperature and
pressure reach preset
values.
Manual operation of
the motor is provided
by means of a separate
pushbutton station.
EX 2
Pump Station
EX 3
A color mixing plant for mixing and filling a
previously selected color recipe.
There are four color components for the recipe,
cyan, magenta, yellow and black, which means
the colors of the CMYK color space.
Filling takes place in four steps.
● Filling the recipe components or the four basic
colors by opening the respective tank valves.
● Mixing the colors.
● Filling the finished color mixture into tins and
transportation by a conveyor belt.