Download as pdf or txt
Download as pdf or txt
You are on page 1of 72

SIMATIC S7-300 in RTG

02.09.2003
RTG-Training, J.Tikka
PLC (Programmable Logic Control) in RTG
1. SYSTEM OVERVIEW

The PLC- system is based on Siemens Simatic S7 CPU315-2 DP Programmable


Controller and it is using Siemens Step-7 program language.

The PLC- system is split between EE-house, Power Unit, Trolley cubicle and Cabin.

Displays and Drives are connected to PLC via Profibus serial link.

The application program is made in Ladder format and it can be monitored by a


computer.

In next slide is shown the sample configuration of the PLC- system of SISU RTG.
PLC in RTG, Hardware Configuration
PLC in RTG, Profibus DP Addresses (4 Drives)

2
6 5 11 4

10

9 7 3
PLC in RTG, Profibus DP Addresses (3 Drives)

2
6 5 4

10

9 7 3
PLC in RTG, Profibus DP Addresses

2. Main CPU (S7-300) 7. Cabin Display (TP-170B)


3. Cabin Interface (ET 200M) 8. EE-House Display (TP-170B)
4. Hoist-/Gantry Drive (CBP2) 9. Trolley Interface (ET 200M)
5. Gantry Drive (CBP2) 10. Power Unit PLC (S7-200)
6. Trolley Drive (CBP2) 11. Gantry Drive (CBP2)
PLC in RTG, Hardware Configuration

2. PLC HARDWARE

CONFIGURATION IN EE- HOUSE

In the EE- house there is a main rack of the PLC system including the main processing
unit A10, S7 CPU 315-2 DP.

In the CPU there are two serial links MPI and Profibus (example has also Ethernet Connection):

1. Profibus DP for
Distributed I/O’s,
Displays, Drives, etc.
2. MPI for programming
and Displays
3. Ethernet connection
for Wireless Local
Area network for
remote monitoring.
PLC in RTG, Hardware Configuration
In the CPU Rack 0 there are seven modules:
(Modules vary between applications)

Slot 1. is reserved for power supply module (not used on RTG)


Slot 2. is always CPU (CPU 315-2 DP), (Profibus address 2)
Slot 3. A11, S7 IM365 sender for interfacing an expansion rack to the CPU.
Slot 4. A12, S7 SM321 32 inputs
Slot 5. A13, S7 SM321 32 inputs
Slot 6. A14, S7 SM321 32 inputs
Slot 7. A15, S7 FM350 counter for hoist motor
Slot 8. A16, M7 FM356-4 application module
Slot 9. A17, S7 CP 343-1 Industrial ethernet module

! M7 FM356-4 application module is for Smartrail !


! CP 343-1 Industrial ethernet module is for RMI !
PLC in RTG, Hardware Configuration

In the Expansion Rack 1 there are eight modules:


(Modules vary between applications)

Slot 3. A21, S7 IM365 receiver unit


Slot 4. A22, S7 SM322 8 Relay outputs
Slot 5. A23, S7 SM322 8 Relay outputs
Slot 6. A25, S7 SM322 8 Relay outputs
Slot 7. A26, S7 SM322 8 Relay outputs
Slot 8. A27, S7 SM322 8 Relay outputs
Slot 9. A28, S7 SM322 8 Relay outputs
Slot 10. A29, S7 SM322 32 Transistor outputs

Display OP27 or TP 170B in EE- house


(Profibus address 8) is connected to
the Profibus.
Line Printer is connected to the display by serial
connection.
PLC in RTG, Hardware Configuration

CONFIGURATION IN TROLLEY

Distributed I/O in Trolley is based on ET200M,


which is using normal S7 300 modules:
(Modules vary between applications)

Slot 3. A601, S7 IM153 Profibus Interface module (Profibus address 9)


Slot 4. A602, S7 SM321 32 inputs
Slot 5. A603, S7 SM321 32 inputs
Slot 6. A604, S7 SM322 8 Relay outputs
Slot 7. A605, S7 SM322 8 Relay outputs
Slot 8. A606, S7 SM322 8 Relay outputs
Slot 9. A608, S7 FM350 counter for trolley motor
Slot 10. A609, S7 CP342-2 A-Si Master control unit for spreader A-Si modules
PLC in RTG, Hardware Configuration

