S7-300 PLC in RTG
S7-300 PLC in RTG
02.09.2003
RTG-Training, J.Tikka
PLC (Programmable Logic Control) in RTG
1. SYSTEM OVERVIEW
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.
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. PLC HARDWARE
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)
CONFIGURATION IN TROLLEY
CONFIGURATION IN TROLLEY
CONFIGURATION IN CABIN
CONFIGURATION IN CABIN
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:
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.
SOFTWARE
Starting and Operating with the program is told in Quick Start and other
Simatic Software manuals.
PLC in RTG, RTG Program
4. RTG PROGRAM
FUNCTION BLOCKS (FB´s) are logic blocks with associated instance data block.
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:
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.
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
CPU
Input Central Output
Modules Processing Modules
Unit
Programming Operator
Device Module
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
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
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:
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
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
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:
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
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
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:
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
Bit Memory
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)
Counter
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.
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