CustomizedCourse S7-1500 V1.0
CustomizedCourse S7-1500 V1.0
CustomizedCourse S7-1500 V1.0
Page | 1
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Stand-alone software packages are limited because they lack consistency and integration.
It takes a common working environment - that is, an engineering framework - to achieve full
integration and consistency of individual products.
Advantages of a Central Engineering Framework
• Uniform operator control concept for all automation tasks with common services (for
example configuration, communication, diagnostics)
• Automatic data and project consistency
• Powerful libraries covering all automation objects
The Most Important Engineering Products are:
• SIMATIC STEP 7 for PLC programming
• SIMATIC HMI for configuring process visualization
• Start-drive for parameterizing drives
Page | 2
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Portal View
• Task-oriented mode of working
• Fast project entry with user guidance
Project View
• Hierarchical structuring of the project
• The necessary editors open according to the task in hand
• All editors, parameters and data are found in one view
Page | 3
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 4
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 5
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
The Inspector window displays all system messages from the engineering, for example, those
resulting from generating a project. This window should always be checked for any errors and
warnings after a generation is completed.
Details View
The Details view is a help window. Here, the elements of the configuration object selected in the
Project tree are displayed. These can be used in the active working area (by dragging them to the
working area using drag & drop). This enables fast access to the required objects (for example,
tags).
Language
The user interface language of the TIA Portal can be changed at any time without needing to
restart. The TIA Portal always starts in the language in which it was last used.
Storage Settings
Storage location for projects:
Storage location of newly created projects and their project libraries
Storage location for libraries:
Storage location for global libraries
Layout
If the layout is reset, the original window layout arrangement of the TIA Portal is restored.
Page | 7
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 8
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Device Configuration
With the device configuration, the user specifies the arrangement of modules in the rack.
When a new device is created, a suitable rack is also created automatically. The selected device
is inserted into the first permitted slot in the rack. Regardless of the method selected, the added
device is visible in the Device view and the Network view of the "Devices & networks" editor.
Page | 9
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 10
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 11
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
2.4.4. IP Addresses
IP addresses are not assigned to a specific computer, but rather to the network interfaces of the
computer. A computer with several network connections (for example routers) must therefore be
assigned an IP address for each connection.
IP addresses consist of 4 bytes. With the dot notation, each byte of the IP address is expressed by
a decimal number between 0 and 255. The four decimal numbers are separated by dots
Page | 12
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
• Hardware/Hardware configuration
Only the entire hardware configuration and parameter assignment are compiled/downloaded.
Page | 13
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 15
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 16
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
4.4.2. Parameters
When the function block is called, the values of the actual parameters are stored in the instance
data block. If no actual parameters were assigned to a formal parameter in a block call, then the
last value stored in the instance DB for this parameter is used in the program execution.
You can specify different actual parameters with every FB call. When the function block is exited,
the data in the data block is retained.
4.4.3. FB Advantages
• When you write a program for an FC, you must search for empty bit memory address areas
or data areas and you must maintain them yourself. The static variables of an FB, on the
other hand, are maintained by the STEP 7 software.
• When you use static variables, you avoid the risk of assigning bit memory address areas or
data areas twice (double assignment).
• Instead of the formal parameters "Stored Fault" and "Edge Memory" of the FC, you use the
static variables "Stored Fault" and "Edge Memory" in the FB. This makes the block call
simpler since the two formal parameters are dropped.
Page | 17
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
4.4.4. Parameters
When the function block is called,
the values of the actual
parameters are stored in the
instance
data block. If no actual parameters
were assigned to a formal
parameter in a block call, then the
last value stored in the instance
DB for this parameter is used in the
program execution.
You can specify different actual
parameters with every FB call.
When the function block is exited,
the data in the data block is
retained.
4.4.5. Static Variables
Unlike functions, function blocks have "static variables" (Static). These variables form the memory
of the FB since they are not stored in the L-Stack but in their own memory area, the instance DB.
Page | 18
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Blocks
The automation system provides various types of blocks in which the user program and the related
data can be stored. Depending on the requirements of the process, the program can be structured
in different blocks. You can use the entire operation set in all blocks (FB, FC and OB).
Functions (FCs)
A function (FC) contains a partial functionality of the program. It is possible to program functions as
parameter-assignable so that when the function is called it can be assigned parameters. As a result,
functions are also suited for programming frequently recurring, complex partial functionalities such
as calculations.
Page | 19
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
For the storage of all digital input and output states, the CPU has reserved memory areas: the
process-image input table (PII) and the process-image output table (PIQ). During program
execution, the CPU accesses these memory areas exclusively. It does not access the digital input
and output modules directly.
PII
The Process-Image Input table (PII) is the memory area in which the states of all digital inputs are
stored. At the beginning of the cycle, the digital input modules read-in to the PII. When an input is
linked, the state of this input stored in the PII is linked. This state cannot change within a cycle
since the PII is only updated or read-in at the beginning of a cycle. This guarantees that when
there are multiple queries of the input in one cycle, the same result is always supplied.
PIQ
The Process-Image Output table (PIQ) is the memory area in which the states of all digital outputs
are stored. The PIQ is output to the digital output modules at the end of the cycle.
Outputs can be assigned as well as queried in the program.
Page | 20
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Restart
When you switch on or switch from STOP --> RUN, the CPU carries out a complete restart (with
OB100). During restart, the operating system deletes all non-retentive bit memories and starts the
cycle monitoring time.
Page | 21
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 22
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Area of Application
You can use data blocks in different ways, depending on their contents. You differentiate between:
• Global data blocks: These contain information that all the logic blocks in the user program
can access. Often, global data blocks are also used as an interface to HMI devices
• Instance data blocks: These are always assigned to a particular FB. The data of these
instance DBs should only be processed by the associated FB. Instance data blocks are
dealt with in more detail in the chapter "Functions and Function Blocks".
Creating DBs
Global DBs are created either with the Program Editor or according to a previously created user
defined
data type (UDT). Instance data blocks are generated by the Editor according to a function
block.
Page | 23
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
5.10. OB Calls
Organization blocks (OBs) form the interface between the CPU’s operating system and the user
program.
Organization blocks are called exclusively by the operating system. There are various start events
(time-of-day interrupts, hardware interrupts - see picture) that each lead to the start of their
associated organization block.
5.10.2. Priorities
The S7-1500 CPUs support the priorities 1 (lowest priority) to 26 (highest priority).
The OBs are executed on a purely priority-driven basis. This means that when several OB
requests exist at the same time, the OB with the highest priority is executed first. When an event
occurs that has a higher priority than the currently active OB, this OB is interrupted. Events of the
same priority are executed in the order that they occur.
5.10.3. Queue
If, during the execution of an interrupt OB, a further event with the same priority occurs, this event
is placed in a queue according to its priority. The start events of a queue are processed at a later
time in the order that they occur.
The number of pending events can be limited in order to keep temporary overload situations under
control.
When, for example, the maximum number of start events for a cyclic interrupt OB is reached in the
queue, every further start event is discarded.
Page | 24
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Time-of-Day Interrupts
Time-of-day interrupts are used for executing a certain program called in OB 10 (as an example)
either once only at a certain time or periodically (every minute, hourly, daily, weekly, monthly,
yearly) starting at that time.
Note
In addition, the time-of-day interrupts can be controlled at runtime with the following "Extended
instructions -> Interrupts":
• "SET_TINT" Set start date, time and period
• "SET_TINTL" Set start date, time and period
• "CAN_TINT" Cancel time-of-day interrupt
• "ACT_TINT" Activate time-of-day interrupt
• "QRY_TINT" Query time-of-day interrupt
Page | 25
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Cyclic Interrupt
With a cyclic interrupt, a block can be executed at fixed time intervals. The S7-1500 offers the OB
35, for example, as a cyclic interrupt OB. The default setting for its call interval is 100000μs; the
selectable range is from 500μs to 60000000μs (60sec).
Interval Time
You must make sure that the interval you specify is longer than the time required for execution.
The operating system calls OB35 at the specified time. If OB35 is still active at this time, the
operating system calls OB80 (time error).
Page | 26
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Hardware Interrupt
The program execution of a hardware interrupt OB (OB40) is started as soon as a certain event
occurs.
Hardware interrupts can be triggered by various module-specific signals: For parameter-assignable
signal modules (DI, DO, AI, AO) you use the "Devices & networks" editor (Device view) to specify
which signal is to trigger the hardware interrupt.
Example
In configuring an analog input module, suitable limit values were specified in the above example.
If the measured value, then exceeds this limit, an interrupt is triggered on the CPU which causes
the program to be interrupted and OB 40 to be called for execution.
Page | 27
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
6.1. Counters
You can use the "Count up" instruction to increment the value at output CV. When the signal state
at the CU input changes from "0" to "1" (positive signal edge), the instruction is executed and the
current counter value at the CV output is incremented by one. The counter value is incremented
each time a positive signal edge is detected, until it reaches the high limit for the data type
specified at the output CV. When the high limit is reached, the signal state at the CU input no
longer has an effect on the instruction.
You can query the counter status in the Q output. The signal state at the Q output is determined
by the PV parameter. If the current counter value is greater than or equal to the value of the PV
parameter, the Q output is set to signal state "1". In all other cases, the Q output has signal state
"0".
The value at the CV output is reset to zero when the signal state at input R changes to "1". As long
as the R input has signal state "1", the signal state at the CU input has no effect on the instruction.
Page | 28
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Example
When the signal state of the "TagIn_1" operand changes from "0" to "1", the "Count up" instruction
is executed and the current counter value of the "Tag_CV" operand is incremented by one. With
each additional positive signal edge, the counter value is incremented until the high limit of the
data type (INT = 32767) is reached.
The value of the PV parameter is adopted as the limit for determining the "TagOut" output. The
"TagOut" output has signal state "1" as long as the current counter value is greater than or equal
to the value of the "Tag_PV" operand. In all other cases, the "TagOut" output has signal state "0".
You can use the "Count down" instruction to decrement the value at output CV. When the signal
state at the CD input changes from "0" to "1" (positive signal edge), the instruction is executed and
the current counter value at the CV output is decremented by one. Each time a positive signal
edge is detected, the counter value is decremented until it reaches the low limit of the specified
data type. When the low limit is reached, the signal state at the CD input no longer has an effect
on the instruction.
You can query the counter status in the Q output. If the current counter value is less than or equal
to zero, the Q output is set to signal state "1". In all other cases, the Q output has signal state "0".
The value at the CV output is set to the value of the PV parameter when the signal state at the LD
input changes to "1". As long as the LD input has signal state "1", the signal state at the CD input
has no effect on the instruction.
Page | 29
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Example
When the signal state of the "TagIn_1" operand changes from "0" to "1", the instruction is
executed and the value at the "Tag_CV" output is decremented by one. With each additional
positive signal edge, the counter value is decremented until the low limit of the specified data type
(INT = -32768) is reached.
The "TagOut" output has signal state "1" as long as the current counter value is less than or equal
to zero. In all other cases, the "TagOut" output has signal state "0".
Page | 30
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
You can use the "Count up and down" instruction to increment and decrement the counter value at
the CV output. If the signal state at the CU input changes from "0" to "1" (positive signal edge), the
current counter value is incremented by one and stored at the CV output. If the signal state at the
CD input changes from "0" to "1" (positive signal edge), the counter value at the CV output is
decremented by one. If there is a positive signal edge at the CU and CD inputs in one program
cycle, the current counter value at the CV output remains unchanged.
The counter value can be incremented until it reaches the high limit of the data type specified at
the CV output. When the high limit is reached, the counter value is no longer incremented on a
positive signal edge. The counter value is no longer decremented once the low limit of the
specified data type has been reached.
When the signal state at the LD input changes to "1", the counter value at the CV output is set to
the value of the PV parameter. As long as the LD input has signal state "1", the signal state at the
CU and CD inputs has no effect on the instruction.
The counter value is set to zero when the signal state at the R input changes to "1". As long as the
R input has signal state "1", a change in the signal state of the CU, CD and LD inputs has no
effect on the "Count up and down" instruction.
You can query the status of the up counter at the QU output. If the current counter value is greater
than or equal to the value of the PV parameter, the QU output is set to signal state "1". In all other
cases, the QU output has signal state "0".
You can query the status of the down counter at the QD output. If the current counter value is less
than or equal to zero, the QD output is set to signal state "1". In all other cases, the QD output has
signal state "0".
Page | 31
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Example
If the signal state at the "TagIn_1" or "TagIn_2" input changes from "0" to "1" (positive signal
edge), the "Count up and down" instruction is executed. When there is a positive signal edge at
the "TagIn_1" input, the current counter value is incremented by one and stored at the "Tag_CV"
output. When there is a positive signal edge at the "TagIn_2" input, the counter value is
decremented by one and stored at the "Tag_CV" output. When there is a positive signal edge at
the CU input, the counter value is incremented until it reaches the high limit of 32767. If input CD
has a positive signal edge, the counter value is decremented until it reaches the low limit of INT = -
32768.
The "TagOut" output has signal state "1" as long as the current counter value is greater than or
equal to the value at the "Tag_PV" input. In all other cases, the "TagOut" output has signal state
"0".
The "TagOut_QD" output has signal state "1" as long as the current counter value is less than or
equal to zero. In all other cases, the "TagOut_QD" output has signal state "0".
Task
When "P_Operation" (Q0.1) is switched on, the transported parts are to be counted and the
ACTUAL quantity is to be stored in the variable "MW_ACT" (MW20).
If the ACTUAL quantity has reached the SETPOINT quantity of 3, the indicator light "P_BayLB"
(Q3.4) shows a 1Hz flashing light. As long as this is not acknowledged via "S_BayLB" (I 3.4), the
indicator lights "P_Bay1" (Q3.1) and "P_Bay2" (Q3.2) are dark and no new part transportation can
be started.
Page | 32
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
What to Do
1- Add the new block "FC_Countsing" (FC18).
2- In "FC_Counting" (FC18), program the required functions. Use an IEC Counter to count the
parts. Pass "DB_Counter_Parts" (DB18) as the instance data block to this IEC Counter. At
the PV input, parameterize the setpoint quantity 3.
3- Program the call of "FC_Counting" (FC18) in "OB_Cycle" (OB1). Download all blocks into
the CPU and check the program function.
4- In the blocks "FC_Signal" (FC14) and "FC_ConvMotor" (FC16), program the required
lockouts with "M_ACT=SET" (M18.4).
5- Download all modified blocks into the CPU and check the program function.
6- Save your project.
Page | 33
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
6.2. TIMERS
The instruction is started when the result of logic operation (RLO) at input IN changes from "0" to
"1" (positive signal edge). The programmed time PT begins when the instruction starts. When the
time PT has elapsed, the output Q has the signal state "1". Output Q remains set as long as the
start input is still "1". When the signal state at the start input changes from "1" to "0", the Q output
is reset. The timer function is started again when a new positive signal edge is detected at the
start input.
The current time value can be queried at the ET output. The timer value starts at T#0s and ends
when the value of the time duration PT is reached. The ET output is reset as soon as the signal
state at the IN-input changes to "0". If the instruction is not called in the program because it is
skipped, for example, the ET output returns a constant value as soon as the time PT has expired.
Example
Page | 34
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
The timer function TON (Timer on delay, "ON Delay") is started with a rising edge at input IN. So
that the time expires, RLO must continue to be '1'. The timer function supplies a '1' signal at output
Q, as soon as the specified time (variable or constant of data type TIME) at input PT has expired
and as long as the start signal at input IN still exists. The already expired time can be queried at output
ET by passing a variable of data type TIME.
The Q output is set when the result of logic operation (RLO) at input IN changes from "1" to "0"
(negative signal edge). When the signal state at input IN changes back to "1", the programmed
time PT starts. Output Q remains set as long as the time duration PT is running. When the PT time
duration expires, the Q output is reset. If the signal state at input IN changes to "1" before the PT
time duration expires, the timer is reset. The signal state at the output Q continues to be "1".
The current time value can be queried at the ET output. The timer value starts at T#0s and ends
when the value of the time duration PT is reached. When the PT time duration expires, the ET
output remains set to the current value until input IN changes back to "1". If input IN switches to
"1" before the duration PT has expired, the ET output is reset to the value T#0s. If the instruction is
not called in the program because it is skipped, for example, the ET output returns a constant
value as soon as the time has expired.
Example
Page | 35
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
When the signal state of the operand "Tag_Start" changes from "0" to "1", the "Tag_Status"
operand is set to signal state "1". When the signal state of the "Tag_Start" operand changes from
"1" to "0", the time programmed for the PT parameter is started. As long as the time is running, the
"Tag_Status" operand remains set to TRUE. When the time has expired, the "Tag_Status"
operand is reset to FALSE. The current time value is stored in the "Tag_ElapsedTime" operand.
The instruction is started when the result of logic operation (RLO) at input IN changes from "0" to
"1" (positive signal edge). The programmed time PT begins when the instruction starts. Output Q
is set for the duration PT, regardless of the subsequent course of the input signal. While the time
PT is running, the detection of a new positive signal edge at the IN input has no influence on the
signal state at the Q output.
You can scan the current time value at the ET output. The timer value starts at T#0s and ends
when the value of the time duration PT is reached. When the time PT has elapsed and the signal
state at input IN is "0", the ET output is reset. If the instruction is not called in the program because
it is skipped, for example, the ET output returns a constant value as soon as the time PT has
expired
Page | 36
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Example
When the signal state of the "Tag_Start" operand changes from "0" to "1", the time programmed
for the PT parameter is started and the "Tag_Status" operand is set to "1". The current time value
is stored in the "Tag_ElapsedTime" operand. When the time expires, the "Tag_Status" operand is
reset to signal state "0".
Page | 37
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
The instruction "Time accumulator" is used to accumulate time values within a period set by the
parameter PT. When the signal state at the IN-input changes from "0" to "1" (positive signal edge),
the time measurement is executed and the time PT starts. While the time PT is running, the time
values are accumulated that are recorded when the IN input has signal state "1". The accumulated
time is written to the ET output and can be queried there. When the duration PT expires, the
output Q has signal state "1". The Q parameter remains set to "1", even when the signal state at
the IN-parameter changes from "1" to "0" (negative signal edge).
The R input resets the ET and Q outputs regardless of the signal state of the start input.
Example
Page | 38
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
TIMERS TABLE
PARAMETER DECLARATION DATA MEMORY AREA DESCRIPTION
TYPE
IN Input BOOL I,Q,D,L,M,P,Constant Start Input
PT Input TIME I,Q,D,L,M,P,Constant Duration of Timer Setpoint
R Input BOOL I,Q,D,L,M,P,Constant Reset Input
(Only for TONR Timer)
Q Output BOOL I,Q,D,L,M,P Output for Timer Result
ET Output I,Q,D,L,M,P Current Time Value
Page | 39
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
• User-defined data types are special data structures you create yourself that you can use in the
whole S7 program once they have been defined.
• User-defined data types can be used like elementary data types or complex data types in the
variable declaration of logic blocks (FC, FB, OB) or as a data type for variables in a data block (DB).
You then have the advantage that you only need to define a special data structure once to be able
to use it as many times as you wish and assign it any number of variables.
• User-defined data types can be used as a template for creating data blocks with the same data
structure, meaning you create the structure once and then create the required data blocks by simply
assigning the user-defined data type
(Example: Recipes: The structure of the data block is always the same, only the amounts used are
different.)
Default Value:
default value to be
saved for defined
parameter.
Page | 40
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 41
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 42
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
EXAMPLE
In the example below the fill level of a tank with a capacity of 500 liters is to be measured.
The transducer used measures a voltage of -10 V with an empty tank and a voltage of +10 V
with a full tank. The analog module converts the voltage range from -10 V to +10 V into the
value range -27648 to +27648 and converts this range into the original quantity of 0 to
500 liters with the NORM-X and SCALE-X Blocks.
You can use the SCALE_ X "Scale" and NORM_X "Normalize" converters to scale analog values
Open Instructions>Basic Instructions> Conversion Operation
In the following examples it is assumed that the measuring ranges are bipolar. The integer input
value is then between -27648 and 27648.
Page | 43
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
The following values are generated by the conversion (for determining level via voltage
measurement, for example):
Page | 44
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 45
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
A PLC tag is automatically created for each available system or clock memory bit.
9.1. Clock Memory (8 bits)
These are memory bits whose binary state is changed periodically by the operating system of the
CPU with a pulse-pause ratio of 1:1. The various frequencies are shown in the picture.
Clock memory (bits) are used to trigger actions periodically.
For example, to make an indicator light flash
Attention!
Clock memory (bits) are not synchronized with the CPU cycle; in other words, with long cycle
times, the state of the clock memory (bits) can change more than once within one cycle.
9.2. System Memory (4 bits)
These are memory bits that provide system status information.
• "First Scan" =1 in the first CPU cycle; otherwise =0
• "Diag Status Update" =1, if a problem exists; otherwise =0
• One static 0 and 1 memory bit each
Page | 46
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Signal modules in S7-1500 divided into major four types with categories
• hardware interrupts
• value status
• integrated counter for channel 0 and 1
10.1.2. Module Options
Page | 48
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 49
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Three options to take the reaction in case of CPU stop (only in HF) modules
1- Shutdown: The output state goes to OFF in case of CPU Stop
2- Keep last value: The output value will not be changed since the last Peripheral output
update of the last scan cycle
3- Output substitute value 1: in this case the output will be forced ON
Page | 50
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
The "PID_Compact" technology object reads the measured process value and compares it with
the setpoint (in this example, the setpoint is set via HMI). From the resulting control deviation, the
controller calculates an output value in order to adjust the setpoint deviation or the disturbance
variable if necessary. The output value of the PID controller consists of three components:
• P component The P component of the output value is proportional to the control deviation.
• I component The I component of the output value is the integral component. This increases
as long as there is a control deviation.
• D component The D component is the differential component and increases as the rate of
change of the control deviation increases.
The "PID_Compact" technology object has the "tuning" commissioning functionality with which the
P, I and D parameters can be calculated automatically depending on the controlled system.
However, you can also specify the control parameters manually.
The automatic tuning is divided into tuning types:
1. Pretuning and
2. Fine tuning
Both types of tuning are described below.
11.1. FB "PID_Compact"
STEP 7 V15.1 supplies the technology object "PID_Compact" in version 2.3 for the S7-1200 or
version 2.4 for the S7-1500 with the installation. This function block was specially developed for
the control of proportional actuators.
Page | 51
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 52
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 53
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Open the configuration editor by selecting the CPU -> Technology objects -> PID_Compact_1 ->
Configuration.
Page | 54
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 55
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 56
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 57
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 58
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
The PID parameters are retentively stored in the instance data module of the "PID_Compact"
compact controller. During a warm start (voltage recovery), the last values passed through are
retained. The start values are only loaded during a cold start (transfer of the project in the
operating state STOP or overall reset of the memory via MRES).
Page | 59
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Automated plants often need to be in operation 24/7. Therefore, failure safety and high availability
are important, the basic requirements of many automation systems. Special media redundancy
protocols that ensure a loop-free network topology and a detection of communication interruptions
address these issues.
Redundant systems require a switching time to detect interruptions and to switch over to redundant
structures.
The requirements are met on the basis of a ring topology of the MRP (“Media Redundancy
Protocol”) extension “Media Redundancy with Planned Duplication of frames” (“MRPD”). During a
device or line failure in the ring, all other devices continue to be supplied with IO data without
interruption.
Page | 60
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
With MRPD, there are several redundancy levels of an IO Device. This redundancy level indicates,
how severely real-time communication is affected in the event of a network interruption between
the IO Device and its IO Controller.
The following redundancy levels are available:
• Full media redundancy: The real-time communication is not affected, since IO Controller
and IO Device are in the same ring.
• Partial media redundancy:
– Real-time communication cannot be maintained, if there is an interruption in a non-redundant
part (line) between IO Controller and IO Device.
– The real-time communication is not affected, if there is an interruption in the redundant part
(ring).
• No media redundancy: The real-time communication is always affected, since there are no
redundant paths between IO Controller and IO Device.
•
The following figure shows the redundancy levels by means of a configuration example with
MRPD. The three IO Devices in the ring (2) and the switch (3) have the redundancy level “Full
redundancy”. The IO Device at the switch (4) has the redundancy level “Partial redundancy”, as
the connection to the switch is not redundant.
Page | 61
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Preparation
Open the TIA Portal configuration software and create a new project.
12.2.1. Implementing the devices
Add the following devices:
1. Add an S7-1500 CPU (Should Support MRP) using the project navigation. This CPU gets
the name “PLC_1”.
2. In the “Devices & networks” overview, insert two ET 200SP stations with a PROFINET
interface module (in this case 155-6 PN HS) and equip it with the desired modules (in this
case one DI module and one DO module) as well as with a server module.
Page | 62
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Add the interface modules (in this case IM 155-6 PN HS) to the newly created network.
For both interface modules, proceed as follows:
1. Access the “Devices & Networks” overview in the project navigation.
2. At the interface module, click “Not assigned” and select the IO controller (“PLC_1”) to which
this IO device is assigned.
Page | 63
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
5. In the “MRP role” column, set the media redundancy role for the PROFINET devices.
Page | 64
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Contents
1. Introduction to TIA Portal Dashboard ..................................................................................................... 2
.1.1 One common engineering framework for manufacturing automation ............................................. 2
1.2. TIA Portal: Portal View and Project View ............................................................................................ 3
.1.2.1 Layout of the Portal View: ........................................................................................................... 4
1.2.2. Layout of the Project View:.......................................................................................................... 5
1.3. TIA Portal - Settings: User Interface Language ................................................................................... 6
1.4. TIA Portal - Settings: Language, Storage Location, Layout ................................................................. 7
2. Built up Hardware configuration (S7-1500) ............................................................................................... 8
2.1. Configuration of the S7-1500 .............................................................................................................. 8
2.2. Creating a Hardware Station ............................................................................................................... 9
2.3. Inserting / Deleting a Module ........................................................................................................... 10
2.3.1. Inserting a Module ..................................................................................................................... 10
2.3.2. Deleting a Module...................................................................................................................... 10
2.4. Online Tools, Configuring and Parameterizing the Hardware .......................................................... 11
2.4.1. Online Tools ............................................................................................................................... 11
2.4.2. Configuring and Parameterizing the Hardware ......................................................................... 11
2.4.3. Internet Protocol........................................................................................................................ 12
2.4.4. IP Addresses ............................................................................................................................... 12
2.4.5. MAC Address .............................................................................................................................. 12
2.4.6. Subnet Mask .............................................................................................................................. 12
2.5. Compiling the Hardware Configuration and Downloading it into CPU ............................................ 13
Compiling / Downloading the Hardware Configuration ........................................................................... 13
3. Data types of PLC under TIA portal .......................................................................................................... 14
3.1. Elementary Data Types ..................................................................................................................... 14
3.2. Complex Data Types .......................................................................................................................... 15
3.3. PLC Data Types .................................................................................................................................. 15
4. Handling with Functions, Functions blocks, Data Blocks ......................................................................... 16
4.1. Data Blocks and their Usage.............................................................................................................. 16
.4.2 Creating DBs ...................................................................................................................................... 16
4.3. Functions (FCs) .................................................................................................................................. 17
4.4. Function Blocks (FBs)......................................................................................................................... 17
Page | 65
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 67
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses
151 EBED STREET, KORNISH EL NILE - CAIRO - EGY.
Training Center EISAC AUTOMATION
Page | 68
Mobile: +20 120 471 7026
www.eisac-automation.com E-mail:[email protected]
Sales - Maintenance - Programming - Courses