CONFIGURATION IN TROLLEY

Distributed I/O in Trolley is based on ET200M,


which is using normal S7 300 modules:
(Modules vary between applications)
PLC in RTG, Hardware Configuration

CONFIGURATION IN CABIN

Distributed I/O in Cabin is alike in Trolley and it´s


situated under the driver’s seat:
(Modules vary between applications)

Slot 3. A701, S7 IM153 Profibus Interface module (Profibus address 3)


Slot 4. A702, S7 SM321 32 inputs
Slot 5. A703, S7 SM321 16 inputs
Slot 6. A705, S7 SM322 16 Transistor outputs
Slot 7. A709, S7 CP340 RS232 interface (For YMS signal)

YMS = Yard Management System (Container positioning)

Display OP27 or TP 170B in Cabin (Profibus address 7) is connected to the Profibus.


PLC in RTG, Hardware Configuration

CONFIGURATION IN CABIN

Distributed I/O in Cabin is alike in Trolley and it´s


situated under the driver’s seat:
(Modules vary between applications)
PLC in RTG, Simatic Step 7 software

3. SIMATIC STEP 7 PROGRAMMING SOFTWARE

Simatic Step-7 PLC programming language is the latest program family for
programming all Siemens Programmable Controllers (PLC’s).
Programming and monitoring is possible in three different formats:

1. Ladder Diagram (LAD)


2. Statement List (STL)
3. Control System Flow Chart (CSF).
PLC in RTG, Simatic Step 7 software

1. Ladder Diagram (LAD), Used on normal functions


PLC in RTG, Simatic Step 7 software

2. Statement List (STL), Used on non changeable functions


PLC in RTG, Simatic Step 7 software

3. Control System Flow Chart (CSF), Not normally used


PLC in RTG, Simatic Step 7 software

Software:
Software is any information in a form that a
computer or PLC can use.
Software includes the instructions or programs
that direct hardware.

Hardware:
Hardware is the actual equipment.
The PLC, the programming device,
and the connecting cable are
examples of hardware.
PLC in RTG, Simatic Step 7 software

HARDWARE REQUIREMENTS

Programming Unit (eg. PG720 or new Field PG) or fast PC with Step-7 program can
be used for programming.

Connecting PC to the PLC needs MPI or DP interface.


(Normally used: PCMCIA card CP5511 HW-adapter)
PLC in RTG, Simatic Step 7 software

SOFTWARE

Software used on RTG Projects is SIMATIC STEP 7, V5.1

Software installation is told in Siemens Software manuals.

Starting and Operating with the program is told in Quick Start and other
Simatic Software manuals.
PLC in RTG, RTG Program

4. RTG PROGRAM

The RTG application program consist of more than 72 functions:

1. Organization Blocks OB´s 6-7 pcs.


2. Function Blocks FB´s 2-3 pcs.
3. Functions FC´s 45-54 pcs.
4. Data Blocks DB´s 17-25 pcs.
5. System Functions SFC´s 5-9 pcs.
6 Variable Tables VAT´s 0-7 pcs.

ORGANIZATION BLOCKS (OB´s) determine the structure of the user program:


- They form the interface between the operating system and the user program
(OB1 calling different Functions (FC´s)).
- They control the startup of the PLC (OB100), Internal cyclic interrupts (OB35)
and responsible for hanging errors (OB82, OB86, OB121 and OB122).
PLC in RTG, RTG Program

FUNCTION BLOCKS (FB´s) are logic blocks with associated instance data block.

FUNCTIONS (FC´s) are self programmed logic blocks:


- FC´s consist on Networks, which contains logical functions.

DATA BLOCKS (DB´s) are used for storing process data and parameters.

SYSTEM FUNCTION BLOCKS (SFC´s) Ready made functions integrated in the S7 CPU.

VARIABLE TABLES (VAT´s) are created for monitoring and modifying the variables
in user program for test purposes, VAT´s are not loaded into CPU.
PLC in RTG, RTG Program Structure

PROGRAM STRUCTURE
The program starts from the OB100 (start up organization block) and after that
to the OB1 (main program).
The main program calls following Main Functions, which calls related Data Blocks:

1. FC3, DB3 Hoist


