Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Siemens S7300 Basic Programming

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 175

Module 4

Digital Fundamentals And PLC


Programming
Content Outline
Level 1, Course 4

Digital Fundamentals
Basic Logic Operations
Number Systems
Combining Logic in Mechatronic Systems
PLCs in Mechatronic System
Basic PLC Operations (Bit Logic )
Course Goals:
Upon completion of the course, students should:
1. Understand the role of programmable logic
controllers in complex mechatronic systems,
modules and subsystems.
2. Understand the flow of information in the
system.
3. Understand and apply troubleshooting,
maintenance and safety rules.
Description
This training introduces the basic hardware and
software components of a Programmable Controller
(PLC). It details the architecture and basic
instruction set common to all PLC’s with an
emphasis on S7300 Siemens PLC . Basic
programming techniques and logic designs are
covered. This training describes the operating
features of the PLC, the advantages of the PLC over
hard-wired control systems, practical applications,
troubleshooting and maintenance of PLC’s.

4
Logic Levels

Digital signals either 0 or 1

PLC voltage ranges


Number of possible input
combinations
Two input switches
0 0 Configuration 1 Both switches open

0 1 Configuration 2 Switch 1 closed, switch 2 open

1 0 Configuration 3 Switch 1 open, switch 2 closed

1 1 Configuration 4 Both switches closed


Analog Measurement in Control
Systems
Example:
The number of revolutions of a rotating shaft is
measured. The speed range can be converted from
500... 1500 rpm into a voltage range from 0... +10 V
by using a transducer.
(a) The measured number of revolutions is
865 R/min. Determine the voltage output.
(b) The output voltage is 8.5V. How high is the
number of revolutions?
solution
Analog to Digital Conversion

Using 2bit-code using 3 bit-code


The more bits are used to represent a sampled value, the
finer the resolution and the more accurate the
representation, more quantization levels
Example
The voltage range (0V … +10 V) of an ADC is given.
How many bits must the ADC use to identify voltage
differences less than 5 mV?
Solution :
Step less then 5 mv
No. of quantization levels( steps) =10/5mv =2000 level
2000 is 2 11

At
least 11 bits are needed
Basic Logic
Circuit diagram of a NOT function
When the push button is not actuated, the relay
is switched on. When the push button is
actuated, the relay goes off
AND gate
AND CCT
AND gate used as a frequency
counter
1. Number Systems
Common Number Systems

System Base Symbols


Decimal 10 0, 1, … 9
Binary 2 0, 1
Octal 8 0, 1, … 7
Hexa- 16 0, 1, … 9,
decimal A, B, … F
Quantities/Counting (1 of 3)
Hexa-
Decimal Binary Octal decimal
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
Quantities/Counting (2 of 3)
Hexa-
Decimal Binary Octal decimal
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
Quantities/Counting (3 of 3)
Hexa-
Decimal Binary Octal decimal
16 10000 20 10
17 10001 21 11
18 10010 22 12
19 10011 23 13
20 10100 24 14
21 10101 25 15
22 10110 26 16
23 10111 27 17 Etc.
Conversion Among Bases

The possibilities:
Decimal Octal

Binary Hexadecimal

pp. 40-46
Quick Example

2510 = 110012 = 318 = 1916

Base
Decimal to Decimal (just for fun)

Decimal Octal

Binary Hexadecimal

Next slide…
Weight

12510 => 5 x 100 = 5


2 x 101 = 20
1 x 102 = 100
125

Base
Binary to Decimal

Decimal Octal

Binary Hexadecimal
Binary to Decimal

Technique
– Multiply each bit by 2n, where n is the “weight” of
the bit
– The weight is the position of the bit, starting from 0
on the right
– Add the results
Example
Bit “0”

1010112 => 1 x 20 = 1
1 x 21 =
2
0 x 22 =
0
1 x 23 =
8
0 x 24 =
0
1 x 25 =
32
Octal to Decimal

Decimal Octal

Binary Hexadecimal
Octal to Decimal

Technique
– Multiply each bit by 8n, where n is the “weight” of
the bit
– The weight is the position of the bit, starting from 0
on the right
– Add the results
Example

7248 => 4 x 80 = 4
2 x 81 = 16
7 x 82 = 448
46810
Hexadecimal to Decimal

Decimal Octal

