Date post: | 30-Dec-2015 |
Category: |
Documents |
Upload: | mohamedamri100 |
View: | 35 times |
Download: | 0 times |
Co
Dr
B U IH T T P
Copy
ourse:
. Ashraf E
L D I N G #P : / / W W W
yright © Conisys
PLC Pro
lnaggar
# 2 0 4 2 ‐ EW . C O N I S
s 2008
ogramm
E L M E R AY S ‐ S H A K
ming Co
A G ‐ C A IE R . C O M /
[P a g e |
oncept
R O ‐ R I N/ T E L : ( 2
1]
s
G R O A D2 0 2 ) 2 9 7
‐ E L M A A7 0 5 9 6 2
[Dr. Ashraf
[2
A D I F A X : ( 2 0
f Elnaggar]
008]
0 2 ) 2 5 2 0
0 4 5 1 8
Copyright © Conisys 2008 [P a g e | 2] [Dr. Ashraf Elnaggar]
CONISYS S.A.E. Control & Instrumentations System Technology
Member of SHAKER Consultancy Group
Plc Training Course
Copyright © Conisys 2008 [P a g e | 3] [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
Copyright © Conisys 2008 [P a g e | 4] [Dr. Ashraf Elnaggar]
Base unit ................................................................................................................................ 23
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
Copyright © Conisys 2008 [P a g e | 5] [Dr. Ashraf Elnaggar]
To Cut and Past /Move rungs and comments: ...................................................................... 67
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
Copyright © Conisys 2008 [P a g e | 6] [Dr. Ashraf Elnaggar]
Section 6:Timers and Counters ..................................................................................................... 86
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
Copyright © Conisys 2008 [P a g e | 7] [Dr. Ashraf Elnaggar]
Course: PLC Programming Concepts By Dr. Ashraf Elnaggar
Copyright © Conisys 2008 [P a g e | 8] [Dr. Ashraf Elnaggar]
Section 1: Introduction The controller has the task of leading single operations of a machine or a machine plant that depend on sensor signals after a given function execution. Types of signals in control system technology The electrical signals, which are applied at the inputs and outputs, can be in principle, divided into two different groups:
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.
Copyright © Conisys 2008 [P a g e | 9] [Dr. Ashraf Elnaggar]
The summarization of n‐equivalent binary digits allows the representation of 2n different combinations. One can show four different types of information with e.g. two equivalent binary digits 2x2: 0 0 Configuration 1 (e.g. 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 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.
Copyright © Conisys 2008 [P a g e | 10] [Dr. Ashraf Elnaggar]
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.
Copyright © Conisys 2008 [P a g e | 11] [Dr. Ashraf Elnaggar]
The values of a dual number are assigned the power‐of‐two numbers, as represented below. Each number assigned within the binary number system is a power‐of‐two.
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.
Copyright © Conisys 2008 [P a g e | 12] [Dr. Ashraf Elnaggar]
Demonstration of the number systems
Decimal Binary BCD Hexadecimal
*10¹ =10
*10⁰ =1
*2⁴ =16
*2³ =8
*2² =4
*2¹ =2
*2⁰ =1
Tens Tetrad Ones Tetrad *16¹ =16
*16⁰ =1 8 4 2 1 8 4 2 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 01 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 12 0 2 0 0 0 1 0 0 0 0 0 0 0 1 0 0 23 0 3 0 0 0 1 1 0 0 0 0 0 0 1 1 0 34 0 4 0 0 1 0 0 0 0 0 0 0 1 0 0 0 45 0 5 0 0 1 0 1 0 0 0 0 0 1 0 1 0 56 0 6 0 0 1 1 0 0 0 0 0 0 1 1 0 0 67 0 7 0 0 1 1 1 0 0 0 0 0 1 1 1 0 78 0 8 0 1 0 0 0 0 0 0 0 1 0 0 0 0 89 0 9 0 1 0 0 1 0 0 0 0 1 0 0 1 0 910 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 A11 1 1 0 1 0 1 1 0 0 0 1 0 0 0 1 0 B12 1 2 0 1 1 0 0 0 0 0 1 0 0 1 0 0 C13 1 3 0 1 1 0 1 0 0 0 1 0 0 1 1 0 D14 1 4 0 1 1 1 0 0 0 0 1 0 1 0 0 0 E15 1 5 0 1 1 1 1 0 0 0 1 0 1 0 1 0 F16 1 6 1 0 0 0 0 0 0 0 1 0 1 1 0 1 017 1 7 1 0 0 0 1 0 0 0 1 0 1 1 1 1 118 1 8 1 0 0 1 0 0 0 0 1 1 0 0 0 1 219 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.
Copyright © Conisys 2008 [P a g e | 13] [Dr. Ashraf Elnaggar]
123/2 = 61 reminder 61/2 = 30 reminder 30/2 = 15 reminder 15/2 = 7 reminder 7/2 = 3 reminder 3/2 = 1 reminder 1/2 = 0 reminder 123 Pattern: 1 1 1 1 0 1 1 1x2⁶ + 1x2⁵ + 1x2⁴ + 1x2³ + 0x2² + 1x2¹ + 1x2⁰ 64 + 32 + 16 + 8 + 0 + 2 + 1 = 123
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 11/16 = 0 reminder 123 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
0x2³ + 1x2² + 1x2¹ + 1x2⁰ 1x2³ + 0x2² + 1x2¹ + 1x2⁰ H
1 10 1 1 1 1
1 1 1 1 0 1 1
7 11(B)
7 B
0 1 1 1 1 0 1 1
7 B
Allocate in the clockwise direction
Allocate in the clockwise direction
Copyright © Conisys 2008 [P a g e | 14] [Dr. Ashraf Elnaggar]
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
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:
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.
Bit address
Word Address The numbering of words results in a word address.
0 1 0 1 1 0 0 1
0 1 0 1 1 0 0 1 0 1 0 1 1 0 0 1
7 6 5 4 3 2 1 0 0 1 0 1 1 0 0 1
Copyright © Conisys 2008 [P a g e | 15] [Dr. Ashraf Elnaggar]
Note: The word address is always the smallest address of the two pertinent bytes when using words, e.g. input word(IW),output word(QW), bit memory word(MW), etc. (e.g. With a word that comes from IB2 and IB3, the address is IW2).
Word address
Note: During Word Processing, it is to be noted that e.g. the input word 0 and the input word 1 are in a byte overlap. In addition, when counting bits, one begins at the rightmost bit. For example the bit0 from IW1 is the bit of I2.0, bit1 is I2.1... bit7 is I 2.7, bit8 is I1.0...bit15 is I1.7. A jump exists between the bits 7 and 8. DoubleWord Address The numbering of double words results in a double‐word address. Note: When using double words e.g. ID, QD,MD etc. the double word address is the smaller word address of the two pertinent words.
Double word address
IW0 IW2 IB0 IB1 IB2 IB3 IW1
ID0 IW0 IW2
IB0 IB1 IB2 IB3 IW1
Copyright © Conisys 2008 [P a g e | 16] [Dr. Ashraf Elnaggar]
Section 2: PLC Hardware
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).
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.
Rack
Module
Compact
Copyright © Conisys 2008 [P a g e | 17] [Dr. Ashraf Elnaggar]
• Rom (Read Only Memory) This memory is permanent and cannot be erased. It is often used for storing
the operating system for the PLC. • EPROM ( Erasable Programmable Read Only Memory) This is memory that can be programmed to behave like ROM , but it can be erased with ultraviolet light and reprogrammed. • EEPROM (Electronically Erasable Programmable Read Only Memory) This memory can Store programs like ROM. It can be programmed and erased using a voltage , so it is becoming more popular than EPROM's.
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)
Copyright © Conisys 2008 [P a g e | 18] [Dr. Ashraf Elnaggar]
It contains : NO Device Name Description of function 1 Power Module Converts power supply to the power to be used within
the EH‐150 2 CPU Module Performs operations based on the contents of the user
program, receives input and control outputs
3 I/O Module Digital input module, Digital output module, analog input module, etc.
4 Basic Base Base in which the power module, CPU module I/O module etc. are loaded
5 Expansion base Base in which the power module, I/O controller, I/O module, etc. are loaded
6 Expansion cable Cable that connects the I/O controllers for the basic base and expansion base
7 I/O Controller Interface with expansion base and CPU module
CPU Module
Copyright © Conisys 2008 [P a g e | 19] [Dr. Ashraf Elnaggar]
Power module
No. Name Function
Copyright © Conisys 2008 [P a g e | 20] [Dr. Ashraf Elnaggar]
Input module
1. LED cover this is the cover for the LED that displays the input status. When the input signal turns on, the LED for the relevant number lights up. The LED only lights when the module is energized.
2. 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.)).
3. I/O cover this is the cover attached to the terminal block area 4. Terminal block this is the terminal block for connecting input signals. The
terminal block is removable.
Copyright © Conisys 2008 [P a g e | 21] [Dr. Ashraf Elnaggar]
Output module
1. LED cover this is the cover for the LED that displays the input status. When the input signal turns on, the LED for the relevant number lights up. the LED only lights when the module is energized.
2. 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.)).
3. I/O cover this is the cover attached to the terminal block area 4. Terminal block this is the terminal block for connecting input signals. The
terminal block is removable.
Copyright © Conisys 2008 [P a g e | 22] [Dr. Ashraf Elnaggar]
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.
Copyright © Conisys 2008 [P a g e | 23] [Dr. Ashraf Elnaggar]
Base unit
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
Copyright © Conisys 2008 [P a g e | 24] [Dr. Ashraf Elnaggar]
1. Connector for the base unit * Connect to the connector of the basic base unit. 2. Connector for the I/O controller Note: The connectors are represented as the base unit side and I/O controller side for presentation purposes, but either one can be connected to either side.
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 .
Copy
Exa
Sel
•
•
• •
Rev Q : A : Q : exte A : Out Q : A: Sgrocom Q : A : Q : A :
yright © Conisys
ample
lection of
What I/O cneeds? What typesignal condWhat size oWhat speebe handled
view QueCan a PLC No a PLC o
How do inernal devicInput Cardtput cards a
What is thSourcing ouund. Sinkinmmon.
Is AC or DCAC is easie
What can hIt will lead
s 2008
f a PLC
capacity is
s of I/Os arditioning? of memoryd and powd the faster
estions input switcoutput can s
put and ouces? ds are connare connect
e differencutputs suppng inputs al
C easier to er, it has zer
happen if thd to premat
required, N
re required
y is requirewer is requirr the CPU re
ch a relay cswitch a re
utput cards
nected to seted to actu
ce between ply currentllow curren
interrupt?ro‐crossing
he rated voture failure
[P a g e |
No of I/Os,
d, I.e. isolati
d? red of the Cequired.
coil to contrelay.
acts as an
ensors to deators that c
wiring a sot that will pnt allow to
g.
oltage on a .
25]
capability o
ion on boar
CPU? The g
rol a Motor
interface b
etermine thcan drive th
ourcing andpass througflow from
device is e
of expansio
rd power s
reater the
r?
between the
he state of the process
d sinking ogh an electrthe electric
xceeded?
[Dr. Ashraf
on for futur
upply for I/
number of
e PLC and
the system.
output? rical load tocal load to t
f Elnaggar]
re
/Os,
I/Os to
m.
o the
Copyright © Conisys 2008 [P a g e | 26] [Dr. Ashraf Elnaggar]
Q : What are the benefits of input/output modules? A : By using separate modules, a PLC can be customized for different applications. If a single module fails, it can be replaced quickly, without having to replace the entire controller. Q : What will happen if a DC output is switched by an AC output? A : AC input conditioning circuits will rectify an AC input to a DC waveform with a ripple. This will be smoothed, and reduced to a reasonable voltage level to drive an optocoupler.
Copyright © Conisys 2008 [P a g e | 27] [Dr. Ashraf Elnaggar]
Section 3 : Programming Software
ActWin Ladder (LD) programming:
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.
Copyright © Conisys 2008 [P a g e | 28] [Dr. Ashraf Elnaggar]
A new window appears where you can select what PLC language you want to use: LD (Ladder) SFC (Sequential Flow Chart) FBD (Functional Block diagram) IL (Instruction List) In PLC specific mode only LD is available. In Mixed mode LD and SFC are available. All are available in IEC1131‐3 mode. Select PLC Specific Mode and LD, press OK
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)
Copyright © Conisys 2008 [P a g e | 29] [Dr. Ashraf Elnaggar]
The upper toolbar will look like this:
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”
Copyright © Conisys 2008 [P a g e | 30] [Dr. Ashraf Elnaggar]
This will open six new items. They all symbolize the racks in the configuration. The first is the one containing the CPU. The other ones are the expansion racks. Start to click with the right mouse button on the first rack. Select the “Add Module” alternative. You will now get a list of all racks available. Select a suitable rack from the list, e.g. a BSM‐4 rack. The item will change name to”BSM‐4” and a + will appear to show that we can fill this rack with modules. Click on the rack item and open it. In this case 5 new folders will appear. They are representing the modules in the rack. Click with the right mouse button on the first module. Select the “Add Module” alternative. A list of all available modules for that position will show up. The list for the first module will contain all available power supplies. The list for the second module will contain all available CPU modules.
Copyright © Conisys 2008 [P a g e | 31] [Dr. Ashraf Elnaggar]
When the rack configuration is ready the configuration is shown like this. Allocate Known symbols (e.g. Inputs and Outputs): Right click on the CPU and select “Symbols/Addresses”. You can type the symbol names on each address type in the CPU. (Some characters, e.g. Space are not allowed due the compatibility to the IEC standard, see help system).
The list for the rest of the positions will contain all Input/output modules and all Special modules.
To enter the symbols in the I/O modules. You can import symbols from a CAD system or e.g. Word or Excel with Copy/Paste to the Name Column.
Mark the first cell and press <Ctrl + V> use these buttons to go from one module to the next.
Copyright © Conisys 2008 [P a g e | 32] [Dr. Ashraf Elnaggar]
Start to create a Ladder program:
Select the contact symbol with the mouse or press the F10 button. Create a contact: Move the mouse approximately to the place where you want the contact. Click and keep the left button of the mouse down until you see the symbol below and drop the contact. Keyboard editing: Move the cursor with the arrow buttons and press Enter or (Shift+Enter). The symbol /address handling is probably the most important part in a PLC programming software. The reason for this is that a significant part of the programming time is spent here. Most programming errors are connected to usage of wrong addresses or double usage of addresses. ActWin gives a maximum comfort, guideline and control in the address allocation. In order to give an easy way to define or search for an address and the symbol name the following window will pop up automatically:
Copyright © Conisys 2008 [P a g e | 33] [Dr. Ashraf Elnaggar]
Type the name of the symbol:
When the symbol name does not exist you will always get a suggestion of the first free address. This makes allocation of new symbols very fast and you will avoid double use of addresses.
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.
When you type the symbol, all matching symbols will be shown.
Here you can change to an inverted contact or edge detection.
Copyright © Conisys 2008 [P a g e | 34] [Dr. Ashraf Elnaggar]
Select the address number:
The first available address of the type you suggested will be suggested. Accept or type the number you want and press Enter for OK. You can also press the “Next Free” button to get the next available address. Using addresses directly: Even though it is not recommended it can in some cases be comfortable to use the address directly. Just type the address. The symbol on that address will be used or if there is no symbol a new temporary symbol “__Y200” will be created. (All addresses have to have a symbol). The button “Create Symbol Area” allows you to define any number of symbols in a one operation. (see “arithmetic box” description for more details.) Make a serial connection: Repeat the procedure with the contact and drop the new contact close to the right side of the first one. As you can see, the editing field of the rung is marked (shown as deeper). This means that the rung is not ready and approved by ActWin. When it is completed the marking will disappear. Give the new contact a symbol name and an address:
Copyright © Conisys 2008 [P a g e | 35] [Dr. Ashraf Elnaggar]
The new symbols will appear in the symbol window. This window will also inform about type, (start value) PLC address and the corresponding IEC1131 address (used if IEC1131‐ programming is selected). Ladder editing without symbols: In order to make some different ladder editing without the symbol procedure for each contact, we can turn the symbol editing off. (You can also fetch this window, the Contact Properties, by right‐clicking on a contact).
Make a new contact in series. But instead of giving a symbol name, disable “Automatic pop up” and press OK.
Copyright © Conisys 2008 [P a g e | 36] [Dr. Ashraf Elnaggar]
The contact will be drawn without symbol and address To make an inverted contact, Press the Shift key before you hold the left button on the mouse down. (This can also be changed in the Contact Properties Window). Note that the width of the ladder diagram is flexible. (The right power line moves rightwards). To make a parallel connection: Place the mouse arrow on the horizontal line where the parallel connections shall start. Press the left button and drag the mouse down Continue to drag the mouse around the contacts you want to connect in parallel. When you reach the horizontal line again, and then release the left button. The connection is completed.
Copyright © Conisys 2008 [P a g e | 37] [Dr. Ashraf Elnaggar]
To insert a parallel connection:
Make the same procedure as above inside the other connection. When you drop the mouse button, then the circuit will be redrawn in a proper way. To connect a contact in series: Place the mouse arrow on the line where you want the contact. Press the left button and drop the contact. To insert a contact in series: Place the mouse arrow on the line between the contacts where you want the contact. Press the left button and drop the contact.
Copyright © Conisys 2008 [P a g e | 38] [Dr. Ashraf Elnaggar]
To draw a vertical line: Press the line draw tool on the toolbar. Place the mouse on the line where you want you to start. Press the left mouse button and drag to the line where you want to end. Release the button and the line will be completed. To select one or more contacts: Press the selection tool on the toolbar. Move the mouse to the start point (upper left corner of the group of contacts). Hold the left mouse button down and drag to the bottom right corner. Release the button. The contacts will be selected.
Copyright © Conisys 2008 [P a g e | 39] [Dr. Ashraf Elnaggar]
To Delete contacts:
Press Delete and the rung will be redrawn without the deleted contacts. Undo: Let us regret the deletion of the contacts. Go to “Edit‐menu” and press Undo (or press <Ctrl+Z>). The previous rung will now appear again. Create a coil: Select the coil symbol with the mouse. Use the same procedure as when the coil was created.
Copyright © Conisys 2008 [P a g e | 40] [Dr. Ashraf Elnaggar]
Create a parallel coil: Use the same procedure as when you made parallel connections of contacts. But drop the mouse on the right vertical line. Give or change a symbol to (allocate) contacts and coils: Go to the contact or coil you want to allocate. Double Click (or click with the right mouse button and select “Properties”). The Symbol selection and search window will appear. Type the new symbol name. (You are not limited to any length of the symbol. Just use a significant, but not too long symbol names out of practical reason. Note that blanks are not allowed.)
Copyright © Conisys 2008 [P a g e | 41] [Dr. Ashraf Elnaggar]
If you have not decided the address number from the beginning, press ”Next free” and the software will suggest the first free unused output address. Press OK and the coil is allocated. Continue with the same procedure or select already existing symbols from the list. Note that before the rung was completed it was shown on a “lower level” When the rung is completed and approved by ActWin the marking disappears.
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.
Copyright © Conisys 2008 [P a g e | 42] [Dr. Ashraf Elnaggar]
Press OK and the comment will be inserted in the ladder diagram.
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.
Copyright © Conisys 2008 [P a g e | 43] [Dr. Ashraf Elnaggar]
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.
Copyright © Conisys 2008 [P a g e | 44] [Dr. Ashraf Elnaggar]
Or the beginning of the function name. There is an also a more detailed description of the functions.
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.
Copyright © Conisys 2008 [P a g e | 45] [Dr. Ashraf Elnaggar]
It is possible to create user defined Functions and FBs. Create a Function Block: Right click on the Project Folder and select New Function Block... (also possible from the Insert‐menu.) Give a name to the FB. The new Function Block appears in the tree. Double click on the new FB and a new window will appear where you can start to define the FB. In the application we are producing we use a calculation for water Flow several times. The in parameters are different pulse counters. Build the content of the FB exactly like you build a program. You can also take a part from an existing program simply by Copy and Paste from the program to the FB. There are no physical addresses in the FB. But you have to define if they are Input addresses, Output addresses or if they are only to be represented Locally in the FB.
Copyright © Conisys 2008 [P a g e | 46] [Dr. Ashraf Elnaggar]
Go to the Symbol Window that has been automatically created for the FB. Double click on the L. “L” stands for Local and all symbols will be Local by default.
Copyright © Conisys 2008 [P a g e | 47] [Dr. Ashraf Elnaggar]
The property window for the symbol appears. In this case we only need one Input and one Output symbol. The others can stay Local. Go back to the Main program through clicking on the Main folder at the top of the project tree. The new Function Block is now present in the tree. This means that you can use this block one or several times in the program.
You can now select if you want to change to an Input or Output symbol
Repeat for the other symbols. You can also use these buttons to go quickly between the symbols.
Copyright © Conisys 2008 [P a g e | 48] [Dr. Ashraf Elnaggar]
Drag the FB from the tree and drop it in the program Connect an input and an output to the FB.
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.
Copyright © Conisys 2008 [P a g e | 49] [Dr. Ashraf Elnaggar]
You can build up any number of Functions and Function blocks to be used one or several times in your program.
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.
The name of the Output is identical to the Function name. (In this case “New function”).
Copyright © Conisys 2008 [P a g e | 50] [Dr. Ashraf Elnaggar]
Included User Library files:
In ActWin some User library files are included. In the ENG library some example projects are included. For example the “Pulse train” for Micro‐EH series. To use this example project do following: Right click on the “Program main” under “Pulsetrain”. Mark the program window and select menu “Edit/Paste”. Drag and drop the “Pulsetrain” monitor table to “Monitor”. The ActWin window will look as follows:
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.
Copyright © Conisys 2008 [P a g e | 51] [Dr. Ashraf Elnaggar]
If we want to compare an analog input with a constant”1234” then we have to create the symbol ”Analog Input” Double click on the * in the symbol window. The Search/Enter window appears. Type the symbol name, select type (WORD).
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.
Type a”4” in the”Area size” field and press OK.
Copyright © Conisys 2008 [P a g e | 52] [Dr. Ashraf Elnaggar]
Drag the symbol with the mouse from the symbol list. close to the connection line of the box. To write the constant, Double‐click or right click on the connection line and select “Properties”. A box will appear where you can type the constant value. You can also define a variable by using the binocular. Connect the logic output of the box with contacts and coils. The result will be:
To make an arithmetic box:
Copyright © Conisys 2008 [P a g e | 53] [Dr. Ashraf Elnaggar]
Start a new rung. Select the arithmetic box tool. There is now a very quick way of selecting the instructions. You will get a list of available instructions. Every instruction has an “alias”, which means a short logical name. They are sorted in a priority order, which means that the most common instruction “d = s” is on the top. (for d = s, just press Enter). You can scroll down and select the right function with Enter or click with the mouse.
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.
Copyright © Conisys 2008 [P a g e | 54] [Dr. Ashraf Elnaggar]
You can alternatively drag the instruction from the tree close to where you want to connect the box. When you drop the box it will connect and following window will pop up. Here you can define the symbols that are used in the instruction. The symbol type selectable. WORD is default here. Search or define the symbol like in the contact/coil dialog. Press <Tab> to enter the symbol and move to the next argument.
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.
Copyright © Conisys 2008 [P a g e | 55] [Dr. Ashraf Elnaggar]
Edit button will allow you to change an existing line. Add another instruction and press the OK button and the box is completed.
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.
Copyright © Conisys 2008 [P a g e | 56] [Dr. Ashraf Elnaggar]
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.
Copyright © Conisys 2008 [P a g e | 57] [Dr. Ashraf Elnaggar]
In the Timer properties window enter Timer Preset time and select Time base. Press OK button.
Copyright © Conisys 2008 [P a g e | 58] [Dr. Ashraf Elnaggar]
Create a contact in a new block. Contact properties window. Create a coil with for example address Y100.
Copyright © Conisys 2008 [P a g e | 59] [Dr. Ashraf Elnaggar]
If “Input_1” is true, “Output1” will be true after 10 seconds. To change the Timer preset value. Right click on the Timer coil and Select “Properties”. Click on the Timer/counter folder. Change the preset value or time base and press button OK. To create an H PLC specific Counter up Create a coil Give the new symbol a name and select address type CU from the address list.
Copyright © Conisys 2008 [P a g e | 60] [Dr. Ashraf Elnaggar]
In the Counter properties window enter Counter Preset value. Create a contact in a new block. Select the "Counter” symbol in the contact properties window.
Copyright © Conisys 2008 [P a g e | 61] [Dr. Ashraf Elnaggar]
Create a coil with for example address Y101. Clear current value in a Counter. Create a contact in a new block. Give the symbol a name and an address.
Copyright © Conisys 2008 [P a g e | 62] [Dr. Ashraf Elnaggar]
Create a coil and select the “Counter.CL” symbol in the coil properties window. Every time “Input_1” goes high, the counter current value will increase with one. When “Clear counter” is high the Counter current value will be set to zero. To change the Counter preset value: Right click on the Counter coil and Select “Properties". Click on the Timer/counter folder. Change the preset value and press button OK.
Copyright © Conisys 2008 [P a g e | 63] [Dr. Ashraf Elnaggar]
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:
Copyright © Conisys 2008 [P a g e | 64] [Dr. Ashraf Elnaggar]
A page looking like the final Paper print out will be shown on the screen. 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:
Copyright © Conisys 2008 [P a g e | 65] [Dr. Ashraf Elnaggar]
Select what printout you want and press Print. You can select to print out a part of a program. Mark it and then select the program in “Print all”.
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.
Copyright © Conisys 2008 [P a g e | 66] [Dr. Ashraf Elnaggar]
LUMP address: With this you can program/monitor different CPU´s in a LINK system. If you not using LINK connection, the value should be: FF, FF, 00, 00. Link: Link module number. Unit: Sub station number. Station numbers: For multi‐drop use. Enter station number on unit you should access.
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.
Copyright © Conisys 2008 [P a g e | 67] [Dr. Ashraf Elnaggar]
Under Display you can select a higher contrast display of the ladder diagram instead of the modern relief type. This is practical on some computer screens. You can also edit the font's sizes etc. in all screens. If you select High contrast the screen will look like this:
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.)
Copyright © Conisys 2008 [P a g e | 68] [Dr. Ashraf Elnaggar]
Now you can drag the rung or comment with the mouse to another place in the ladder diagram and drop it. Start from the left of the left power line. You can delete the rung by pressing <Delete>or you can Cut/Copy/Paste with the commands in the Edit menu rungs and comments or the buttons
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.
Copyright © Conisys 2008 [P a g e | 69] [Dr. Ashraf Elnaggar]
A list will appear informing about the rung numbers and e.g. if it is present as a contact or coil, if it is open or closed etc. Click on the rung number you want to go to and you will move to that place in the program. Let us change the rack configuration. We therefore have to change the addresses in the program. 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.
Copyright © Conisys 2008 [P a g e | 70] [Dr. Ashraf Elnaggar]
Press the Move button and symbols will change. Continue until all address are moved. All I/O addresses in the list and in the ladder program will change.
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.
Copyright © Conisys 2008 [P a g e | 71] [Dr. Ashraf Elnaggar]
You can also use the Communication‐menu commands Transfer the project to the PLC: Press the On‐Line button when On‐Line is OK the button will change to Click on the Monitor button . Now you can see the monitor status in the ladder diagram
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
Copyright © Conisys 2008 [P a g e | 72] [Dr. Ashraf Elnaggar]
"New Monitor Symbol”. The Symbol selection and search window will pop up. Select the symbols in the box one after the other. You can now see the symbols in the tree and if monitor is on then you can see the status. You can select the symbols in the monitor table in two ways: Click on the S button. The Symbol selection and search window will pop up. or just drag the symbols from the Symbol window. You can place the monitor window anywhere on the screen and decide the size. You can define several Monitor Windows for different purposes and display them together on the screen. You can catch the Monitor table and the current values if you press the Copy button. This can e.g. be copied in to Excel.
Copyright © Conisys 2008 [P a g e | 73] [Dr. Ashraf Elnaggar]
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”.
Copyright © Conisys 2008 [P a g e | 74] [Dr. Ashraf Elnaggar]
Give a significant name to the table Define the first and the last address in the table. The new table will now be present in the tree. Right click on the table to do one of the following:
• Edit the uploaded memory content • Upload from the PLC • Download to the PLC • Verify that the content in the table and the PLC are equal.
Copyright © Conisys 2008 [P a g e | 75] [Dr. Ashraf Elnaggar]
Select From PLC and Edit data memory. You can now modify the content and download to the PLC.
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.
Copy
Se
Con
ConConLogcar LineSeq A si
yright © Conisys
ction 4:
ntrol Bra
ntrol schemntentious: tgical: the vais on or offear: can bequential: a l
imple rela
s 2008
Progra
anches
mes the values talues to bef). e described ogical cont
ay controll
mming
to be controe controlled
as a simpletroller that
er
[P a g e |
Concep
olled changd are easily
e differentiwill keep t
76]
pts
ge smoothly described
ial equationtrack of tim
y (the speed as on‐off
n. me and prev
[Dr. Ashraf
ed of the ca(the moto
vious event
f Elnaggar]
ar) . r of the
ts.
Copy
A P
Lad
Lad
yright © Conisys
LC with re
dder Progr
dder
s 2008
elays
ram
[P a g e | 77] [Dr. Ashraff Elnaggar]
Copy
Lad
Lad
Pro
yright © Conisys
dder logic i
dder Logic
ogrammi
• Boolea• Karnau• Ladder• SFD (Se• Flowch• Cases s
s 2008
inputs
Outputs
ing Conce
n logic desugh maps. r logic. equence Flharts. study.
epts
ign.
ow Diagram
[P a g e |
m).
78] [Dr. Ashraff Elnaggar]
Copy
Flo
De Co Fl Con U D D W
Lad B N
Seq
yright © Conisys
owchartb
escribing pronversion oflowchart s
nstructingUnderstandDetermine tDetermine tWhen the se
dder Logilocks of Laormal Ladd
quence bi
s 2008
based desi
rocess contf flowcharts symbols
g a flowchad the procesthe major athe sequencequence ma
ic from fldder logic der logic.
ts
ign
trol using fs to ladder
art ss. actions, thece of operaay change u
lowchartcode.
[P a g e |
flowchart.logic.
se are drawations, thesuse decisio
ts
79]
wn as blocke are drawn blocks fo
ks. wn with arroor branchin
[Dr. Ashraf
ows. ng.
f Elnaggar]
Copy
Tr
Pro
yright © Conisys
ansition l
ogramming
s 2008
logic
g Examplees
[P a g e | 80] [Dr. Ashraff Elnaggar]
Copy
Se
Pro
A G
App
Th
App
yright © Conisys
ction 5:
ogrammi
Golden Pro
Ou
plication o
he On Dom
plication o
s 2008
Progra
ing Rules
ogrammi
utput
of the Rule
minant Ru
of the Rule
mming
s
ng Rule
A=
Latch
e
ule
e
[P a g e |
Rules &
(A + A [1])
OR
Entrance c
81]
& more
). A [0]
And
condition
Exit con
[Dr. Ashraf
ndition
f Elnaggar]
Copy
Out
Cas
Tan
yright © Conisys
tput Usin
se Study 1
nk Filling C
s 2008
g Set Rese
1: Tank Fi
Control
et Techni
illing Cont
[P a g e |
que
trol using
82]
g Set/Rese
et
[Dr. Ashraff Elnaggar]
Copy
Ris
Fall
Exa
yright © Conisys
ing Edge
ling Edge
ample: A Si
s 2008
ingle Turnn Motor Ap
[P a g e |
pplication
83]
[Dr. Ashraff Elnaggar]
Copy
The
Ano
Ca
Des
ThpallStop
Ope
Thwhi
yright © Conisys
e Program
other Solu
se Study:
scription
he system letize to a wp.
eration
he present ich enables
s 2008
m
ution
Control o
is made uwarehouse
t of a palles motor M
of Convey
up of a m. Three sen
t at the be, starting t
[P a g e |
yor Belt
otor‐drivennsor are als
eginning ofthe convey
84]
n belt, carso present,
f the belt iyor belt. Th
rrying somrespective
is belt detehe belt‐flow
[Dr. Ashraf
me pallets ly Start, Sta
ected by sews until the
f Elnaggar]
from a ack and
ensor 1 e pallet
Copy
reacnewthe unlo
I/O
Flo
yright © Conisys
ches sensow pallet hasbelt, stopsoaded.
O Assignm
ow Chart
s 2008
or 2 which s been loads motor M
ment
stops motded and deteach time
[P a g e |
tor M. The tected by sit detected
85]
belt startssensor 1. Sed the prese
s flowing aensor 3, locence of a p
[Dr. Ashraf
again only wcated at thepallet, read
f Elnaggar]
when a e end of dy to be
Copy
Se
The
Exa Wtwo
yright © Conisys
ction 6:• The On• The Sin• Mono‐S• Integra• Up Cou• Up/Dow
e OnDela
ample: SafWrite a PLCo PBs simul
s 2008
Timers n Delay Timngle Shot TStable Timeal Timer. unters. wn Counte
ay Time
fe StartingC code to enltaneously
and Coumer. imer. er.
ers
g Operationnsure that for one sec
[P a g e |
unters
n the operatcond in ord
86]
tor wants tder to start
to start a mthe motor.
[Dr. Ashraf
motor by p
f Elnaggar]
pressing
Copy
Exa Itstop UpoUpo
CasDes Thbe preadconto imanandN.BSce1. T2. Tboxthe 3. T(neAfterep
yright © Conisys
ample: Start is commops in the re
on Start ‐> on Stop ‐> m
se Study : Dscription: he in feed coprocessed dy to be finveyor wheindicate falnual operad manual bu. A bake is nario of opThe conveyoThe conveyxes is detecbrake. The valve oarly for fiveer the gate eated
s 2008
rting Sequon in Silo’severse sequ
m3 on ‐> dm1 off ‐> d
Detergent onveyor cain anotherilled .A hopere a valve ll of level ation and auttons for mused to stoperations: or starts myor carries cted by the
opens the he seconds)of hopper
uence s applicatiouence. Desi
delay 1 ‐> melay 3 ‐> m
Filling Lin
arries deterr stage .A ppper contacontrols it.An operatalarm lampmode selecop the conv
motion by prthe boxes photocell
hopper gate. is closed, t
[P a g e |
ons that cogn a Ladde
m2 on ‐> dem2 off ‐> del
ne
rgent boxesphotocell isain the dets drain A leting panel p for warniction. veyor from
ressing staof detergen(located u
e to dispen
the convey
87]
onveying ber program
lay 2 ‐> m1lay 4 ‐> m3
s to be filles located untergent is level switchcontains ang. The pa
coasting.
rt push butnt & continnder the h
nse the calc
yor starts m
belts startsthat can pe
1 on 3 off
d and thennder hoppeocated at th is locateda start andanel also co
tton locatednues motioopper) the
culated am
moving agai
[Dr. Ashraf
s in sequenerform this
n carries it aer to stop tthe middled at hopperd stop buttontains aut
d at the panon until oneen it is stop
mount of de
in and the
f Elnaggar]
nce and s task.
away to the box e of the r button tons for tomatic
nel . e of the pped by
etergent
cycle is
Copy
The
Mo
Circ OdetecurrHowdete
yright © Conisys
e Single S
onoStabl
cuit operaOutput R1 iected. The rent time vwever, if inects the lea
s 2008
Shot Time
le Timer
ation: s on at theleading edvalue is monput x1 is ading edge.
er
e same timdge of inpure than theoff at the f.
[P a g e |
e the leadiut x1 is dise set time vfirst scan a
88]
ng edge ofsregarded wvalue, MS12and on at t
f input x1 (while MS122 is off. the second
[Dr. Ashraf
(from off to2 is on. Wh
d scan, then
f Elnaggar]
o on) is hen the
n MS12
Copy
Des Thtraf
Ope Thalwthe ligh
Tra
yright © Conisys
scription he plant coffic‐ lights, i
eration he traffic isways associayellow sights B.
affic Light C
s 2008
nsists of a in parallel
s regulatedated to rednal must st
Control
four streettwo by two
d by trafficd on traffictart up, foll
[P a g e |
ts crossing,o.
c A and B. ‐ lights B. Alowed then
89]
, the four s
The green After a fixen by the red
treets are c
signal on ed time t, od and green
[Dr. Ashraf
controlled
traffic‐ lighon traffic‐ ln signal on
f Elnaggar]
by four
hts A is lights A n traffic‐
Copy
IntCirc Thtimtimthe
Star
Up Up
yright © Conisys
tegral Timcuit Operahe current er value ise value is uset time va
r Delta sw
Counter Counter Ti
s 2008
mer ation: timer valus held wheupdated agalue, and of
witch
ime Chart
e of TMR13n input X0gain.TMR13ff when CL
[P a g e |
3 is update0103 is off.3 is on whe13 is on.
90]
ed while inp. When inpen the curr
put X0103 put X0103 rent time v
[Dr. Ashraf
is on. The is on, the value is mo
f Elnaggar]
current current ore than
Copyright © Conisys 2008 [P a g e | 91] [Dr. Ashraf Elnaggar]
Up/Down Counter
Up / Down Counter Time Chart: Current Value Remains the Same Disregarded