Sei sulla pagina 1di 23

Siemens Family

Siemens LOGO

Simatic S7
(STEP 7)

Simatic S5
(STEP 5)
CPU 95U
CPU 100U
CPU 115U
CPU 135U
CPU 155U

S7200

S7300

S7-1200

S7400

S7-200
CPU
RANGE

CPU
221

CPU
222

CPU
224

CPU
224xp

CPU
226

Memory

4K

4K

8K

12K

16K

Input

14

14

24

Output

10

10

16

Analog
I/O

2 i/p
2 o/p

S7-300 Series
A Modular PLC , Rearrangement possible, focusing on medium range complex task
for manufacturing industries. It can be used for centralized & de-centralized operation.

Standard CPU
CPU 312 CPU 314 CPU 315 CPU 317 CPU 318

Fail safe CPU


CPU 315F

CPU 317F

Compact CPU
CPU 312-C CPU 313-C CPU 314-C

Technology CPU
CPU 315-T

CPU 317-T

S7-400 Series

S7-400
CPU-412-1 CPU 412-2

CPU 414-2

CPU 414-3

CPU 416-2

CPU 416-3

CPU 417-4

Rack Configuration of S7-300


Power
Supply

CPU

IM
3

10

11

10

11

SM

Central Rack

Power
Supply

IM
2

Expansion Rack

7
SM

Component of S7-300
Rack : Used For Installing Various Module which is selected by
user as per application.

Power Supply : Supply for internal unit.


CPU: Stores and Processes user logic program and data.

IM(interfacing Module): Use to make various local


and remote interconnection. Provide a connection between
Center rack & expansion rack.

SM (Signal Modules): Digital, Analog I/O modules for field


input and field output. (DI,DO,AI,AO,special modules)

Memory Structure in S7-300


Memory
Load Memory

Work Memory

System Memory

CPU
Dynamic Load Memory.
(RAM,ROM,or Integrated). It
Contain User Program.

Work Memory (RAM). It contain


Executable user Program.

Retentive Load Memory. (FEPROM,


MMC, Integrated). It Contain User
Program.

System Memory (RAM) Contains:


PII, PIQ, Bit memory
area,Timers,counters,L stack, B
stack, I stack, Diagnostic Buffer.

Memory Description
Load Memory: The Load memory is used for user program without

symbolic address assignment or comments (these remain in the


memory of programming device). The Load memory can be either
RAM or EPROM. Load memory expandable with MMC Card.
Work Memory: The work memory (Integrated RAM) contains the
part of the program relevant for running user program. The program is
executed only in the work memory & System Memory Area.
System Memory: The system memory (RAM) contain the memory
elements provided by every CPU for user program. Such as the PII,
PIQ, Bit memory area, Timers, Counters, The system memory area
also contain the Block Stack & Interrupt Stack. In addition area above
load & work memory , the system memory of CPU also contains
temporary data for a block when it is called. This data is only valid as
long as the block is active.

System Memory Area Description


Addressing
Area

Notation

Description

PII (Process
Image i/p
table )

I
Bit: I
Byte: IB
Word: IW
DWord: ID

At the beginning of the scan cycle the CPU reads the


i/p from the i/p module & records the values in this
area.

PIQ (Process
Image o/p
table)

Q
Bit: Q
Byte: QB
Word: QW
DWord: QD

During the scan cycle, the program calculates o/p


values & place them in this area. At the end of the scan
cycle the CPU send the calculated o/p values to the o/p
modules.

Bit Memory
Area

M
This area Provides storage for internal results
calculated in the program.
Bit: M
Byte: MB
Word: MW
Continue
DWord: MD

System Memory Area Description


Addressing
Area

Notation

Timers

This area provides Storage for Timers.

Counters

This area provides storage for Counters.

Data Blocks

DB
Bit: DBx
Byte: DBB
Word: DBW
Dword: DBD

Local Data
Stack

L
Byte: LB
Word: LW
Dword: LD

Peripheral
I/O area

Description

Data block contain information for the program,


they can be defined for general use by all logic
blocks (Shared DB) or they are assigned to
specific FB or SFB (Instance DB).

This area contain the temporary data of a block


while the block is being executed. The L stack
also provides memory for transferring block
parameters and for recording internal results from
ladder logic network.

Byte: PIB/PQB This Peripheral i/p & o/p areas allows direct
Word: PIW/PQW access to central & distributed i/p & o/p module.
Dword: PID/PQD

Data Types in S7-300


Data Types
Elementary
Data Type

Complex Data
Type

Parameter Type

Elementary Data Type


Data
Type

Length
(Bits)

Format

Range

Bool

Boolean True/False

Byte