Binary Hexadecimal
Hexadecimal to Decimal
Technique
– Multiply each bit by 16n, where n is the “weight” of
the bit
– The weight is the position of the bit, starting from 0
on the right
– Add the results
Example

ABC16 => C x 160 = 12 x 1 = 12


B x 161 = 11 x 16 = 176
A x 162 = 10 x 256 = 2560
274810
Decimal to Binary

Decimal Octal

Binary Hexadecimal
Decimal to Binary

Technique
– Divide by two, keep track of the remainder
– First remainder is bit 0 (LSB, least-significant bit)
– Second remainder is bit 1
– Etc.
Example
12510 = ?2 2 125
2 62 1

2 31 0
15 1
2
7 1
2
2 3 1

2 1 1
0 1

12510 = 11111012
Octal to Binary

Decimal Octal

Binary Hexadecimal
Octal to Binary
Technique
– Convert each octal digit to a 3-bit equivalent binary
representation
Example
7058 = ?2

7 0 5

111 000 101

7058 = 1110001012
Hexadecimal to Binary

Decimal Octal

Binary Hexadecimal
Hexadecimal to Binary
Technique
– Convert each hexadecimal digit to a 4-bit
equivalent binary representation
Example
10AF16 = ?2

1 0 A F

0001 0000 1010 1111

10AF16 = 00010000101011112
Decimal to Octal

Decimal Octal

Binary Hexadecimal
Decimal to Octal
Technique
– Divide by 8
– Keep track of the remainder
Example
123410 = ?8

8 1234
8 154 2
8 19 2
8 2 3
0 2

123410 = 23228
Decimal to Hexadecimal

Decimal Octal

Binary Hexadecimal
Decimal to Hexadecimal
Technique
– Divide by 16
– Keep track of the remainder
Example
123410 = ?16

16 1234
16 77 2
16 4 13 = D
0 4

123410 = 4D216
Binary to Octal

Decimal Octal

Binary Hexadecimal
Binary to Octal
Technique
– Group bits in threes, starting on right
– Convert to octal digits
Example
10110101112 = ?8

1 011 010 111

1 3 2 7

10110101112 = 13278
Binary to Hexadecimal

Decimal Octal

Binary Hexadecimal
Binary to Hexadecimal
Technique
– Group bits in fours, starting on right
– Convert to hexadecimal digits
Example
10101110112 = ?16

10 1011 1011

2 B B

10101110112 = 2BB16
Octal to Hexadecimal

Decimal Octal

Binary Hexadecimal
Octal to Hexadecimal
Technique
– Use binary as an intermediary
Example
10768 = ?16

1 0 7 6

001 000 111 110

2 3 E

10768 = 23E16
Unsigned Binary Coded Decimal
(BCD)

58
Hexadecimal to Octal

Decimal Octal

Binary Hexadecimal
Hexadecimal to Octal
Technique
– Use binary as an intermediary
Example
1F0C16 = ?8

1 F 0 C

0001 1111 0000 1100

1 7 4 1 4

1F0C16 = 174148
Exercise – Convert ...
Hexa-
Decimal Binary Octal decimal
33
1110101
703
1AF

Don’t use a calculator!

Skip answer Answer


Exercise –Answer
Convert …
Hexa-
Decimal Binary Octal decimal
33 100001 41 21
117 1110101 165 75
451 111000011 703 1C3
431 110101111 657 1AF
Common Powers (1 of 2)
Base 10

Power Preface Symbol Value


10-12 pico p .000000000001

10-9 nano n .000000001

10-6 micro  .000001

10-3 milli m .001

103 kilo k 1000

106 mega M 1000000

109 giga G 1000000000


1012 tera T 1000000000000
Common Powers (2 of 2)
Base 2
Power Preface Symbol Value
210 kilo k 1024

220 mega M 1048576

230 Giga G 1073741824

• What is the value of “k”, “M”, and “G”?


• In computing, particularly w.r.t. memory,
the base-2 interpretation generally applies
Unsigned Binary Numbers
• For a computer with the word size of 32-bit
- 4 data-bit unit – nibble (half byte)
- 8 data-bit unit - byte
- 16 data-bit unit – two bytes (half-word)
- 32 data-bit unit – word (four bytes)
- 64 data-bit unit – double-word
Powers of 2:
20 =1 24 =16 28 =256
21 =2 25 =32 29 =512
22 =4 26 =64 210 =1024
23 =8 27 =128