2. FC4, DB4 Trolley
3. FC5, DB5 Gantry
4. FC6, DB6 Diesel
5. FC7, DB7 Miscellaneous
6. FC8, DB8 Spreader
PLC in RTG, RTG Program

Each Main Function calls lower level Functions e.g. in Hoist:

OB1 Main program


|____ FC3 Hoist main
|_____FC10 Read hoist joystick
|_____FC34 Set hoist / gantry drive to hoist mode
|_____FC32 Write hoist drive
|_____FC33 Hoist general

Normal program running is aborted by following interrupts:

1. OB35 Cyclic 100ms


2. OB82 Diagnostic (asynchronous error interrupt) encoders
3. OB86 Rack failure (asynchronous error interrupt) Profibus
4. OB121 Programming error (synchronous error interrupt)
4. OB122 Access error (synchronous error interrupt). I/O errors
PLC in RTG, RTG Program

For example Cyclic interrupt calls lower level Hoist functions:

OB35 Cyclic interrupt every 100ms


|____ FC30 Hoist position
|____ FC31 Hoist speed
|____ FC36 Hoist drive runtime parameters read
|____ FC35 Hoist load weighting

Functions are listed in RTG PLC Manual : Appendix 3.

Block Diagram of the program is shown in RTG PLC Manual: Appendix 4.

Program Structure in Tree Representation is shown in RTG PLC Manual: Appendix 5


PLC in RTG, RTG Program

I/O LIST
The PLC interfaces consist of normal bit I/O and word I/O for Encoders and Drivers.
I/O Address list with Corresponding Symbols, Data types and Comments are in
RTG PLC Manual: Appendix 6.
For each I/O address there is a symbolic representation,
which are created so that it is easy to connect PLC program to electrical wiring:
For example: |A| B | C |D|
CQ:TR_N_SYNC_H733_8J = CABIN OUTPUT:
TROLLEY NOT SYNCRONIZED
indicator lamp of H733 in cabin.
Circuit diagram page 8J.

A: I/Q CI = Cabin Input CQ = Cabin Output


EI = EE-house Input EQ = EE-house Output
TI = Trolley Input TQ = Trolley Output
PI = Power unit Input PQ = Power unit Output
SI = Spreader Input SQ = Spreader Output
PLC in RTG, RTG Program

B: Symbolic name CQ:TR_N_SYNC_H733_8J


( CABIN OUTPUT: TROLLEY NOT SYNCRONIZED, indicator lamp H733 in Cabin, Circuit diagram page 8J )

C: Appliance:
Letter A = Control Circuit Number 1-99 = EE-house or Power Unit
F = Protection Circuit 100 = Front Sill Beam
H = Indicator Lamp 200 = Rear Sill Beam
K = Contactor 300 = Left Main Cross Beam
M = Motor Feedback 400 = Right Main Cross Beam
P = Meter Control 500 = Festoon
S = Switch (generally) 600 = Trolley
SH = Indicator Lamp in a Switch 700 = Cabin
Y = Valve 800 = Head Block
900 = Spreader

D: Circuit Diagram Page Number


PLC - Training, PLC - Basics

Basic PLC Operation:

PLC´s consist of input modules or points, a Central Processing Unit (CPU),


and output modules or points.
An input accepts a variety of digital or analog signals from various field devices
(sensors) and converts them into a logic signal that can be used by the CPU.
The CPU makes decisions and executes control instructions based on program
instructions in memory.
Output modules convert control instructions from the CPU into a digital or analog
signal that can be used to control various field devices (actuators).
A programming device is used to input the desired instructions.
These instructions determine what the PLC will do for a specific input.
An operator interface device allows process information to be displayed and new
control parameters to be entered.
PLC - Training, PLC - Basics

Block diagram of Basic PLC Operation:

CPU
Input Central Output
Modules Processing Modules
Unit

Programming Operator
Device Module
PLC - Training, PLC - Basics

Pushbuttons (sensors), in this simple


example, connected to PLC inputs,
can be used to start and stop a motor
connected to a PLC through a motor
starter (actuator).
PLC - Training, PLC - Basics

