Professional Documents
Culture Documents
PLC Training Course by Ahmedelsisy
PLC Training Course by Ahmedelsisy
PLC Training Course by Ahmedelsisy
Co
ourse: PLC Pro
ogramm
ming Co
oncepts
Dr. Ashraf Elnaggar
[2008]
Member of SHAKER Consultancy Group
Plc Training Course
Copyright © Conisys 2008 [P a g e | 2] [Dr. Ashraf Elnaggar]
Contents
Contents .................................................................................................................................. 3
Section 1: Introduction .................................................................................................................... 8
Binary Signal ................................................................................................................................ 8
ANALOG Signal ............................................................................................................................ 9
Number systems ........................................................................................................................ 10
Decimal System ..................................................................................................................... 10
Binary System ........................................................................................................................ 10
BCD ‐ Code (8‐4‐2‐1‐Code) .................................................................................................... 11
Hexadecimal Number System ............................................................................................... 11
Conversion rules ........................................................................................................................ 12
Converting decimal binary .................................................................................................... 12
Converting decimal hexadecimal ........................................................................................ 13
Converting binary hexadecimal ............................................................................................. 13
Terms from computer science................................................................................................... 14
Section 2: PLC Hardware .............................................................................................................. 16
PLC Hardware components ...................................................................................................... 16
PLC Configuration .................................................................................................................. 16
PLC Memories ........................................................................................................................ 16
PLC Status .............................................................................................................................. 17
The EH‐150 of Hitachi (Module type) .................................................................................... 17
CPU Module ........................................................................................................................... 18
Power module ....................................................................................................................... 19
Input module ......................................................................................................................... 20
Output module ...................................................................................................................... 21
Analog I/O module ................................................................................................................ 22
Expansion Cable ..................................................................................................................... 23
I/O controller ......................................................................................................................... 24
Inputs/Outputs ...................................................................................................................... 24
Example ................................................................................................................................. 25
Selection of a PLC ...................................................................................................................... 25
Review Questions ...................................................................................................................... 25
Section 3 : Programming Software ................................................................................................ 27
ActWin Ladder (LD) programming: ............................................................................................ 27
Open ActWin ......................................................................................................................... 27
Hardware configuration: ....................................................................................................... 29
Start to create a Ladder program: ......................................................................................... 32
Type the name of the symbol: ............................................................................................... 33
Select an existing symbol: ..................................................................................................... 33
Select the address number: ................................................................................................... 34
To insert a parallel connection: ............................................................................................. 37
To Delete contacts: ................................................................................................................ 39
The system library: ................................................................................................................ 43
User defined Function: .......................................................................................................... 48
User Library: .......................................................................................................................... 49
Included User Library files: .................................................................................................... 50
To print out the project: ........................................................................................................ 63
Export the content of the symbol window: ........................................................................... 63
Communication settings: ....................................................................................................... 65
To change settings: ................................................................................................................ 66
To search for addresses: ........................................................................................................ 68
On‐Line Programming: .......................................................................................................... 70
On‐Line Change: .................................................................................................................... 73
Data memory tables: ............................................................................................................. 73
Export from Data Memory: ................................................................................................... 75
Import to Data Memory: ....................................................................................................... 75
Section 4: Programming Concepts ................................................................................................ 76
Control Branches ....................................................................................................................... 76
Programming Concepts ............................................................................................................. 78
Flowchart‐based design ......................................................................................................... 79
Ladder Logic from flowcharts .................................................................................................... 79
Sequence bits ........................................................................................................................ 79
Transition logic ...................................................................................................................... 80
Section 5: Programming Rules & more ......................................................................................... 81
Programming Rules ................................................................................................................... 81
A Golden Programming Rule ................................................................................................. 81
The On Dominant Rule .......................................................................................................... 81
Output Using Set Reset Technique ........................................................................................ 82
Case Study 1: Tank Filling Control using Set/Reset ............................................................... 82
Case Study: Control of Conveyor Belt ................................................................................... 84
Description ............................................................................................................................ 84
Operation .............................................................................................................................. 84
I/O Assignment ...................................................................................................................... 85
Flow Chart ............................................................................................................................. 85
The On‐Delay Time .................................................................................................................... 86
The Single Shot Timer ................................................................................................................ 88
Mono‐Stable Timer .................................................................................................................... 88
Integral Timer ............................................................................................................................ 90
Up Counter ................................................................................................................................ 90
Up/Down Counter ..................................................................................................................... 91
Course: PLC Programming Concepts
Course: PLC Programming Concepts
Course: PLC Programming Concepts
Course: PLC Programming Concepts
Course: PLC Programming Concepts
Binary Signal
Binary signals can take the value of two possible states. They are as follows:
Signal state “1“= voltage available = e.g. Switch on
Signal state “0“= voltage not available = e.g. Switch off
In control engineering, a frequent DC voltage of 24V is used as a “control supply
voltage“ A voltage level of + 24V at an input clamp means that the signal status is “1“
for this input. Accordingly, 0V means that the signal status is “0“. In addition to a
signal status, another logical assignment of the sensor is important. It is a matter of
whether the transmitter is a “normally closed” contact or a “normally open” contact.
When it is operated, a “normally closed” contact supplies a signal status of “0“in the
“active case“. One calls this switching behavior “active 0“or “active low“. A “normally
open” contact is “active 1”/“active high“, and supplies a “1“signal, when it is
operated.
In closed loop control, sensor signals are “active 1“. A typical application for an
“active 0“transmitter is an emergency stop button. An emergency stop button is
always on (current flows through it) in the non‐actuated state (emergency stop
button not pressed). It supplies a signal of “1“(i.e. wire break safety device) to the
attached input. If operation of an emergency stop button is to implement a certain
reaction (e.g. all valves close), then it must be triggered with a signal status of “0“.
Equivalent binary digits
A binary signal can only take the two values (signal statuses) “0“or “1“. Such a
binary signal is also designated as an equivalent binary digit and receives the
designation of “Bit “in the technical language book. Several binary signals result in a
digital signal after a certain assignment (code). While a binary signal only provides a
grouping of a bivalent size/e.g. for door open/door close), one can form e.g. a
number or digit as digital information by the bundling of equivalent binary digits.
ANALOG Signal
Contrary to a binary signal that can accept only signal statuses („Voltage available
+24V“and “Voltage available 0V“, there are similar signals that can take many values
within a certain range when desired. A typical example of an analog encoder is a
potentiometer. Depending upon the position of the rotary button, any resistance can
be adjusted here up to a maximum value.
Examples of analog measurements in control system technology:
• Temperature ‐50 ... +150°C
• Current flow 0 ... 200l/min
• Number of revolutions 500 ... 1500 R/min
• Etc.
These measurements, with the help of a transducer in electrical voltages, are
converted to currents or resistances. E.g. if a number of revolutions is collected, the
speed range can convert over a transducer from 500... 1500 R/min into a voltage
range from 0... +10V. At a measured number of revolutions of 865 R/min, the
transducer would give out a voltage level of + 3.65V.
If similar measurements are processed with a PLC, then the input must be converted
into digital information to a voltage, current or resistance value. One calls this
transformation analog to digital conversion (A/D conversion). This means, that e.g. a
voltage level of 3.65V is deposited as information into a set of equivalent binary
digits. The equivalent binary digits for the digital representation will be used, in
order for the resolution to be finer.
If one would have e.g. only 1 bit available for the voltage range 0... +10V, only one
statement could be met, if the measured voltage is in the range 0.. +5V or
+5V....+10V. With 2 bits, the range can be partitioned into 4 single areas, (0...
2.5/2.5... 5/5... 7.5/7.5... 10V). Usually in control engineering, the A/D converter is
changed with the 8th or 11th bit. 256 single areas are normally provided, but with 8
or 11 bits, you can have 2048 single areas.
Number systems
For the processing of the addresses of memory cells, inputs, outputs, times, bit
memories etc. by a programmable controller, the binary system is used instead of
the decimal system.
Decimal System
In order to understand the binary number system, it is first necessary to consider
the decimal system. Here the number of 215 is to be subdivided. Thereby the
hundreds represent the two, the one stand for the tens and the five for the ones.
Actually, one would have to write 215 in such a way: 200+10+5. If one writes down
the expression 200+10+5, with the help of the powers of ten as explained earlier,
then one states that each place is assigned a power of ten within the number.
Each number within the decimal system is assigned a power of ten.
Binary System
The binary number system uses only the numbers 0 and 1, which are easily
represented and evaluated in data processing. Thus it is called a binary number
system.
BCD Code (8421Code)
In order to represent large numerical values more clearly, the BCD code (binary
coded decimal number) is frequently used. The decimal numbers are represented
with the help of the binary number system. The decimal digit with the highest value
is the 9. One needs to demonstrate the 9 with power‐of‐two numbers until 23, thus
using 4 places for the representation of the number.
Because the representation of the largest decimal digit requires 4 binary places, a
four‐place unit called a tetrad, is used for each decimal digit. The BCD code is thus
a 4‐Bit‐Code. Each decimal number is coded individually. The number of 285
consists e.g. of three decimal digits. Each decimal digit appears in the BCD code as a
four‐place unit (tetrad).
2 8 5
0010 1000 0101
Each decimal digit is represented by an individually coded tetrad.
Hexadecimal Number System
The hexadecimal number system belongs to the notational systems because value
powers of the number 16 are used. The hexadecimal number system is thus a
sixteen count system. Each place within a hexadecimal number is assigned a
sixteenth power. One needs altogether 16 numbers, including the zero. For the
numbers 0 to 9 one uses the decimal system, and for the numbers 10 to 15 the
letters A, B, C, D, E and F are used.
Each digit within a hexadecimal number system is assigned a power of the number
16.
Demonstration of the number systems
Decimal Binary BCD Hexadecimal
*10¹ *10⁰ *2⁴ *2³ *2² *2¹ *2⁰ Tens Tetrad Ones Tetrad *16¹ *16⁰
=10 =1 =16 =8 =4 =2 =1 8 4 2 1 8 4 2 1 =16 =1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1
2 0 2 0 0 0 1 0 0 0 0 0 0 0 1 0 0 2
3 0 3 0 0 0 1 1 0 0 0 0 0 0 1 1 0 3
4 0 4 0 0 1 0 0 0 0 0 0 0 1 0 0 0 4
5 0 5 0 0 1 0 1 0 0 0 0 0 1 0 1 0 5
6 0 6 0 0 1 1 0 0 0 0 0 0 1 1 0 0 6
7 0 7 0 0 1 1 1 0 0 0 0 0 1 1 1 0 7
8 0 8 0 1 0 0 0 0 0 0 0 1 0 0 0 0 8
9 0 9 0 1 0 0 1 0 0 0 0 1 0 0 1 0 9
10 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 A
11 1 1 0 1 0 1 1 0 0 0 1 0 0 0 1 0 B
12 1 2 0 1 1 0 0 0 0 0 1 0 0 1 0 0 C
13 1 3 0 1 1 0 1 0 0 0 1 0 0 1 1 0 D
14 1 4 0 1 1 1 0 0 0 0 1 0 1 0 0 0 E
15 1 5 0 1 1 1 1 0 0 0 1 0 1 0 1 0 F
16 1 6 1 0 0 0 0 0 0 0 1 0 1 1 0 1 0
17 1 7 1 0 0 0 1 0 0 0 1 0 1 1 1 1 1
18 1 8 1 0 0 1 0 0 0 0 1 1 0 0 0 1 2
19 1 9 1 0 0 1 1 0 0 0 1 1 0 0 1 1 3
Conversion rules
The transformations of the different number systems are based on simple rules.
These rules should be controlled by the PLC users, since they are often used in
handling this technology. For the use of a number system on which a given number
is based, an index sign is placed at the end of a number. Here “D“ stands for decimal,
“B“ for binary, and “H“ for hexadecimal. This marking is often necessary to identify a
number system because in each system, different values can be obtained when the
same number is used. (e.g.. “111“in the decimal system has the value
111D (one hundred eleven). In the binary system, it would be 111B ,which is the
decimal value 7 (1x20 + 1x 21 + 1x22). As a hexadecimal number, 111H would be the
decimal value 273 (1x160 + 1x161 + 1x 162).
Converting decimal binary
Integral decimal numbers are divided by the base 2 until the result of zero is
obtained. The remainder obtained with the division (0 or 1) results in a binary
number. One needs to also consider the direction that the “remainders“ are written
in. The remainder of the first division is the first right bit (low order width unit bit).
e.g. The decimal number 123 is to be changed into an appropriate dual number.
Converting decimal hexadecimal
This transformation is performed exactly like the decimal binary transformation.
The only difference is that instead of using base 2, we use base 16. Thus, the number
must be divided by 16 rather than by 2. e.g. The decimal number 123 is to be
changed into the appropriate hex number.
123/16= 7 reminder Allocate in the
7
11/16 = 0 reminder clockwise direction
11(B)
123 7 B
Pattern:
7 B
7x16¹ + Bx16⁰
112 +11 = 123
Converting binary hexadecimal
For the transformation of a dual number into a Hex number, one could first
determine the decimal value of the binary number (addition of the priorities). This
decimal number could then be changed into a hexadecimal number with the help of
the division:16. In addition, there is the possibility of determining the associated hex
value directly from the binary number. First, the binary number is divided from the
right beginning in the quadripartite groups. Every one of the determined
quadripartite groups results in a number of the hexadecimal number system.
If necessary, fill the missing bits on the left hand side with zeros e.g. the binary
number 1111011 is to be changed directly into a hex number.
1 1 1 1 0 1 1B
0 1 1 1 1 0 1 1
0x2³ + 1x2² + 1x2¹ + 1x2⁰ 1x2³ + 0x2² + 1x2¹ + 1x2⁰
7
B H
Terms from computer science
In connection with programmable controllers, terms such as BIT, BYTE and WORD
are frequently used in the explanation of data and/or data processing.
BIT
Bit is the abbreviation for binary digit. The BIT is the smallest binary (bivalent)
information unit, which can accept a signal status of “1“ or “0“.
BYTE
For a unit of 8 binary characters, the term BYTE is used. A byte has the size of 8 bits.
Signal State
0 1 0 1 1 0 0 1
WORD
A word is a sequence of binary characters, which is regarded as a unit in a specific
connection. The word length corresponds to the number from 16 binary characters.
With words, the following can be represented:
0 1 0 1 1 0 0 1 0 1 0 1 1 0 0 1
1 Byte 1 Byte
Signal State
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.
Further units are kilobit or kilobyte, which stand for 210, or 1024 bits, and the mega‐
bit or mega‐byte, which stands for 1024 kilo‐bits.
Bit Address
So that individual bits can be addressed within a byte, each individual bit is assigned
a bit location. In each byte the bit gets the bit location 7 on the leftmost side and the
bit location 0 on the rightmost side.
7 6 5 4 3 2 1 0 Bit address
0 1 0 1 1 0 0 1
Word Address
The numbering of words results in a word address.
PLC Hardware components
PLC Configuration
• Power Supply (Built in or external unit)
24 V DC
120 V AC
220 V AC
• CPU (Central Processing Unit)
A computer where ladder logic is stored and processed.
•
I/O (Input/output)
A number of input/ output terminals are provided allowing the PLC to
monitor the process and initiate actions.
• Indicator Lights
Indicate the status of the PLC (Power on, program running, faults).
Configuration of PLC refers to the packaging of the PLC, and we can classify it to:
• Rack‐type (can handle multiple cards).
• Module‐type (similar to racks, smaller size, modules instead of cards).
• Micro (compact, small).
Module
Rack
Compact
PLC Memories
• RAM (Random Access Memory)
This memory is fast , but it will lose its contents when power is lost , this is
known as volatile memory. Every PLC uses this memory for the central CPU when
running the PLC.
PLC Status
On the front of the PLC, there are normally limited status lights. Common lights
indicate ;
• Power on : this will be on whenever the PLC has a power.
• Program running : this will often indicate if a program is running, or if no
program is running.
• Fault : this will indicate when the PLC has experienced a major hardware or
software problem.
These lights are normally used for debugging. Limited buttons will also be provided
for the PLC hardware.
The EH150 of Hitachi (Module type)
CPU Module
Power module
Analog I/O module
1. Lock button when dismounting the module from a base unit, press this
button and lift up the module. The module can be fixed
firmly by a screw (M4, 10 mm (0.39 in.)).
2. I/O cover this is the cover attached to the terminal block area.
3. Terminal block this is the terminal block for connecting output signals. The
terminal block can be connected or disconnected.
1. Connector for power module. This is the connector for loading the power
module.
2. Connector for CPU module. This is the connector for loading the CPU module.
When the unit is used as an expansion base, this becomes the connector for
loading the I/O controller.
3. Connector for I/O module. This is the connector for loading the I/O module.
Type Number of I/O modules to be mounted
a. EH‐BS3(A) 3
b. EH‐BS5(A) 5
c. EH‐BS8(A) 8
d. EH‐BS11(A) 11
4. Expansion cable connector. Connector for the expansion cable. EH‐CPU104
(A) is not support expansion unit.
5. Mounting holes (4 points). These are used when the base unit is attached to a
panel, etc. Use M4 ⋅ 20 mm (0.79 in.) screws.
6. Mounting hook for DIN rail. This is used when attaching the unit to a DIN rail.
7. Cover for expansion cable connector. This cover is used for protecting the
expansion cable connector when it is not used.
Expansion Cable
I/O controller
1. Lock button. When dismounting the module from a base unit, press this
button and lift up the module. The module can be fixed firmly by a screw
(M4, 10mm)
2. Connector for expansion cable. Connector for expansion cable.
3. Unit number switch Rotary switch for unit number. Be sure to set 1 to 4 for
expansion bases from CPU side.
Note: Other unit number than 1 to 4 may cause mal output because of undefined
address. Since CPU reads always the switch information, be sure to set after
power off.
Inputs/Outputs
The input/output channels provide signal conditioning and isolation functions so
that sensors and actuators can be directly connected to them.
• Common input voltages are 5V and 24V.
• Common outputs are 24 V and 240 V.
In smaller PLCs the inputs are normally built in and are specified when purchasing
the PLC. For larger PLCs the inputs are purchased as modules or cards. With 8 or 16
inputs of the same type on each cards or module.
As with input modules , the output modules rarely supply any power but instead act
as switches. External power supplies are connected to the output card and the card
will switch the power on or off for each output. Typical output voltages are listed
below:
120 Vac , 24Vdc , 12 – 48 Vac , 12 – 48 Vdc , 5 Vdc (TTL) , and 230 Vac .
Revview Queestions
Q : Can a PLC input switcch a relay ccoil to contrrol a Motorr?
A : No a PLC o output can sswitch a reelay.
Q : How do input and ou utput cards acts as an interface b between thee PLC and
exteernal devicces?
A : Input Card ds are conn nected to seensors to deetermine th he state of tthe system
m.
Outtput cards aare connectted to actuators that ccan drive th he process.
Q : What is the differencce between wiring a so ourcing andd sinking o
output?
A: SSourcing ou utputs supp ply currentt that will p
pass througgh an electrrical load to
o
ground. Sinkin ng inputs alllow curren nt allow to flow from the electriccal load to tthe
commmon.
Q : Is AC or DC C easier to interrupt?
A : AC is easieer, it has zerro‐crossingg.
Q : What can h happen if th oltage on a device is exceeded?
he rated vo
d to prematture failure.
A : It will lead
Open ActWin
You will get the following Window:
Open an existing project, the latest project (in this case “Maxi_306.apg” or a new
project.
Select ”Create new project” with the mouse.
Click on ”OK”
If a dialog appears prompting you to select target system:
Select Hitachi H‐series from the list of selectable target systems , Click OK
If it’s stand “DEMO” after the driver, part of the driver or the whole driver is in
DEMO mode.
You will now get the following screen with three main Windows:
1. Programming Window (Where you write the program, function blocks etc.)
2. Project Window (Complete hardware and software configuration of the project)
3. Symbol window (Where all symbols like Inputs, Outputs etc. can be edited)
It is divided into following groups:
1. File handling and printout.
2. Cut, paste, undo etc.
3. Zoom tools.
4. Ladder editing
5. Help buttons (Do not forget to use the help system)
6. On‐Line and communication
You can always get button information if you place the mouse on a button, e.g.
Ladder editing buttons:
1 2 3 4 5 6 7 8
1. Selection
2. Line draw
3. Contact symbol
4. Coil symbol
5. Arithmetic instruction(s)
6. Function box (e.g. Compare box)
7. Compare box
8. Rung Comment or Section comment
Hardware configuration:
Open the Hardware configuration to select the hardware to run the PLC program by
clicking in the tree on ”HW Configuration”
Select an existing symbol:
Instead of typing the entire symbol name, you can click in the list and select the
symbol you want.
Create a new symbol:
A new symbol does not have any match. If the suggested address is OK you can press
Enter to create the symbol.
Select an address type for the symbol:
If you want a special address, then click on the Memory address and select the type
you want. You can also type the address with the number directly in the Memory
address window.
To write a rung comment:
Press the button for comment. Click above the rung, where you want to write the
comment.
Click on the <Comment...> symbol. A window will open, where you can write the
comment.
To start a second rung:
Select the contact tool again. Drop a contact below the first block (or later between
any blocks) and continue editing.
You can alternatively drag and drop the symbols from the symbol tree.
You can create new symbols in a comfortable way through drag and drop in the
symbol window.
Next free address will be used and the symbol will get an index number. In this case
“Start1” with new address X111 will be created from “Start” with address X110.
The system library:
Open the system library, where you will find “Hitachi H‐series” Open this and you
will find three folders. One contains H‐specific Functions. The other two contain IEC‐
specific functions.
Depending on the mode we have selected under “Tools‐ActWin Settings
Programming” the folders are open or locked. In this case the only open folder is the
”PLC‐specific”.
To make a compare box or to insert a F or FB:
Select the Function tool. There is now a very quick way of selecting the functions.
You will get a list of available functions. Every function has an “alias”, which means a
short logical name. You can scroll down and select the right function.
You can find the right function by typing the beginning of the alias.
Click and keep the left mouse button down on the function and drag it
approximately to the place where you want to connect it.
You can also insert a function in the ladder diagram (the upper line is the logic
condition for the comparison) Drop the button and the function is connected. The
two lower lines are the values. To allocate the value lines, double click on the line
and define a value or a constant.
To create a User defined Function (F) or Function Block (FB):
A part of a program that will be repeated in the same program or in other programs
can be included in a Function or a Function Block.
The difference between Functions and Function Blocks is that a Function does not
keep any memory and it is therefore always possible to tell the result of a Function
calculation just by looking at it. E.g. an ADD_INT is a function.
A Function Block can keep a status from execution to execution. E.g. a CTU or a TON
are Function Blocks.
Repeat for the number of times you want to use the FB. All these Function Blocks
will work as separate instances, which mean that they will work independently from
each other.
User defined Function:
The difference, compared to creating a new FB, if you create a new function is that it
has automatically one EN (enable) input and one ENO (Enable Output) and besides
that only one Output.
User Library:
In the User Library you can store Programs, Functions, Function Blocks, Hardware
configurations, Monitor tables, Data memory areas, printer settings etc. that you can
reuse.
To copy between the tree and the User Library use normally Copy‐ Past.
In other cases, e.g. for Hardware Configurations, use Drag and Drop.
Define symbol area:
This is a useful function, which is available in the boxes where you define your
symbols. If you e.g. want an area of data memories DATA1 to DATA100 from WR100
– or as in this case 4 analog inputs in a row.
Type a”4” in
the”Area size”
field and press
OK.
Select WX type and ask for”Next free”. The next free word input is word 0 on slot 2.
Now we can use a practical feature to create an area of 4 analog inputs in a row.
”Analog_Input1…4”.
Now all 4 Analog input addresses are created automatically.
To make an arithmetic box:
Select e.g. ”d = s1 + s2” (binary plus) by typing the alias “+” Press Enter.
Press the left key and drop the box close to the contact.
When the symbols and constants are defined, press OK.
A window will pop up where all editing can be done.
Delete button will delete a line.
Add Button will insert a new line. You will get a list of all functions.
Move buttons will move a line up or down.
To edit the content of an arithmetic box:
Double click on the box (or Right click and select “Properties”). The edit box will
open and allow you to continue editing.
Insert rung comments:
Select the Comment tool. Press down the left mouse button and drop the comment.
Write the comment and press OK.
and the result will be:
To make an H PLC specific Timer delay.
Create a coil. Give the new symbol a name and select address type TD from the
address list. Press OK button.
To print out the project:
To make a proper printout, start to make footer and/or a header. (To be printed out
on every page) Open "Settings‐ Print Settings‐ Footer” in the tree.
Export the content of the symbol window:
Test the printout with a preview:
Paper Printout:
You can click on the symbol then you will get the complete printout. You can
also select "Print” in the File menu to get a more detailed printout Command.
If you select “Print
all” You will get a
selection list:
Communication settings:
Go to menu “Tools‐Driver settings "For RS232 communication you can select
Comm. port and baud rate. For TCP/IP programming you can enter IP Address and
port number.
For more information see manual For the Ethernet card (For example EH‐ETH)
Network address.
From menu Tools / Driver settings” Select the “Network address” folder.
To change settings:
Go to ”Tools‐ActWin Settings” We have started in the ”PLC specific” mode, which
only allowed us to write programs compatible to traditional programming. If you
want to continue in the IEC1131‐3 programming, select ”IEC1131‐3” or ”Mixed
mode” You can also find folders for Language, Display and Save. Under” Save” you
can order AutoSave, which is practical.
To Cut and Past /Move rungs and comments:
Left click with the symbol on the rung or the rung comment in order to mark
one or more rungs and comments. (To mark more rungs keep the <Ctrl> button
down.)
To search for addresses:
Try the Find <Ctrl+F3> and Replace <Shift+Ctrl+F3> to find
and replace symbols in the program. A nice way to get a quick overview of the
existence of addresses in the program and to go to the relevant place is to Right click
on a symbol.
We therefore have to change the addresses in the program.
To move addresses
Click on the Move symbol in the symbol Window.
A “Move address” window will pop up. Define first and last address in every group
to be moved and the first destination address.
OnLine Programming:
Communication / Transfer:
Following buttons are available:
1 2 3 4 5 6 7
1. RUN (Start the PLC)
2. Stop
3. Monitor.
4. Transfer the program to the PLC
5. Upload the program from the PLC
6. Go On‐Line (First Compares PLC‐PC)
7. Update program.
Monitor Windows:
Many times you need to see monitor information from different parts of the
program, which can not be shown just by a rungs on the screen. Then you can create
one or more I/O Monitor tables:
Right click on the ”Monitor” folder under Settings in the tree.
Click on "New monitor I/O table”. A window will pop up where you can give the
Monitor box a unique name.
Write e.g.”MONITOR1”. A symbol in the tree under Monitor will show the new
Monitor box. We have to define the content. Right click on the symbol and select
OnLine Change:
Continue to edit the program as you did in Off‐Line mode. Now the rung or rungs
that are changed and not updated in the PLC are marked. (It looks like the rung is
higher) The Update button will be active.
When you press the button the PLC program will be updated with all changes and
the markings will disappear. The Update button will be inactive again
Data memory tables:
To make a Data Memory table: Right click on Data memory in the tree.
Select "New Data Memory table”.
Export from Data Memory:
Make a Data Memory table covering the memory area:
Right click on the Data memory table and select FROM PLC. Select EDIT DATA
MEMORY Select Decimal Display mode.
Press Copy Grid
Export to e.g. Excel to take care of the data
Import to Data Memory:
Copy data from e.g. Excel. Select EDIT DATA MEMORY. Select Decimal mode Mark
the first cell to give data into. Press <Ctrl+V> This operation can take a long time if
the table has got many values. In such case select smaller tables.
dder Logic Outputs
Lad
Pro
ogrammiing Conceepts
• Boolean logic design.
• Karnauugh maps.
• Ladderr logic.
• SFD (Seequence Flow Diagram
m).
• Flowchharts.
• Cases sstudy.
Lad
dder Logiic from fllowchartts
Blocks of Ladder logic code.
Normal Ladd
der logic.
Seq
quence bits
ogramming
Pro g Example
es
A G
Golden Pro
ogramming Rule
A= (A + A [1])). A [0]
Ou
utput OR And Exit con
ndition
Latch
Entrance condition
c
App
plication o
of the Rule
e
Th
he On Dom
minant Ru
ule
App
plication o
of the Rule
e
Casse Study 1
1: Tank Fiilling Conttrol using
g Set/Rese
et
Tan
nk Filling C
Control
Fallling Edge
Exa
ample: A Siingle Turn
n Motor Ap
pplication
other Solu
Ano ution
Case Study: Control o
of Convey
yor Belt
Desscription
Th
he system is made up
u of a motor‐driven n belt, carrrying som
me pallets from a
pallletize to a w
warehouse. Three sen
nsor are alsso present, respectively Start, Staack and
Stopp.
Ope
eration
Th
he present
t of a pallet at the beeginning off the belt is
i belt deteected by seensor 1
whiich enabless motor M, starting the
t convey yor belt. Th he belt‐flow
ws until thee pallet
I/O
O Assignm
ment
Flo
ow Chart
The
e OnDela
ay Time
Exaample: Saffe Startingg Operation n
W
Write a PLC
C code to ennsure that the operattor wants tto start a m
motor by p
pressing
two der to start the motor.
o PBs simulltaneously for one seccond in ord
Casse Study : D Detergent Filling Lin ne
Desscription:
Th
he in feed co onveyor caarries deterrgent boxess to be filled and then n carries it aaway to
be pprocessed in anotherr stage .A p photocell iss located un nder hoppeer to stop tthe box
readdy to be fiilled .A hop
pper contaain the dettergent is located at tthe middlee of the
connveyor wheere a valve controls its drain A leevel switch h is located
d at hopperr button
to indicate
i falll of level .An operatting panel contains a a start and
d stop butttons for
man nual operaation and alarm
a lamp
p for warning. The paanel also coontains auttomatic
andd manual bu uttons for m mode selecction.
N.B. A bake is used to sto op the convveyor from coasting.
Scenario of op perations:
The conveyo
1. T or starts m motion by prressing start push buttton located d at the pannel .
2. T
The convey yor carries the boxes of detergen nt & contin nues motio on until onee of the
boxxes is deteccted by the photocell (located under the hopper) theen it is stop pped by
the brake.
3. T
The valve o opens the h hopper gatee to dispen nse the calcculated am mount of deetergent
(nearly for fivee seconds).
Afteer the gate of hopper is closed, tthe convey yor starts mmoving agaiin and the cycle is
repeated
Mo
onoStablle Timer
Circcuit opera ation:
Output R1 is on at thee same time the leading edge off input x1 ((from off to
O o on) is
deteected. The leading ed dge of inpu ut x1 is dissregarded while
w MS12 2 is on. Wh
hen the
currrent time vvalue is more than thee set time v value, MS12 2 is off.
How wever, if in
nput x1 is off at the first
f scan aand on at the
t second d scan, thenn MS12
deteects the leaading edge..
Ope eration
Th d by trafficc A and B. The green signal on traffic‐ ligh
he traffic iss regulated hts A is
alwways associaated to red d on traffic‐ lights B. A After a fixeed time t, o
on traffic‐ llights A
the yellow signal must sttart up, folllowed then n by the red d and green n signal on n traffic‐
lighhts B.
Tra
affic Light C
Control
Starr Delta sw
witch
Up Counter
Up Counter Tiime Chart
Up/Down Counter
Up / Down Counter Time Chart:
Current Value Remains the Same Disregarded