210 : K (kilo ); 2 20 : M (mega); 230 : G ( giga )

66
Example
In the lab…
1. Double click on My Computer
2. Right click on C:
3. Click on Properties

/ 230 =
Review – multiplying powers
For common bases, add powers
ab  ac = ab+c

26  210 = 216 = 65,536

or…
26  210 = 64  210 = 64k
Binary Addition (1 of 2)
Two 1-bit values

A B A+B
0 0 0
0 1 1
1 0 1
1 1 10
“two”

pp. 36-38
Binary Addition (2 of 2)
Two n-bit values
– Add individual bits
– Propagate carries
– E.g.,
1 1
10101 21
+ 11001 + 25
101110 46
Multiplication (1 of 3)
Decimal (just for fun)

35
x 105
175
000
35
3675

pp. 39
Multiplication (2 of 3)
Binary, two 1-bit values

A B AB
0 0 0
0 1 0
1 0 0
1 1 1
Multiplication (3 of 3)
Binary, two n-bit values
– As with decimal values
– E.g.,
1110
x 1011
1110
1110
0000
1110
10011010
Fractions
Decimal to decimal (just for fun)

3.14 => 4 x 10-2 = 0.04


1 x 10-1 = 0.1
3 x 100 = 3
3.14

pp. 46-50
Fractions
Binary to decimal

10.1011 => 1 x 2-4 = 0.0625


1 x 2-3 = 0.125
0 x 2-2 = 0.0
1 x 2-1 = 0.5
0 x 20 = 0.0
1 x 21 = 2.0
2.6875

pp. 46-50
Fractions
Decimal to binary .14579
x 2
3.14579 0.29158
x 2
0.58316
x 2
1.16632
x 2
0.33264
x 2
0.66528
x 2
1.33056
11.001001... etc.

p. 50
Exercise – Convert ...
Hexa-
Decimal Binary Octal decimal
29.8
101.1101
3.07
C.82
Don’t use a calculator!

Skip answer Answer


Exercise –Answer
Convert …
Hexa-
Decimal Binary Octal decimal
29.8 11101.110011… 35.63… 1D.CC…
5.8125 101.1101 5.64 5.D
3.109375 11.000111 3.07 3.1C
12.5078125 1100.10000010 14.404 C.82
Signed Numbers
The left most bit in a signed binary number is the
sign bit: a “0” is for positive, and a “1” is for
negative.
Expression of the decimal numbers +22 and -22
as an 8-bit signed binary number
Signed Numbers
1’s Complement Form
Expression of the decimal numbers
+22 and -22 as a 1’s complement
using eight bits
+22 : 0 0 0 1 0 1 1 0
-22 : 1 1 1 0 1 0 0 1
2’s Complement Form
in the 2’s complement form positive numbers are
represented the same way as in the sign
magnitude and the 1’complement forms.
Negative numbers are the 2’s complement of the
corresponding positive numbers. You have to add
1 to the 1’s complement to get the 2’s
complement.
Combined Logic Control
S1 or S2 for
pure.
S3.mixture

motor should
be activated,
while the
container is
being filled.

Orange ,
carrot coctail
Boolean Algebra
INTRODUCTION TO PLCS
Advantages of PLCs

• Less wiring.
• Wiring between devices and relay contacts are done in the PLC
program.
• Easier and faster to make changes.
• Trouble shooting aids make programming easier and reduce
downtime.
• Reliable components make these likely to operate for years before
failure.
PLC Origin

•- Developed to replace relays in the late 1960s

•- Costs dropped and became popular by 1980s

•- Now used in many industrial designs


Tank Used to Mix Two Liquids

MOTOR
A
FS FLOAT SWITCH

SOLENOIDS B

SOLENOID
C
TIMER

1 -MINUTE

90
Tank Used to Mix Two Liquids
A tank is used to mix two liquids. The control circuit
operates as follows:

1. When the start button is pressed, solenoids A and B


energize. This permits the two liquids to begin filling the
tank.

2. When the tank is filled, the float switch trips. This de-
energizes solenoids A and B and starts the motor used
to mix the liquids together.

3. The motor is permitted to run for one minute. After