Hard-wired control:
Prior to PLC´s, many of these control tasks were
solved with contactor or relay controls. This is
often referred to as hard-wired control.
Circuit diagrams had to be designed, electrical
components specified and installed, and wiring
lists created.
Electricians would then wire the components
necessary to perform a specific task.
If an error was made, the wires had to be
reconnected correctly.
A change in function or system expansion
required extensive component changes and
rewiring.
PLC - Training, PLC - Basics

PLC´s:
The same, as well as more complex tasks, can be done with a PLC.
Wiring between devices and relay contacts is done in the PLC program.
Hard-wiring, though still required to connect field devices, is less intensive.
Modifying the application and correcting errors are easier to handle.
It is easier to create and change a program in a PLC than it is to wire and rewire a
circuit.

Advantages:
- Smaller physical size than hard-wire solutions
- Easier and faster to make changes
- PLC´s have integrated diagnostics and override functions
- Diagnostics are centrally available
- Applications can be immediately documented
- Applications can be duplicated faster and less expensively
PLC - Training, PLC - Basics

Siemens PLC´s in RTG use:

S7-200
The S7-200 is referred to as a micro
PLC because of its small size.
The S7-200 has a brick design which
means that the power supply
and I/O are on-board.
The S7-200 is used in Power-unit for
Diesel engine controlling.
PLC - Training, PLC - Basics

Siemens PLC´s in RTG use:

S7-300
The S7-300 is used as base PLC of
RTG.
The S7-300 supports a greater
number of I/O points.
The S7-300 is modular and
expandable.
The I/O consist of separate modules
connected to the CPU,
some of these are accessible via
Profibus DP link.
PLC - Training, PLC - Basics

Number systems:

Since a PLC is a computer, it stores information in the form of On or Off conditions


(1 or 0), referred to as binary digits (bits).
Sometimes binary digits are used individually and sometimes they are used to
represent numerical values.

Decimal system:
Various number systems are used by PLC´s.
All number systems have the same three characteristics: digits, base, weight.
The decimal system, which is commonly used in everyday life, has
the following characteristics:

Ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Base 10
Weights 1, 10, 100, 1000, ...
PLC - Training, PLC - Basics

Binary system:
The binary system is used by programmable controllers.
The binary system has the following characteristics:
Two digits 0, 1
Base 2
Weights Powers of base 2 (1, 2, 4, 8, 16, ...)
PLC - Training, PLC - Basics

In the binary system 1s and 0s are arranged into columns. Each column is weighted.
The first column has a binary weight of 2º. This is equivalent to a decimal 1.
This is referred to as the least significant bit.
The binary weight is doubled with each succeeding column.
The next column, for example, has a weight of 2¹, which is equivalent to a decimal 2.
The decimal value is doubled in each successive column. The number in the far left
hand column is referred to as the most significant bit.
In this example, the most significant bit has a binary weight of 27.
This is equivalent to a decimal 128.
PLC - Training, PLC - Basics

Converting Binary to Decimal:


The following steps can be used to interpret a decimal number from a binary value.
1) Search from left to right (least significant to most significant bit) for 1s.
2) Write down the decimal representation of each column containing a 1.
3) Add the column values.
PLC - Training, PLC - Basics

Bits, bytes and words:


Each binary piece of data is a bit. 0
Eight bits make up one byte. 00000000
Two bytes, or 16 bits, make up one word. 00000000 00000000
PLC - Training, PLC - Basics

Logic 0, Logic 1:
Programmable controllers can only
understand a signal that is On or Off
(present or not present).
The binary system is a system in which
there are only two numbers, 1 and 0.
Binary 1 indicates that a signal is present, or
the switch is On.
Binary 0 indicates that the signal is not
present, or the switch is Off.
PLC - Training, PLC - Basics

BCD: (Example only, not used in calculations)


Binary-Coded Decimal (BCD) are decimal numbers where
each digit is represented by a four-bit binary number.
BCD is commonly used with input and output devices.
A thumb wheel switch is one example of an input device
that uses BCD.
The binary numbers are broken into groups of four bits,
each group representing a decimal equivalent.
A four-digit thumb wheel switch, like the one shown here,
would control 16 (4 x 4) PLC inputs.
PLC - Training, PLC - Basics

