PLC Training Course by Ahmedelsisy
Short Description
Download PLC Training Course by Ahmedelsisy...
Description
Co ourse: PLC Pro ogramm ming Co oncepts Dr. Ashraf Elnaggar
[2008]
Copyyright © Conisyss 2008
[P a g e | 1]
[Dr. Ashraff Elnaggar]
BUILDING #2042‐ELMERAAG‐CAIRO‐RING ROAD‐ELMAADI HTTP://WWW.CONISYS‐SHAKER.COM/ TEL:(202)29705962 FAX:(202)25204518
CONISYS S.A.E. Control & Instrumentations System Technology 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 Copyright © Conisys 2008
[P a g e | 3]
[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 | 4]
[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 | 5]
[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 | 6]
[Dr. Ashraf Elnaggar]
Course: PLC Programming Concepts By Dr. Ashraf Elnaggar
Copyright © Conisys 2008
[P a g e | 7]
[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 | 8]
[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 | 9]
[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 | 10]
[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 | 11]
[Dr. Ashraf Elnaggar]
Demonstration of the number systems Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Binary
*10¹ =10
*10⁰ =1
*2⁴ =16
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
*2³ *2² =8 =4 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
BCD *2¹ =2 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
*2⁰ =1 8 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0
Hexadecimal
Tens Tetrad 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
Ones Tetrad 8 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1
4 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0
2 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 0 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
*16¹ *16⁰ =16 =1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
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 | 12]
[Dr. Ashraf Elnaggar]
0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3
123/2 = 61 reminder 1 61/2 = 30 reminder 1 30/2 = 15 reminder 0 Allocate in the 15/2 = 7 reminder 1 clockwise direction 7/2 = 3 reminder 1 3/2 = 1 reminder 1 1/2 = 0 reminder 1 123 1 1 1 1 0 1 Pattern: 1 1 1 1 0 1 1 1x2⁶ + 1x2⁵ + 1x2⁴ + 1x2³ + 0x2² + 1x2¹ + 1x2⁰ 64 + 32 + 16 + 8 + 0 + 2 + 1 = 123
1
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. Allocate in the 123/16= 7 reminder 7 clockwise direction 11/16 = 0 reminder 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 Copyright © Conisys 2008
[P a g e | 13]
[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. 0
1
0
1
1
0
0
1
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: 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 0
6 1
5 0
4 1
3 1
2 0
1 0
0 1
Bit address
Word Address The numbering of words results in a word address. Copyright © Conisys 2008
[P a g e | 14]
[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).
IW0
IB0
IB1
IB2
IW2
IB3
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 ID0 IW0 IW2 IB0 IB1 IB2 IB3 IW1
IW1
Copyright © Conisys 2008
[P a g e | 15]
[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). •
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. Copyright © Conisys 2008
[P a g e | 16]
[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 | 17]
[Dr. Ashraf Elnaggar]
It contains : NO Device Name 1 Power Module 2 3 4 5 6 7
Description of function Converts power supply to the power to be used within the EH‐150 CPU Module Performs operations based on the contents of the user program, receives input and control outputs I/O Module Digital input module, Digital output module, analog input module, etc. Basic Base Base in which the power module, CPU module I/O module etc. are loaded Expansion base Base in which the power module, I/O controller, I/O module, etc. are loaded Expansion cable Cable that connects the I/O controllers for the basic base and expansion base I/O Controller Interface with expansion base and CPU module
CPU Module
Copyright © Conisys 2008
[P a g e | 18]
[Dr. Ashraf Elnaggar]
No.
Name
Function
Power module
Copyright © Conisys 2008
[P a g e | 19]
[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 | 20]
[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 | 21]
[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 | 22]
[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 | 23]
[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 . Copyright © Conisys 2008
[P a g e | 24]
[Dr. Ashraf Elnaggar]
Exa ample
Sellection off a PLC • • • •
What I/O ccapacity is required, N No of I/Os, capability o of expansio on for futurre needs? d, I.e. isolatiion on boarrd power supply for I//Os, What types of I/Os arre required signal cond ditioning? What size o of memory y is required? What speed and pow wer is requirred of the C CPU? The greater the number of I/Os to be handled d the fasterr the CPU reequired.
Revview Queestions Q : Can a PLC input switcch a relay ccoil to contrrol a Motorr? output can sswitch a reelay. A : No a PLC o utput cards acts as an interface b between thee PLC and Q : How do input and ou 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. ourcing and d sinking o output? Q : What is the differencce between wiring a so utputs supp ply currentt that will p pass througgh an electrrical load to o A: SSourcing ou ground. Sinkin ng inputs alllow curren nt allow to flow from the electriccal load to tthe mmon. com C easier to interrupt? Q : Is AC or DC A : AC is easieer, it has zerro‐crossingg. happen if th he rated vo oltage on a device is exceeded? Q : What can h A : It will lead d to prematture failure. Copyyright © Conisyss 2008
[P a g e | 25]
[Dr. Ashraff 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 | 26]
[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 | 27]
[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 | 28]
[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. 2. 3. 4. 5. 6. 7. 8.
Selection Line draw Contact symbol Coil symbol Arithmetic instruction(s) Function box (e.g. Compare box) Compare box 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 | 29]
[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 | 30]
[Dr. Ashraf Elnaggar]
The list for the rest of the positions will contain all Input/output modules and all Special modules. 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). 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 use these buttons to go from one module to the next. Copyright © Conisys 2008
[P a g e | 31]
[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 | 32]
[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. When you type the symbol, all matching symbols will be shown. Here you can change to an inverted contact or edge detection.
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. Copyright © Conisys 2008
[P a g e | 33]
[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 | 34]
[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 | 35]
[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 | 36]
[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 | 37]
[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 | 38]
[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 ). 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 | 39]
[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 | 40]
[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 symbol. A window will open, where you can write the comment. Copyright © Conisys 2008
[P a g e | 41]
[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 | 42]
[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 | 43]
[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 | 44]
[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 | 45]
[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 | 46]
[Dr. Ashraf Elnaggar]
The property window for the symbol appears. 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. 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.
Copyright © Conisys 2008
[P a g e | 47]
[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 | 48]
[Dr. Ashraf Elnaggar]
You can build up any number of Functions and Function blocks to be used one or several times in your program. The name of the Output is identical to the Function name. (In this case “New function”).
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. Copyright © Conisys 2008
[P a g e | 49]
[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 | 50]
[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).
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.
Copyright © Conisys 2008
[P a g e | 51]
[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 | 52]
[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 | 53]
[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 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 | 54]
[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 | 55]
[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 | 56]
[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 | 57]
[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 | 58]
[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 | 59]
[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 | 60]
[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 | 61]
[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 | 62]
[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 | 63]
[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 | 64]
[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 | 65]
[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 | 66]
[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 button down.) Copyright © Conisys 2008
[P a g e | 67]
[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 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 and Replace 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 | 68]
[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 | 69]
[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 | 70]
[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 | 71]
[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 | 72]
[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 | 73]
[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 | 74]
[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 This operation can take a long time if the table has got many values. In such case select smaller tables. Copyright © Conisys 2008
[P a g e | 75]
[Dr. Ashraf Elnaggar]
Section 4: Programming Concep pts Con ntrol Bra anches
Con ntrol schem mes Con ntentious: tthe values tto be contro olled changge smoothly (the speeed of the caar) . Loggical: the vaalues to bee controlled d are easily y described d as on‐off (the motor of the car is on or offf). Lineear: can bee described as a simplee differentiial equation n. Seq quential: a logical conttroller that will keep ttrack of tim me and prevvious eventts. A siimple rela ay controller
Copyyright © Conisyss 2008
[P a g e | 76]
[Dr. Ashraff Elnaggar]
A PLC with re elays
Lad dder Progrram
Lad dder
Copyyright © Conisyss 2008
[P a g e | 77]
[Dr. Ashraff Elnaggar]
Lad dder logic i inputs
dder Logic Outputs Lad
Pro ogrammiing Conceepts • • • • • •
Boolean logic design. Karnau ugh maps. Ladderr logic. SFD (Seequence Flow Diagram m). Flowch harts. Cases sstudy.
Copyyright © Conisyss 2008
[P a g e | 78]
[Dr. Ashraff Elnaggar]
Flo owchartb based desiign De escribing prrocess conttrol using fflowchart.
Co onversion off flowchartss to ladder logic.
Fllowchart s symbols nstructing g a flowcha art Con Understand U d the processs. Determine t D the major aactions, these are draw wn as block ks. Determine t D the sequencce of operaations, these are draw wn with arro ows. When the se W equence maay change u use decision blocks fo or branchin ng.
Lad dder Logiic from fllowchartts Blocks of Ladder logic code. Normal Ladd der logic.
Seq quence bits
Copyyright © Conisyss 2008
[P a g e | 79]
[Dr. Ashraff Elnaggar]
Transition l logic
ogramming g Example es Pro
Copyyright © Conisyss 2008
[P a g e | 80]
[Dr. Ashraff Elnaggar]
Section 5: Programming Rules & & more Pro ogrammiing Ruless 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
Copyyright © Conisyss 2008
[P a g e | 81]
[Dr. Ashraff Elnaggar]
Outtput Using Set Rese et Technique
Casse Study 1 1: Tank Fiilling Conttrol using g Set/Rese et
Tan nk Filling C Control
Copyyright © Conisyss 2008
[P a g e | 82]
[Dr. Ashraff Elnaggar]
Rising Edge
Fallling Edge
Exa ample: A Siingle Turn n Motor Ap pplication
Copyyright © Conisyss 2008
[P a g e | 83]
[Dr. Ashraff Elnaggar]
The e Program m
other Solu ution Ano
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 Stop p.
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 Copyyright © Conisyss 2008
[P a g e | 84]
[Dr. Ashraff Elnaggar]
reacches senso or 2 which stops mottor M. The belt startss flowing again a only when w a new w pallet hass been load ded and dettected by ssensor 1. Seensor 3, loccated at thee end of the belt, stopss motor M each time it detected d the preseence of a p pallet, read dy to be oaded. unlo
I/O O Assignm ment
Flo ow Chart
Copyyright © Conisyss 2008
[P a g e | 85]
[Dr. Ashraff Elnaggar]
Section 6:Timers and Cou unters • • • • • •
The On n Delay Tim mer. The Sin ngle Shot Timer. Mono‐SStable Timeer. Integraal Timer. Up Cou unters. Up/Dow wn Counteers
The e OnDela ay Time
Exa ample: Saffe Starting g Operation n W Write a PLC C code to en nsure that the operattor wants tto start a m motor by p pressing two o PBs simulltaneously for one seccond in ord der to start the motor.
Copyyright © Conisyss 2008
[P a g e | 86]
[Dr. Ashraff Elnaggar]
Exa ample: Starrting Sequ uence Itt is commo on in Silo’ss applicatio ons that co onveying belts b startss in sequen nce and stop ps in the reeverse sequ uence. Design a Laddeer program that can peerform thiss task. on Start ‐> m3 on ‐> d delay 1 ‐> m m2 on ‐> delay 2 ‐> m1 1 on Upo Upo on Stop ‐> m m1 off ‐> delay 3 ‐> m m2 off ‐> dellay 4 ‐> m3 3 off
Detergent Filling Lin ne Casse Study : D Desscription: Th he in feed co onveyor caarries deterrgent boxess to be filled and then n carries it aaway to be p processed in anotherr stage .A p photocell iss located un nder hoppeer to stop tthe box read dy to be fiilled .A hop pper contaain the dettergent is located at tthe middlee of the con nveyor 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 co ontains auttomatic and d manual bu uttons for m mode selecction. N.B. A bake is used to sto op the conv veyor from coasting. perations: Scenario of op The conveyo or starts m motion by prressing start push buttton located d at the pan nel . 1. T 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 m moving agaiin and the cycle is repeated
Copyyright © Conisyss 2008
[P a g e | 87]
[Dr. Ashraff Elnaggar]
The e Single S Shot Time er
Mo onoStablle Timer
Circcuit opera ation: O Output R1 is on at thee same time the leading edge off input x1 ((from off to 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, then n MS12 deteects the leaading edge..
Copyyright © Conisyss 2008
[P a g e | 88]
[Dr. Ashraff Elnaggar]
Desscription Th he plant consists of a four streetts crossing,, the four streets are ccontrolled by four trafffic‐ lights, iin parallel two by two o.
Ope eration Th he traffic iss regulated d by trafficc A and B. The green signal on traffic‐ ligh hts A is alw ways 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‐ ligh hts B.
Tra affic Light C Control
Copyyright © Conisyss 2008
[P a g e | 89]
[Dr. Ashraff Elnaggar]
Inttegral Tim mer Circcuit Opera ation: Th he current timer value of TMR13 3 is updateed while inp put X0103 is on. The current timer value iss held when input X0 0103 is off.. When inp put X0103 is on, the current updated aggain.TMR13 3 is on wheen the currrent time vvalue is mo ore than time value is u the set time vaalue, and offf when CL13 is on.
Starr Delta sw witch
Up Counter Up Counter Tiime Chart
Copyyright © Conisyss 2008
[P a g e | 90]
[Dr. Ashraff Elnaggar]
Up/Down
Counter
Up / Down Counter Time Chart: Current Value Remains the Same Disregarded
Copyright © Conisys 2008
[P a g e | 91]
[Dr. Ashraf Elnaggar]
View more...
Comments