one minute has elapsed, the motor turns off and
solenoid C energizes to drain the tank.
91
Major Components of a Common PLC
POWER
SUPPLY

I M O M
N O
P D U O
U U PROCESSOR T D
T L P U
From E U L
To
SENSORS T E
OUTPUT
Pushbuttons, Solenoids,
contacts, contactors,
limit switches, alarms
etc. etc.
PROGRAMMING
DEVICE

92
Major Components of a Common PLC
PROCESSOR

Provides intelligence to command and govern the


activities of the entire PLC systems.

PROGRAMMING DEVICE

used to enter the desired program that will determine


the sequence of operation and control of process
equipment or driven machine.

93
Programming Device
Also known as:


Industrial Terminal ( Allen Bradley )


Program Development Terminal ( General Electric )


Programming Panel ( Gould Modicon )


Programmer ( Square D )


Program Loader ( Idec-Izumi )


Programming Console ( Keyence / Omron )
94
Programming Device
Types:


Hand held unit with LED / LCD display


Desktop type with a CRT display


Compatible computer terminal

95
I/O Module
• The I/O interface section of a PLC connects it to
external field devices.

• The main purpose of the I/O interface is to condition


the various signals received from or sent to the external
input and output devices.

• Input modules converts signals from discrete or analog


input devices to logic levels acceptable to PLC’s
processor.

• Output modules converts signal from the processor to


levels capable of driving the connected discrete or
analog output devices.
96
I/O Module
DC INPUT MODULE
IS NEEDED TO:
· Prevent voltage
USE TO
DROP THE transients from
VOLTAGE damaging the
TO LOGIC processor.
·Helps reduce
LEVEL
the effects of
electrical noise

Current Buffer,
FROM Limiting Filter,
OPTO- TO
INPUT Resistor ISOLATOR hysteresis
PROCESSOR
DEVICE Circuits

97
I/O Module
AC INPUT MODULE
IS NEEDED TO:
CONVERTS THE AC · Prevent voltage
INPUT TO DC AND transients from
DROPS THE damaging the
VOLTAGE TO LOGIC processor.
LEVEL ·Helps reduce
the effects of
electrical noise

Rectifier, Buffer,
FROM Resistor Filter,
OPTO- TO
INPUT Network ISOLATOR Hysteresi
PROCESSOR
DEVICE s Circuits

98
99
100
101
I/O Module
DC / AC OUTPUT MODULE
IS NEEDED TO:
· Prevent voltage
transients from
damaging the
processor.
·Helps reduce
the effects of
electrical noise

Amplifier
FROM RELAY
TTL OPTO- TO
PROCESSOR ISOLATOR TRIAC
Circuits OUTPUT
X’SISTOR
DEVICE

102
103
OUTPUTS

INPUTS MOTOR

CONTACTOR
LAMP

PUSHBUTTONS
PLC

104
Allen-Bradley 1746-1A16

L1 L2 I= Input
Module
I:2 slot # in rack

P. B SWITCH 0 Module
Terminal #
Address I:2.0/0

LADDER PROGRAM
INPUT
MODULE
WIRING DIAGRAM

105
CONTACTOR
L2 L1 N.
O

MOTOR
L2
C •SOLENOID
L1 •VALVES
FIELD •LAMP
•BUZZER
WIRING

OUTPUT MODULE
WIRING
L1 O:4 L2

CONTACTOR 0
LADDER PROGRAM
106
Discrete Input
A discrete input also referred as digital input is an input that
is either ON or OFF are connected to the PLC digital input.
In the ON condition it is referred to as logic 1 or a logic high
and in the OFF condition maybe referred to as logic o or
logic low.
Normally Open
Pushbutton
Normally Closed
Pushbutton
Normally Open switch

Normally Closed switch

Normally Open contact

Normally closed contact


107
IN

OFF PLC
Logic 0
Input
Module
24 V dc

IN

OFF PLC
Logic 1
Input
Module
24 V dc

108
Analog Input
An analog input is an input signal that has a continuous
signal. Typical inputs may vary from 0 to 20mA, 4 to 20mA
or 0 to10V. Below, a level transmitter monitors the level of
liquid in the tank. Depending on the level Tx, the signal to the
PLC can either increase or decrease as the level increases
or decreases.