Hexadecimal:
Hexadecimal is another system used in PLC´s.
The hexadecimal system has the following characteristics:
16 digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Base 16
Weights Powers of base 16 (1, 16, 256, 4096 ...)
The ten digits of the decimal system are used for the first ten digits of the
hexadecimal system.
The first six letters of the alphabet are used for the remaining six digits.
A = 10 D = 13
B = 11 E = 14
C = 12 F = 15
PLC - Training, PLC - Basics

The hexadecimal system is used in PLC´s because it allows the status of a large
number of binary bits to be represented in a small space such as on a computer
screen or programming device display.
Each hexadecimal digit represents the exact status of four binary bits.
To convert a decimal number to a hexadecimal number the decimal number is
divided by the base of 16.
To convert decimal 28, for example, to hexadecimal:

Decimal 28 divided by 16 is 1 with a remainder of 12.


Twelve is equivalent to C in hexadecimal.
The hexadecimal equivalent of decimal 28 is 1C.
PLC - Training, PLC - Basics

The decimal value of a hexadecimal number is obtained by multiplying the


individual hexadecimal digits by the base 16 weight and then adding the results.
In the following example the hexadecimal number 2B is converted to its decimal
equivalent of 43.

160 =1
161 = 16
B = 11
PLC - Training, PLC - Basics

Conversion of numbers:
Chart shows a few numeric
values in decimal, binary,
BCD, and hexadecimal
representation.
PLC - Training, PLC - Basics, Terminology

Discrete input:
A discrete input, also referred to as a
digital input, is an input that is either
in an ON or OFF condition.
Pushbuttons, toggle switches, limit
switches, proximity switches, and
contact closures are examples of
discrete sensors which are
connected to the PLC´s discrete or
digital inputs.
In the ON condition a discrete input
may be referred to as a logic 1 or a
logic high. In the OFF condition a
discrete input may be referred to as
a logic 0 or a logic low.
PLC - Training, PLC - Basics, Terminology

Analog inputs:
An analog input is an input signal
that has a continuous signal.
Typical analog inputs may vary from
0 to 20 milliamps, 4 to 20 milliamps,
or 0 to 10 volts.
In the following example, a level
transmitter monitors the level of
liquid in a tank.
Depending on the level transmitter,
the signal to the PLC can either
increase or decrease as the level
increases or decreases.
PLC - Training, PLC - Basics, Terminology

Discrete outputs:
A discrete output is an output that is
either in an ON or OFF condition.
Solenoids, contactor coils, and lamps
are examples of actuator devices
connected to discrete outputs.
Discrete outputs may also be
referred to as digital outputs.
In the following example, a lamp can
be turned on or off by the PLC output
it is connected to.
PLC - Training, PLC - Basics, Terminology

CPU:
The central processor unit (CPU) is a microprocessor system that contains the
system memory and is the PLC decision-making unit.
The CPU monitors the inputs and makes decisions based on instructions held in the
program memory.
The CPU performs relay, counting, timing, data comparison, and
sequential operations.
PLC - Training, PLC - Basics, Terminology

Programming:
A program consists of one or more instructions that accomplish a task.
Programming a PLC is simply constructing a set of instructions.
There are several ways to look at a program such as ladder logic,
statement lists, or function block diagrams.

Ladder logic:
Ladder logic (LAD) is one programming language used with PLC´s.
Ladder logic uses components that resemble elements used in a line diagram
format to describe hard-wired control.
PLC - Training, PLC - Basics, Terminology

Ladder logic diagram:


Power Conductor
The left vertical line of a ladder logic diagram
represents the power or energized conductor. Output Element
The output element or instruction represents the or Instruction
neutral or return path of the circuit.
The right vertical line, which represents the return
path on a hard-wired control line diagram, is omitted.
Ladder logic diagrams are read from
left-to-right, top-to-bottom.
Rungs are sometimes referred to as networks.
A network may have several control elements,
but only one output coil.
PLC - Training, PLC - Basics, Terminology

Ladder logic Diagram:


In the example program shown example I0.0,
I0.1 and Q0.0 represent the first instruction
combination.
If inputs I0.0 and I0.1 are energized, output relay
Q0.0 energizes.
The inputs could be switches, pushbuttons, or
contact closures.
I0.4, I0.5, and Q1.1 represent the second
instruction combination.
If either input I0.4 or I0.5 are energized, output
relay Q0.1 energizes.
(In example I 0.5 is energized)
PLC - Training, PLC - Basics, Terminology