Hexa B#16#0 to B#16#FF


Binary 2#0 to 2#11111111

Word

16

Hexa W#16#0 to W#16#FFFF


Binary 2#0 to 2#1111111111111111
Unsigned byte B#(0,0) to B#(255,255)

Dword

32

Hexa
Binary
Unsigned byte

DW#16#0 to DW#16#FFFFFFFF
2#0 to 2#11111111111111111
B#(0,0,0,0) to B#(255,255,255,255)

Continue

Elementary Data Type


Data
Type

Length
(Bits)

Format

Range

Integer

16

Signed Integer -32768 to +32767

Dinteger

32

Signed Integer L# -2147483648 to L# 2147483647

Real

32

Floating point +/- 1.175495 e-38 to +/- 3.402823e+38

S5time

16

Time

32

TOD

32

Date

16

Hr:Min:S S5t#10ms to S5t#2h46M30s


Signed time T# +24d to T#-24d
span
TOD TOD#00:00:00:00 to TOD#23:59:59:999
Year-month- D#1990-01-01 to D#2168-12-31
day

Complex Data Type


ARRAY

STRUCT

UDT (User
Data Type)

DT (Date
& Time)

STRING

Parameter Type
Data Type

Size

Information
Passed

Format

Timers

16 bits

Timer number

T0,T1,T2,..

Counters

16 bits

Counter number

C0,C1,C2.

Block_FB

16 bits

Function Block
Number

FB0,FB1,FB2

Block_FC

16 bits

Function number FC0,FC1,FC2..

Block_DB

16 bits

Data block
number

DB0.DB1,DB2...

Addressing in S7-300
Addressing
Absolute Addressing

Symbolic Addressing

Absolute Add.: An Absolute Add. Consists of an address identifier &


a memory Location

Symbolic Add.: Your program is easier to write & debug when


Variable are referenced by symbolic names.

Addressing in S7-300
Power
Supply

CPU

IM
4

PII/PIQ
Area Allocation (Discrete)

12

16

20

Peripheral
Area Allocation (Analog)

256

272

288

304

320

336

10
24

352

For Discrete Type: Data Type Byte No. Bit No


For Analog Type: Data Type Byte No

11
28

368

Power
Supply

I 0.0
I 0.1
to
I 0.7

CPU

Q 4.0
Q 4.1
to
Q 4.7

IM

8DI

PIW 288
PIW 290
PIW 292
PIW 294

8DO

4AI

PIW 304
PIW 306
&
PQW 304
PQW 306

2AI/
2AO

I 16.0
I 16.1
to
I 17.7

16DI

32DI 4AO

I 20.0
I 20.1
to
I 23.7

PQW 352
PQW 354
PQW 356
PQW 358

16DO

Q 28.0
Q 28.1
to
Q 29.7

Types of Programming
Programming
Linear Programming

Structure Programming

You can write your entire user program in OB1. This is only advisable with simple
Program, which required little memory space.
Complex automation task can be controlled more easily by dividing them into
smaller tasks. Tasks are represented by corresponding program sections, known as
Blocks. This tasks is known as structure programming.

Block In S7-300

Blocks
Logic Blocks

Data Blocks

OB
(Organization Block)

IDB
(Instance Data Block)

FB
(Function Block)

SDB
(Shared Data Block)

FC
(Function)

Function Block (FB)


FB belong to the blocks that you program yourself. A FB is a
block with memory. It is assigned a data block as its
memory (IDB).
The parameters that are transfer to the FB & the static variables
are saved in the IDB. Temporary variables are saved in the
Local Data Stack.
Data saved in the IDB are not lost when the execution of FB is
completed. Data saved in Local Data Stack are lost when
execution of the FB is completed.
Function Block
User FB

Standard FB

System Function Block


(SFB)

Function (FC)
FC belong to the blocks that you program yourself. A FC is a
block without memory.
Temporary variables belonging to the FC are saved in the Local
Data Stack. This data is then lost when the FC has been
executed.
To save data permanently FC can also use Shared Data Block
(SDB).

Function
User FC

Standard FC

System Function Block


(SFC)

Data Block (DB)


Data Blocks are the blocks that are used by logic blocks
in CPU program for storing the data.
DBs can be down loaded to the CPU as a part of your
program.
DBs does not contain any instruction.
The max size of the storage provided by DBs is
dependant on the CPU.

Instance data block (IDB)


An instance DB is assigned to every function block call that transfers
parameters. The actual parameters & the static data of the FB are
saved in the instance DB.
The variables declared in the FB determine the structure of the IDB.

Shared Data Block (SDB)


Share Data blocks are used to store User data that can be accessed
by all Other blocks.

Potrebbero piacerti anche