Level IN
Transmitter PLC
Analog
Tank Input
Module

109
Digital Output
A discrete output is either in an ON or OFF condition.
Solenoids,
contactors coils, lamps are example of devices connected to
the
Discrete or digital outputs. Below, the lamp can be turned ON
or OFF by the PLC output it is connected to.

Lamp
OUT
PLC

Digital
Output
Module

110
Analog Output

An analog output is an output signal that has a continuous


signal. Typical outputs may vary from 0 to 20mA, 4 to 20mA
or 0 to10V.
Electric to pneumatic transducer

OUT
E Supply air
PLC 0 to 10V P

Analog
Output
Module
Pneumatic control valve

111
Processor
The processor module contains the PLC’s microprocessor, its supporting
circuitry, and its memory system.

The main function of the microprocessor is to analyze data coming from


field sensors through input modules, make decisions based on the user’s
defined control program and return signal back through output modules to
the field devices. Field sensors: switches, flow, level, pressure, temp.
transmitters, etc. Field output devices: motors, valves, solenoids, lamps, or
audible devices.

The memory system in the processor module has two parts: a system
memory and an application memory.

112
Memory Map Organization
•System memory includes an area called the EXECUTIVE,
composed of permanently-stored programs that direct all
system activities, such as execution of the users control
program, communication with peripheral devices, and other
SYSTEM system activities.
•The system memory also contains the routines that
implement the PLC’s instruction set, which is composed of
specific control functions such as logic, sequencing, timing,
counting, and arithmetic.
•System memory is generally built from read-only memory
devices.

APPLICATION
•The application memory is divided into the data table area
•Data Table and user program area.
•The data table stores any data associated with the user’s
•User Program control program, such as system input and output status
data, and any stored constants, variables, or preset values.
The data table is where data is monitored, manipulated, and
changed for control purposes.
•The user program area is where the programmed
instructions entered by the user are stored as an application
control program.

113
Memory Designs
VOLATILE.
A volatile memory is one that loses its stored
information when power is removed.

Even momentary losses of power will erase any


information stored or programmed on a volatile memory
chip.

Common Type of Volatile Memory

RAM. Random Access Memory(Read/Write)


Read/write indicates that the information stored in the
memory can be retrieved or read, while write indicates
that the user can program or write information into the
memory. 114
Memory Designs

The words random access refer to the ability of any


location (address) in the memory to be accessed or
used. Ram memory is used for both the user memory
(ladder diagrams) and storage memory in many PLC’s.

RAM memory must have battery backup to retain or


protect the stored program.

115
Memory Designs
Several Types of RAM Memory:

1.MOS
2.HMOS
3.CMOS

The CMOS-RAM (Complimentary Metal Oxide


Semiconductor) is probably one of the most popular.
CMOS-RAM is popular because it has a very low current
drain when not being accessed (15microamps.), and the
information stored in memory can be retained by as little
as 2Vdc.

116
Memory Designs
NON-VOLATILE
Has the ability to retain stored information when power is
removed, accidentally or intentionally. These memories
do not require battery back-up.

Common Type of Non-Volatile Memory

ROM, Read Only Memory


Read only indicates that the information stored in
memory can be read only and cannot be changed.
Information in ROM is placed there by the manufacturer
for the internal use and operation of the PLC.

117
While the PLC is running, the scanning process
includes the following four phases, which are repeated
continuously as individual cycles of operation:

PHASE 1
Read Inputs
Scan
PHASE 2
Program
Execution
PHASE 3
Diagnostics/
Comm
PHASE 4
Output
Scan

118
PHASE 1 – Input Status scan

· A PLC scan cycle begins with the CPU reading the


status of its inputs.
PHASE 2– Logic Solve/Program Execution

· The application program is executed using the status


of the inputs

PHASE 3– Logic Solve/Program Execution

· Once the program is executed, the CPU performs


diagnostics and communication tasks

119
PHASE 4 - Output Status Scan
• An output status scan is then performed, whereby the
stored output values are sent to actuators and other
field output devices. The cycle ends by updating the
outputs.

120
As soon as Phase 4 is completed, the entire cycle begins
again with Phase 1 input scan.

The time it takes to implement a scan cycle is called