PLC scan:
The PLC program is executed as part of a repetitive process referred to as a scan.
A PLC scan starts with the CPU reading the status of inputs.
The application program is executed using the status of the inputs.
Once the program is completed, the CPU performs internal diagnostics and
communication tasks.
The scan cycle ends by updating
the outputs, then starts over.
The cycle time depends on the size
of the program, the number of I/Os,
and the amount of communication
required.
PLC - Training, PLC - Basics, Program Run in RTG

1 OB100 Setup Functions Interrupts

3 9
FC 3 OB 35
2 Hoist Internal, every
Counter,
Drive 100 ms.
4 Read
OB1 FC 4
Main Trolley 10
OB 82
Program
5 Diagnostic Internal
FC 5
Gantry

6 11
OB 86
FC 6
Diesel I/Q Internal
Malfunction
7
FC 7
Miscell. OB 122 12
8 Profibus Internal
FC 8 Malfunction
Spreader
PLC - Training, PLC - Basics, Terminology

Memory size:
Kilo, abbreviated K, normally refers to 1000 units.
When talking about computer or PLC memory, however, 1K means 1024.
This is because of the binary number system (210 = 1024).
This can be 1024 bits, 1024 bytes, or 1024 words, depending on memory type.
PLC - Training, PLC - Basics, Terminology

RAM:
Random Access Memory (RAM) is memory where data can be directly accessed at
any address.
Data can be written to and read from RAM.
RAM is used as a temporary storage area.
RAM is volatile, meaning that the data stored in RAM will be lost if power is lost.
A battery backup is required to avoid losing data in the event of a power loss.

ROM:
Read Only Memory (ROM) is a type of memory that data can be read from but not
written to.
This type of memory is used to protect data or programs from accidental erasure.
ROM memory is nonvolatile.
This means a user program will not lose data during a loss of electrical power.
ROM is normally used to store the programs that define the capabilities of the PLC.
PLC - Training, PLC - Basics, Terminology

EPROM:

Erasable Programmable Read Only Memory (EPROM) provides some level of


security against unauthorized or unwanted changes in a program.
EPROM´s are designed so that data stored in them can be read, but not easily
altered.
Changing EPROM data requires a special effort.
UVEPROM´s (ultraviolet erasable programmable read only memory) can only be
erased with an ultraviolet light.
EEPROM (electronically erasable programmable read only memory), can only be
erased electronically.
(FLASH memory cards use EEPROM technology)
PLC - Training, PLC - Basics

Firmware:
Firmware is user or application specific software burned into EPROM
and delivered as part of the hardware.
Firmware gives the PLC its basic functionality.
PLC - Training, PLC - Basics

Putting it together:
The memory of the S7-200 and S7-300 is divided into three areas: program space,
data space, and configurable parameter space.
- Program space stores the ladder logic (LAD) or statement list (STL) program
instructions. This area of memory controls the way data space and I/O points are
used. LAD or STL instructions are written using a programming device such as
a PC, then loaded into program memory of the PLC.
- Data space is used as a working area, and includes memory locations for
calculations, temporary storage of intermediate results and constants. Data space
includes memory locations for devices such as timers, counters, high-speed
counters, and analog inputs and outputs. Data space can be accessed under
program control.
- Configurable parameter space, or memory, stores either the default or modified
configuration parameters.
PLC - Training, PLC - Basics

APPLICATION
PLC
PROGRAM

MEMORY

INTERFACE

SOFTWARE

PROGRAMMING
DEVICE (PC)
PLC in RTG, Memory areas
Absolute Addresses

Every input and output has


an absolute address
predefined by the
hardware configuration.

This address is specified


directly; that is, absolutely.

The absolute address can


be replaced by any
symbolic name you
choose.
PLC in RTG, Memory areas
Process - Image Input

At the beginning of the Input bit -> I 1 bit


scan cycle,the operating Input byte -> IB 8 bits
system reads the inputs Input word -> IW
from the process and Input double word -> ID
records the values in this
area. The program use
these values in its cyclic
processing.
PLC in RTG, Memory areas
Process - Image Input

At the beginning of the Input bit -> I