SCAN TIME. The scan time composed of the program
scan time, which is the time required for solving the
control program, and the I/O update time, or time
required to read inputs and update outputs. The program
scan time generally depends on the amount of memory
taken by the control program and type of instructions
used in the program. The time to make a single scan can
vary from 1 ms to 100 ms.

121
PLC Communications
Common Uses of PLC Communications Ports


Changing resident PLC programs -
uploading/downloading from a supervisory controller
(Laptop or desktop computer).


Forcing I/O points and memory elements from a
remote terminal.


Linking a PLC into a control hierarchy containing
several sizes of PLC and computer.

Monitoring data and alarms, etc. via printers or


Operator Interface Units (OIUs).


122
PLC Communications
Serial Communications

PLC communications facilities normally provides serial


transmission of information.

Common Standards

RS 232


Used in short-distance computer communications,
with the majority of computer hardware and
peripherals.

Has a maximum effective distance of approx. 30 m at
9600 baud.
123
PLC Communications
Local Area Network (LAN)

Local Area Network provides a physical link between all


devices plus providing overall data exchange
management or protocol, ensuring that each device can
“talk” to other machines and understand data received
from them.
LANs provide the common, high-speed data
communications bus which interconnects any or all
devices within the local area.

LANs are commonly used in business applications to


allow several users to share costly software packages
and peripheral equipment such as printers and hard disk
storage. 124
PLC Communications
RS 422 / RS 485


Used for longer-distance links, often between several
PCs in a distributed system. RS 485 can have a
maximum distance of about 1000 meters.

125
Specifications
Several factors are used for evaluating the quality and
performance of programmable controllers when selecting
a unit for a particular application. These are listed below.

NUMBER OF I /O PORTS

This specifies the number of I/O devices that can be


connected to the controller. There should be sufficient
I/O ports to meet present requirements with enough
spares to provide for moderate future expansion.

126
Selecting a PLC

Criteria

• Number of logical inputs and outputs.


• Memory
• Number of special I/O modules
• Scan Time
• Communications
• Software
A Detailed Design Process

1. Understand the process


2. Hardware/software selection
3. Develop ladder logic
4. Determine scan times and memory requirements
Specifications
OUTPUT-PORT POWER RATINGS

Each output port should be capable of supplying


sufficient voltage and current to drive the output
peripheral connected to it.

SCAN TIME

This is the speed at which the controller executes the


relay-ladder logic program. This variable is usually
specified as the scan time per 1000 logic nodes and
typically ranges from 1 to 200 milliseconds.

129
Specifications
MEMORY CAPACITY

The amount of memory required for a particular


application is related to the length of the program and
the complexity of the control system. Simple applications
having just a few relays do not require significant amount
of memory. Program length tend to expand after the
system have been used for a while. It is advantageous to
a acquire a controller that has more memory than is
presently needed.

130
PLC Status Indicators
•Power On
•Run Mode
•Programming Mode
•Fault
Troubleshooting

1. Look at the process


2. PLC status lights
HALT - something has stopped the CPU
RUN - the PLC thinks it is OK (and probably is)
ERROR - a physical problem has occurred with the P
3. Indicator lights on I/O cards and sensors
4. Consult the manuals, or use software if available.
5. Use programming terminal / laptop.
List of items required when working with PLCs:

1. Programming Terminal - laptop or desktop PC.


2. PLC Software. PLC manufacturers have
their own specific software and license key.
3. Communication cable for connection from Laptop
to PLC.
4. Backup copy of the ladder program (on diskette,
CDROM,
hard disk, flash memory). If none, upload it from the
PLC.
5. Documentation- (PLC manual, Software manual,
drawings,
ladder program printout, and Seq. of Operations
manual.)
Examples of PLC Programming Software:

1. Allen-Bradley – Rockwell Software RSLogix500


2. Modicon - Modsoft
3. Omron - Syswin
4. GE-Fanuc Series 6 – LogicMaster6
5. Square D- PowerLogic
6. Siemens – Simatic
6. Telemecanique – Modicon TSX Micro
PROGRAMMING

Normally Open Normally Closed


(NO) (NC)

Power flows through these contacts when they are closed. The
normally open (NO) is true when the input or output status bit
controlling the contact is 1. The normally closed (NC) is true
when the input or output status bit controlling the contact is 0.

135
Coils

Coils represent relays that are energized when power flows to