scan cycle,the operating Input byte -> IB
system reads the inputs Input word -> IW 16 bits
from the process and Input double word -> ID
records the values in this
area. The program use
these values in its cyclic
processing.
PLC in RTG, Memory areas
Process - Image Input

At the beginning of the Input bit -> I


scan cycle,the operating Input byte -> IB
system reads the inputs Input word -> IW
from the process and Input double word -> ID 32 bits
records the values in this
area. The program use
these values in its cyclic
processing.
PLC in RTG, Memory areas
Process - Image Output

During the scan cycle,the Output bit -> Q 1 bit


program calculates output Output byte -> QB 8 bits
values and places them in Output word -> QW 16 bits
this area. Output double word -> QD 32 bits
At the end of the scan cycle,
the operating system reads
the calculated output values
from this area and sends
them to the processing
outputs.

Bit Memory

This area provides storage Memory bit -> M 1 bit


for interim results calculated Memory byte -> MB 8 bits
in program. Memory word -> MW 16 bits
Memory double word -> MD 32 bits
PLC in RTG, Memory areas
I/O: External input

This area enables your Peripheral input byte -> PIB 8 bits
program to have direct Peripheral input word -> PIW 16 bits
access to input and output Peripheral input double word -> PID 32 bits
modules.
(That is peripheral inputs
and outputs)

I/O: External output Peripheral output byte -> PQB 8 bits


Peripheral output word -> PQW 16 bits
Peripheral output double word -> PQD 32 bits
PLC in RTG, Memory areas
Timer

Timers are function Timer (T) -> T


elements of Ladder
programming. Example: T 20
This area provides storage
for timer cells. In this area,
clock timing accesses time
cells to update them by
decrementing the time
value.
Timer instructions access
time cells here.

Counter

Counters are function elements in Ladder Counter (C) -> C


programming. This area provides storage for
counters. Example: C1
Counter instructions access them here.
PLC in RTG, Memory areas
Data block

This area contains data that can be Data bit -> DBX 1 bit
accessed from any block. Data byte -> DBB 8 bits
Data word -> DBW 16 bits
Values written into Data block Data double word -> DBD 32 bits
remains there even PLC is on OFF
state. Example: DB3.DBX1.0
DB3.DBD126
Data blocks can be therefore used as
memory place for variables.

Many pre-defined values are stored


in Data blocks in RTG program.
PLC in RTG, Memory areas
Local data

This area contains temporary data Local Data bit -> L 1 bit
that is used within a logic block. Local Data byte -> LB 8 bits
(FB, or FC) Local Data word -> LW 16 bits
Local Data double word-> LD 32 bits
These data are also called dynamic
local data. Example: #HO_MAX_SD_REF

They serve as an intermediate buffer.

When the logic block is finished,


these data are lost!
PLC in RTG, Addressing Values

Addressing, Values used in Step7


Type/Description Size in Bits Format Options Example
BOOL (Bit) 1 Boolean Text TRUE
BYTE (Byte) 8 Hexadecimal B#16#10 or byte#16#10
WORD (Word) 16 Binary 2#0001_0000_0000_0000
Hexadecimal W#16#1000 or word#1000
BCD C#998
Unsigned Decimal B#(10,20) or byte#(10,20)
DWORD 32 Binary 2#0001_0000_0000_0000_
1011_1011_0111_1111
(Double Word) Hexadecimal W#16#1000 or word#1000
Unsigned Decimal B#(10,20) or byte#(10,20)
PLC in RTG, Addressing Values

Addressing, Values used in Step7


Type/Description Size in Bits Format Options Example
INT (Integer) 16 Signed decimal 1 or -358
DINT (Double Integer) 32 Signed decimal L#1
REAL 32 IEEE 1.234567e+13
(Floating point) Floating point
S5TIME 16 S5 Time in 10-ms units. S5T#2H46M30S0MS
(Simatic Time)
TIME 32 IEC time in 1-ms units.
(IEC Time) (Signed Integer) T#-24D20H31M23S648MS
PLC in RTG, Addressing Values

Addressing, Values used in Step7


Type/Description Size in Bits Format Options Example
DATE (IEC date) 16 IEC date in 1-day units. D#1994-3-15
TIME OF DAY 32 Time of day in TOD#1:10:3.3
1-ms units.
CHAR (Character) 8 Character ‘A’ or ‘E’

You might also like