them. When a coil is energized it causes a corresponding
output to turn on by changing the state of the status bit controllin
the output to 1. That same output status bit maybe used to contr
normally open or normally closed contact anywhere in the progr

136
Boxes

Boxes represent various instructions or functions that are


Executed when power flows to the box. Some of these
Functions are timers, counters and math operations.

137
Basic Programming Simatic S7-300

By:
Andri Kuncoro
SIMATIC Overview
SIMATIC Controller (PLC)

S7-400
S7-200

S7-300
S7 – 300
Features :
 Modular small controll system
 Performance graded range of CPU
 Extensive selection of modules
 Expandable design with up to 32 modules
 Backplane bus integrated in the modules
 Can be networked with MPI, Profibus or Industrial ethernet
 Central PG/PC connection with access to all modules
 No slot restrictions
 Configuration and parameter setting with the help “HW Config”
S7 – 300
Mode Selector
MRES = Memory reset function
STOP = Stop mode, program not executed
RUN = Program execution
RUNP = Program execution, read/write access

Status Indicator
SF = Group error, internal CPU or fault in
module
BATF = Battery fault
DC5V = Internal 5 VDC voltage indicator
FRCE = FORCE
RUN = Flashes when the CPU is starting up,
then steady light in Run mode
STOP = Show steady light in Stop mode
SF DP = Physical bus fault
BUSF = No configuration or incorrect
configuration
Starting with SIMATIC Manager
SIMATIC Manager menus and toolbars
Standard Library
Context-Sensitive Help in S7

F1
Creating a project
Insert Station
Starting Hardware Configuration Editor
Generating a Hardware setpoint Configuration
Addressing S7 Modules
Module Address Overview
Variable Addressing

2x
CPU Properties

2x
Saving the HW Configuration and Downloading
it in the Module
Inserting S7 Block
Inserting S7 Block
Block architecture and Block editor

OB : Organization Block Maximun Nesting Depth :


FB : Function Block
FC : Function S7-300 : 8 (16 for CPU 318)
SFB : System Function Block
SFC : System Function S7-400 :24
DB : Data Block
Program Structure
Binary Operation
ASSIGNMENT

AND - OPERATION
Binary Operation
OR - OPERATION
Binary Operation
EXCLUSIVE - OR - OPERATION
Binary Operation
RESET DOMINANT

SET DOMINANT
Binary Operation
POSITIVE EDGE
Binary Operation
NEGATIVE EDGE
Binary Operation
JUMP UNCONDITIONAL (JU)

JUMP CONDITIONAL (JC)


Digital Operation
BIT

BYTE For a unit of 8 binary characters, the term BYTE is used. A byte has the size of 8 bits.

WORD A word also has the size of 2 bytes or 16 bits.

DOUBLE-WORD A double-word corresponds to the word length of 32 binary characters.


A double-word also has the size of 2 words, 4 bytes, or 32 bits.
Digital Operation
Beberapa operand di S7 :
1. Operand input(I) 6. Operand Peripheral(PI)
Bit I 0.0 - … Input Byte PIB 0 - …
Input Word PIW 0 - …
Byte IB 0 - …
Output Byte PQB 0 - …
Word IW 0 - … Output Word PQW 0 - …
Double Word ID 0 - …
2. Operand Output(Q) 7.Operand Data(D)
Bit Q 0.0 - … Bit DBX 0.0 - …
Byte QB 0 - … Byte DBB 0 - …
Word DBW 0 - …
Word QW 0 - …
Double Word DBD 0 - …
Double Word QD 0 - …
3. Operand Flag(M)
Bit M 0.0 - …
Byte MB 0 - …
Word MW 0 - …
Double Word MD 0 - …
4. Operand Timer(T)
T0
5. Operand Counter(C)
C0
Digital Operation
PULSE TIMER
Digital Operation
EXTENDED PULSE TIMER
Digital Operation
ON –DELAY TIMER
Digital Operation
OFF-DELAY TIMER
Digital Operation
COUNTER OPERATIONS
Digital Operation
COMPARISON FUNCTIONS

== IN1 is equal to IN2


<> IN1 is not equal to IN2
> IN1 is greater than IN2
< IN1 is less than IN2
>= IN1 is greater than or equal to IN2
<= IN1 is less than or equal to IN2
Digital Operation

You might also like