Engineering Skills ECT111/PCT111 Lab Module UNIVERSITI MALAYSIA PERLIS COURSE NAME ENGINEERING SKILLs COURSE CODE ECT111/3 PCT 111/3 LAB NO. LAB MODULE PROGRAMMABLE LOGIC CONTROL (PLC) LEVEL OF COMPLEXITY 1 2 3 4 5 6 KNOWLEDGE COMPREHENSION APPLICATION ANALYSIS EVALUATION SYNTHESIS √ √ √ 1 Engineering Skills ECT111/PCT111 Lab Module ENGINEERING CENTRE CONTENT INTRODUCTION LAB 1: Introduction Programmable Logic Controller and Ladder Diagram LAB 2: Timer and Counter LAB 3: Introduction to CX-Programmer 2 Engineering Skills ECT111/PCT111 Lab Module EXPERIMENT 1 Introduction to Programmable Logic Controller (PLC) and Ladder Diagram Part A 1. OBJECTIVE: At the end of this session you should be able to: 1.1 Explain basic theory behind PLC technology, 1.2 Explain the advantages of PLC compared to relay system, and 1.3 Draw basic circuit conversion from relay system to Ladder Diagram 1.4 Explain types of OMRON PLC available in market, 1.5 Know a simple steps to use Programming Console to program PLC, 1.6 Know about OMRON CPM1A memory structure, 1.7 Understand I/O port addressing in OMRON CPM1A PLC 1.8 Interpret mnemonics code from Ladder Diagram and draw Ladder Diagram from given mnemonics code, and program PLC with mnemonics code 2. INTRODUCTION: PLC definition by National Electrical Manufacturers Association (NEMA): “A digitally operating electronic apparatus that uses a programmable memory for internal storage of instructions for implementing specific functions, such as logic sequencing, timing, counting, and arithmetic, to control, through digital or analogue input/output modules, various machines or processes” Figure 2.0: Programmable Logic Controller (PLC) 3 Engineering Skills ECT111/PCT111 Lab Module 2.1 PLC consists of: a. Input module b. Output module c. Processor d. Memory e. Power supply f. Programming device Programmable Devices (Computer or Programming Console Figure 2.1: PLC Block Diagram Inputs: limit switches; push buttons; sensors; other on/off devices; analogue devices Outputs: motor; valve; relay; other actuators CPU: executes logic & sequencing functions; similar to microprocessor of PCs Memory: stores programs; stores data/status Power Supply: supplying power for input, output and CPU of the PLC Programming Devices: programming console, PC 2.2 The PLC works by looking at its inputs and depending upon their state, turning on/off its outputs. The user enters a program, usually via software, that gives the desired results. 3 Engineering Skills ECT111/PCT111 Lab Module 2.3 For example, let's assume that when a switch turns on we want to turn a solenoid on for 5 seconds and then turn it off regardless of how long the switch is on for. We can do this with a simple external timer. But what if the process included 10 switches and solenoids? We would need 10 external timers. What if the process also needed to count how many times the switches individually turned on? We need a lot of external counters!! 2.4 The bigger the process the more of a need we have for a PLC. Simply program the PLC to count its inputs and turn the solenoids on for the specified time. 3. WHAT IS THE PURPOSE PLC REPLACE CONVENTIONAL RELAY SYSTEM? 3.1 The main purpose of a PLC is to replace relays circuit. 3.2 Single relay circuitry to represent normally off and normally on output is shown in Figure 3 and 4 below: 12 V 24 V Relay 1 2 5 3 4 OUTPUT motor INPUT Figure 3.0: Basic Relay Circuit to Represent Normally Off Output 4 Engineering Skills ECT111/PCT111 Lab Module 12 V Relay 1 2 OUTPUT 5 3 4 motor INPUT 24 V Figure 3.1: Basic Relay Circuit to Represent Normally On Output 3.3 As depicted in Figure 3 and 4, output motor only reacts at single input. More combinational of input (e.g. two switches to control the motor) requires more complex of circuitry. 3.4 To reduce circuitry complexity, PLC is used. Figure 3 and 4 can be called in PLC term as ‘normally open input’ and ‘normally close input’, respectively. The symbols of these ‘contact’ are shown in Figure 5. (a) Normally open input (b) Normally close input Figure 3.2: Relay Circuitry Representation in PLC 3.5 Advantages of PLC over relay system are: 3.5.1 Reduce wiring work 3.5.2 Relays and hardware timers are greatly reduced 5 Engineering Skills ECT111/PCT111 3.5.3 Lab Module Modification can be quite easy without changing of I/O wiring, if no additional input or output devices are required 3.5.4 Self diagnostic functions enable easy and fast troubleshooting of the system 4. RELAY CIRCUIT CONVERSION TO LADDER DIAGRAM. 4.1 Normal relay circuit can be represent by using switch symbol as shown in Fig. 6 in the left side below. 4.2 In relay circuit, input is called as ‘contact’ whereas output is called as ‘coil’. 4.3 In PLC terminology, the relay circuit can be represent by using Ladder Diagram that connect the corresponding ‘contact’ in the same manner as in relay circuit. 4.4 The coil (output) is generalized as circle symbol that could be lamp, motor, etc. 4.5 Each line of ladder diagram is called ‘rung’ that start with the uppermost as the first rung. The execution of program inside PLC always starts with the first rung. 4.6 To indicate ‘end of program’ in PLC, the symbol END must be used to avoid errors in program compilation. (a) 1st rung Equivalent to 2nd rung (b) Equivalent to 1st rung 6 rung 2nd Engineering Skills ECT111/PCT111 Lab Module NOTE: The terminology used in this manual is slightly different from relay terminology but the concepts are the same. Table 4.0: Relay – PLC Terminology Relay terminology Contact Coil Normally Open Relay Normally Close Relay PLC terminology Input Output Normally Open condition Normally Close condition. 5. PLC LADDER PROGRAMMING A very commonly used method of programming PLCs is based on the use of ladder diagrams. Writing a program is then equivalent to drawing a switching circuit. The ladder diagram is consists of two vertical lines representing the power rails. Circuits are connected as horizontal lines, i.e. the rungs of the ladder, between these two verticals. In drawing a ladder diagram, certain convections are adopted: 1. The vertical lines of the diagram represent the power rails between which circuits are connected. 2. Each rung on the ladder diagram defines one operation in the control process. 3. A ladder diagram is read from left to right and from top to bottom, Figure 5.0 showing the scanning motion employed by the PLC. The top rung is read from left to right. Then the second rung down is read from left to right and so on. When the PLCs is in its run mode, it goes through the entire ladder program to the end, the end rung being clearly denoted, and then clearly resumes at the start. This procedure of going through all the rungs of the program is termed a cycle. 7 Engineering Skills ECT111/PCT111 Lab Module RUNG 1 RUNG 2 RUNG 3 RUNG 4 END FIGURE 5.0 4. Each rung must start with an input or inputs and must end with at least one output. The term input is used for a control action, such as closing the contacts of a switch, used as an input to the PLC. The term output is used for a device connected to the output of a PLC, e.g. a motor. 5. Electrical devices are shown in their normal condition. Thus a switch which is normally open until some object closes it is shown as open on the ladder diagram. A switch that is normally closed is shown closed. 6. However as to read a ladder diagram which are complete with all the input contacts and outputs, one must comply with the rule of reading one rung at a time. For example, please see the figure below: 8 Engineering Skills ECT111/PCT111 Lab Module 1 01000 0.01 0.02 0.04 RUNG 1 0.03 3 2 RUNG 2 END Rule No 1: Read the ladder diagram from left to right. Starting from the most left of RUNG 1, (read through the arrow 1) the first contact will be read as LD 0.01, next move to the next contact and as the contact is connected in serial, it will be read as AND 0.02. MNEMONIC CODE LD 0.01 AND 0.02 (0.1) Rule No 2: Settle the lower LEFT contacts before continuing with the rest of the rung. As arrow no 1 comes to an end, follow arrow no 2. As the contact 0.03 is connected in parallel with contact 1 and 2, it will be read as OR 0.03 OR 0.03 (0.2) Rule No 3: Continue with the rest of the rung accordingly and comply with Rule No 1 and Rule No 2. Continue with arrow no 3. As contact no 4 is placed serial, it will be read as AND 0.04 and finally you reach the end of RUNG 1. As the coil/output is placed and there. It will be read as OUT 01000. Go on to the second and final RUNG where the end rung is being denoted. AND 0.04 OUT 01000 END (0.3) 9 Engineering Skills ECT111/PCT111 Lab Module FINAL MNEMONIC CODE ADDRESS INSTRUCTION OPERAND 00000 LD 00001 00001 AND 00002 00002 OR 00003 00003 AND 00004 00004 OUT 01000 00005 END BASIC LADDER LOGIC outputs inputs POWER NEUTRAL POWER NEEDS TO FLOW THROUGH THE INPUTS TO THE OUTPUTS 10 Engineering Skills ECT111/PCT111 Lab Module 6.0 SWITCHES 6.1 In real world, there are varieties of switch that can be used as input to the PLC. 6.2 The switch may be normally open (NO) or normally closed (NC) and may be activated from many sources. 6.3 Figure 7 shows the symbols for push-button switches. Both the NO and NC types are employed. These switches are typically used for operator Input such as to stop and/or to start a system. Figure 5.0: Symbols for Limit switches 6.4 Besides representing switches, PLC can be used as timer to control time dependant task or even as counter for counting task. In most of PLC nowadays, the PLC also capable to perform floating-point mathematical operations. 11 Engineering Skills ECT111/PCT111 Lab Module 6. INTRODUCTION TO OMRON CPM1A 6.1 There are 4 types of PLC from CPM1A family that differs from it’s no. of I/O: a) 10 I/O ports (expansion not possible) b) 20 I/O ports (expansion not possible) c) 30 I/O ports (with expansion port) d) 40 I/O ports (with expansion port) 6.2 In each category above, there are two categories of them again; using AC power supply & DC power supply for the central processing unit (CPU). 6.3 Like other family, CPM1As are programmable via two ways: 6.3.1 Programming console (CQM1-PRO01-E) 6.3.2 PC by using CX-Programmer (through RS-232C adapter) Programming Console CQM1-PRO01-E (with connecting cable) Figure 6.0: Connection diagram between OMRON CPM1A & Programming Console Figure 6.1: Connection diagram between OMRON CPM1A & PC 6.4 In this lab, we will use CPM1A-20CDR-A-V1, that have 20 I/O (12 input terminals & 8 output terminals) with AC power input for the CPU. 12 Engineering Skills ECT111/PCT111 Lab Module 6.5 This PLC comes with Programming Console CQM1-PRO01-E for programming and RS-232C adapter (CPM1-CIF01) to communicate with PC. The PLC was packaged inside Training Kit that occupy 2 modes of usage; LAMP or SOCKET. 6.6 If the mode is selected to LAMP, all the 12 red switches and 8 lamps will be functional for training & demonstration purposes whereas in SOCKET mode, all the 12 input ports & 8 output ports on the Training Kit are activated and ready to connect to the I/O peripherals such as switch, coil, lamp, or even 7 segment display. 7.0 PROGRAMMING CONSOLE CQM1-PRO01-E LCD Display Mode Selector Keypad Figure 7.0: Programming Console CQM1-PRO01-E 7.1 Programming Console is the best solution for onsite application such as start up and adjustments where PC contribution is nearly impossible. 7.2 Usually used by technicians to start or stop certain operation in production line or to modify data that doesn’t involve directly in main program. 7.3 Have 3 modes of operation (selectable using key provided): 7.3.1 Run – use to execute the program that has been entered into the PLC. No changes can be made to the internal data in this mode. 7.3.2 Monitor – use when changing the contents of memory areas while the PLC is actually in operation. 13 Engineering Skills ECT111/PCT111 7.3.3 Lab Module Program – for preparing program/modifications/corrections to existing program. 8 OMRON CPM1A MEMORY AREA STRUCTURE 8.1 Like other programmable devices such as microprocessors and microcontrollers, PLC has its own memory area that takes part in data processing from bit manipulations to I/O activities. 8.2 These memory areas were determined by manufacturer and it is standard for all OMRON PLC in certain family such as CPM1A and CPM2A. 8.3 Every component in Ladder Diagram must have its own address so that there will be no errors thrown by PLC while compiling the program written. 8.4 In Table 8.0, these memory areas are described in detail for usage in program development. Table 8.0: CPM1A Memory Areas Data Area Input area Output area Work area (IR area) Words 000 to 009 (10 words) 010 to 019 (10 words) IR 200 to IR 231 (32 words) SR area SR 232 to SR 255 (24 words) TR area --- HR area HR 00 to HR 19 (20 words) AR area AR 00 to HR 15 (16 words) LR area LR 00 to LR 15 (16 words) Bits 00000 to 00915 (160 bits) 01000 to 01915 (160 bits) IR 20000 to IR 23115 (512 bits) SR 23200 to SR 25515 (384 bits) TR 0 to TR 7 (8 bits) HR 0000 to HR 1915 (320 bits) AR 0000 to HR 1515 (256 bits) LR 00000 to LR1515 (256 bits) Function These bits can be allocated to the external I/O terminals. Work bits can be freely used within the program. These bits serve specific functions such as flags and control bits. These bits are used to temporarily store ON/OFF status at program branches. These bits store data and retain their ON/OFF status when power is turned off. These bits serve specific functions such as flags and control bits. Used for a 1:1 data link with another PC. 14 Engineering Skills ECT111/PCT111 Timer/Counter area DM Read/wri area te Error log Readon ly 9 Lab Module TC 000 to TC 127 (timer/counter numbers) DM 0000 to DM --0999 DM 1022 to DM 1023 (1,002 words) DM 1000 to DM --1021 (22 words) DM 6144 to DM 6599 (456 words) --- The same numbers are used for both timers and counters. DM area data can be accessed in word units only. Word values are retained when the power is turned off. Used to store the time of occurrence and error code of errors that occur. These words can be used as ordinary read/write DM when the error log function isn’t being used. Cannot be overwritten from program. I/O PORT ADDRESS 9.0 For OMRON PLC, the conventional used for I/O addressing is based on per channel where each channel size is 16 bits (1 word). Each bit was mapped exclusively for each port accordingly. 9.1 From Table 2, there are 10 channels (or words) used for input and 10 channels for output. All input and output devices connected to the PLC must be assigned with PLC address, correspond to PLC internal memory Input Bit and Output Bit. 9.2 PLC addressing comprises of Channel and Bit. Each Channel consists of 16 bits, indicated as “00, 01, 02, 03 … up to 15” in the addressing. 9.3 I/O port addressing is illustrated in Figure 9.0 . Note that, usually the “.” Is omitted for simplification 15 Engineering Skills ECT111/PCT111 Lab Module XXX. XX Channel 000.00 Bit 000.01 000.02 Figure 1: PLC I/O Address Figure 9.0: PLC I/O Address 9.4 In our case, where 12 inputs and 8 outputs involve, the addressing are shown in Table 3. 9.5 Note that for input and output channel, only channel 000 (input) and 010 (output) will be used since our PLC used for this lab only have 12 input ports and 8 output ports. The remaining channels are reserved for other models that have greater number of I/O. 16 Engineering Skills ECT111/PCT111 Lab Module Table 9.1: I/O Addressing I/O Input Channel 000 Bit 00 01 02 03 : : 11 Address 00000 00001 00002 00003 : : 00011 010 00 01 02 03 : : 07 01000 01001 01002 01003 : : 01007 Output 10 PROGRAMMING STEPS 10.1 Starting up 10.1.1 After plugging in the Programming Console at the PLC, switch on the power supply. 10.1.2 To gain access to the PC’s programming functions, you must first enter the password. The password prevents unauthorized access to the program. 10.1.3 The PLC prompts you for a password when PLC power is turned on or, if PLC power is already on, after the Programming Console has been connected to the PC. To gain access to the system when the “Password!” message appears, press CLR and then MONTR. Then press CLR to clear the display. 10.1.4 Once the Programming Console has been connected, its mode selector can be used to change the PLC operating mode. The mode display (<PROGRAM>, <MONITOR>, or <RUN>) will appear on the Programming Console screen. 10.1.5 Press CLR to clear the display so that key operations can be performed. 17 Engineering Skills ECT111/PCT111 Lab Module Figure 10.02: PLC Mode Selection 10.2 Clearing memory 10.2.1 This operation is used to clear all of memory, including the user program, PC Setup and all data areas. This process should be execute only in Program Mode. 10.2.2 Before beginning to program for the first time or when installing a new program, all memory areas needs to be cleared. Figure 10.13: Key is change to Program mode 10.2.3 To begin, 10.2.3.1 Press CLR key to bring up the initial display. 10.2.3.2 Press the SET, NOT and then the RESET Key to begin the operation. Figure 10.24: To clear memory 10.2.3.3 Press the MONTR Key to clear memory. Figure 10.35: Press Monitor key 18 Engineering Skills ECT111/PCT111 Lab Module 11.0 ENTERING NEW PROGRAM 11.1 This operation is used enter or edit programs. It is possible in PROGRAM mode only. Figure 11.0 6: Change key to Program mode 11.2 The same procedure is used to either input a program for the first time or to change a program that already exists. In either case, the current contents of Program Memory is overwritten. 11.3 The program shown in the following diagram will be entered to demonstrate this operation. 00002 00003 00003 00002 00004 00001 END Address 01000 00200 00201 00202 00203 00204 Instruction LD AND AND OUT END Operands 00002 00003 00004 01000 Figure 11.17: Ladder diagram and mnemonic code example 11.2.1 Press the CLR Key to bring up the initial display. Note that the 00000 is the address location of the program. 19 Engineering Skills ECT111/PCT111 Lab Module Figure 11.28: Show initial display 11.2.2 Specify the address where the program will begin. 11.2.3 Input the address where the program will begin and press the Down Arrow Key. It is not necessary to input leading zeroes. Figure 11.39: Entering address Note: It is a good habbit to start a new program at address 00000 to prevent any problem and difficulties in troubleshooting. 11.2.4 Input the first instruction and operand. Figure 11.410: Entering first Operand 11.2.5 Press the WRITE Key to write the instruction to Program Memory. The next program address will be displayed. Figure 11.511: First operand successfully entered If a mistake was made inputting the instruction, press the Up Arrow Key to return to the previous program address and input the instruction again. The mistaken instruction will be overwritten. 11.2.6 Press AND + 3 + WRITE for the next instruction. 11.2.7 Press AND + 4 + WRITE for the next instruction. 20 Engineering Skills ECT111/PCT111 Lab Module 11.2.8 Press OUT + 1000 + WRITE for output. 11.2.9 To put an END, press FUN + 01 + WRITE. 12.0 CHECKING MEMORY STATUS 12.1 This operation is used to check bits ON or OFF and is useful when debugging the program or checking input/output wiring. It is possible in MONITOR or PROGRAM mode only. Figure 12.012: Modes for checking bits ON or OFF 12.2 The steps are: 12.2.1 Press CLR Key to bring up the initial display, 00000. 12.2.2 Press SHIFT + CONT + <ADDRESS> + MONTR. The address is the memory location that needs to be checked. For example, to check the memory location of 00001, the input 1. Figure 12.113: Check memory location 12.2.3 The status of the input switch (in this case) is shown as ON if the switch is on and shown as OFF if the switch is off. 21 Engineering Skills ECT111/PCT111 Lab Module PART B 1.0 LADDER DIAGRAM & MNEMONIC CODE 1.1 Basic Programming Instructions: LD, AND, OR, NOT, OUT, END, AND LD, OR LD. LD - A starting instruction for a logic line Example: When a logic line starts with an NO (Normally Open) input, use LD. Ladder Diagram Mnemonics Code Figure1.0: LD instruction AND Example: Ladder Diagram - This is used to connect two or more inputs in serial Mnemonics Code Figure 1.1: AND instruction 22 Engineering Skills ECT111/PCT111 Lab Module 1.2 Basic Programming Instructions: LD, AND, OR, NOT, OUT, END, AND LD, OR LD. OR - This is used to connect two or more inputs in parallel Example: Ladder Diagram Mnemonics Code Figure 1.2: OR instruction NOT - NOT invert its inputs; Often used to form an NC (Normally Closed) input or output. NOT can be used with LD, OUT, AND or OR Example: Ladder Diagram Mnemonics Code Figure 1.3: NOT instruction 23 Engineering Skills ECT111/PCT111 OUT Lab Module - This is used to connect output/ designated operand bit 2.3 Basic Programming Instructions: LD, AND, OR, NOT, OUT, END, AND LD, OR LD. Example: Ladder Diagram Mnemonics Code Figure 1.4: OUT instruction END - This is used to indicate the end of program. Note: The last instruction in any program must be an End Instruction. Example: Ladder Diagram Mnemonics Code Figure 2.2: END instruction 24 Engineering Skills ECT111/PCT111 Lab Module 3.0 NORMALLY CLOSE VS NORMALLY OPEN 3.1 Normally close, and normally open, are the advantage of programmable devices that invert the operation each of them easily only by programming task that does not involve of any wiring process. 3.2 Consider the following ladder diagram, 00000 01000 END Figure 3.0: Simple ladder diagram To make the output 01000 on, the normally open input 00000 should be closed (pull down) 3.3 Consider the following ladder diagram, 00000 01000 END Figure 3.1: Simple ladder diagram To make the output 01000 on, the normally close input 00000 should be open (pull up) 25 Engineering Skills ECT111/PCT111 Lab Module 3.4 Consider the following ladder diagram, 00000 01000 END Figure 3.2: Simple ladder diagram The ‘normally on’ output 01000 will be off if the input 00000 is close (pull down) 3.5 Do not get confuse with normal terms on switch “A switch should be closed to turn on the lamp” “A switch should be on to turn on the lamp” Because PLC is a programmable device that can program the state of a switch itself!!! 4.0 SELF-HOLDING CIRCUIT START STOP MOTOR MOTOR Figure 4.0: Self-holding circuit The explanation for the above circuit, can only obtained from class. Therefore, do not absent. 26 Engineering Skills ECT111/PCT111 Lab Module 5.0 INTERNAL RELAYS In PLC’s there are elements that are used to hold data, i.e. bits, and behave like relays, being able to be switched on or off and switch other devices on or off. Hence the term internal relay. Such internal relays do not exist as real-world switching devices but are merely bits in the storage memory but behaved in the same ways as relays. For programming, they can be treated in the same way as an external relay output and input. Thus inputs to external switches can be used to give an output from an internal relay. This is then results in the internal relay contacts being used, in conjunction with other external input switches to give an output, e.g. activate a motor. Figure 5.1 below shows a ladder program for multiple input conditions. 00001 00002 20000 00003 20000 00004 01000 END Tips : Bear in mind operands for internal relays start from bits 20000 until 23115 (refer to table 8.0) 27 Engineering Skills ECT111/PCT111 Lab Module 6.0 Basic Programming Instructions: LD, AND, OR, NOT, OUT, END, AND LD, OR LD. Example: Ladder Diagram Block ‘a’ Mnemonics Code Block ‘b’ Block ‘a’ Block ‘b’ Combination of Block “a” & “b” Figure 5.0: AND LD instruction Example: Ladder Diagram Mnemonics Code block ‘a’ Block ‘a’ Block ‘b’ Combination of block ‘a’ and ‘b’ Figure 5.1: OR LD instruction 28 Engineering Skills ECT111/PCT111 Lab Module LAB EXERCISE 1 (TO DO INSIDE LAB): INTRODUCTION TO PLC 1. By using Programming Console given in the lab, follow the instruction below to program the PLC by given Mnemonics Code. a) Plug in the given Programming Console cable at the PLC. b) Switch on the power supply switch. c) PWR LED at the PLC should be turned on while COMM LED should be blinking to indicate communication between PLC and Programming Console. d) Switch to Program Mode by turning the key to Program selection. e) If you are asked about password, press CLR + MONTR + CLR at the Programming Console. f) Press CLR + SET + NOT + RESET + MONTR + CLR at the Programming Console. This is for clearing any program inside the PLC memory. g) Verify that there are no program left inside the PLC by pressing ↑ and ↓. h) Press LD + 00003 + WRITE. i) Press AND + 00002 + WRITE. j) Press OUT + 01000 + WRITE k) Press FUN + 01 + WRITE. l) Switch to Monitor Mode by turning the key to Monitor Mode selection. m) Try to close (pull down) and open (pull up) the inputs and watch the output 0. n) Draw the equivalent Ladder Diagram and relay circuit for the program that you have just entered by using the Programming Console. Give explanations. 2. Repeat all the steps in Question 7 by replacing step i) with: a. Press OR + 00002 + WRITE. 3. Differentiate Run, Monitor and Program Mode in the PLC used in the lab. 4. Give addresses for input and output for the PLC used in the lab. 5. Give range of addresses for timer/counter. 29 Engineering Skills ECT111/PCT111 Lab Module UNIVERSITI MALAYSIA PERLIS COURSE NAME ENGINEERING SKILLS COURSE CODE ECT111/ 3 PCT111/3 LAB TASK 1 LAB TASK 1 LAB TASK 2 PROGRAMMABLE LOGIC CONTROL (PLC) NAME MATRIX NO COURSE GROUP SUBMISSION DATE MARKS LAB TASK 1 LAB TASK 2 TEST TOTAL MARKS 30 Engineering Skills ECT111/PCT111 Lab Module LAB TASK 1: INTRODUCTION TO PLC ANSWER ALL QUESTIONS 1. What is Ladder Diagram? Explain briefly. (2 marks) 2. There are two types of contact in ladder diagram. Name both of them, give explanation and draw the symbol. i) ii) (8 marks) 3. Draw the ladder diagrams for the electrical circuits given below : The Electrical Circuits a) The Ladder Diagram a) b) b) ( 10 marks) 31 Engineering Skills ECT111/PCT111 Lab Module By using Programming Console and CX Programmer, program the PLC with the following Ladder Diagrams (from questions 4 – 9). First, complete the mnemonics code table, and then key in the program using Programming Console. Check your program by toggling the switches. 4. (10 marks) Address Instruction Operands 5. 32 Engineering Skills ECT111/PCT111 Address Lab Module Instruction Operands (10 marks) 6. (10 marks) Address Instruction Operands 33 Engineering Skills ECT111/PCT111 Lab Module 7. (10 marks) Address Instruction Operands 8. (10 marks) Address Instruction Operands 00005 34 Engineering Skills ECT111/PCT111 Lab Module 9. (10 marks) Address Instruction Operands Convert the following Mnemonics Code (questions 10 and 11) below to its equivalent Ladder Diagram. 10. Address 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 Instruction LD LD LD AND OR LD AND LD LD LD AND OR LD AND LD OUT END Operands 00000 00001 00002 00003 00004 00005 00006 01000 (10 marks) 35 Engineering Skills ECT111/PCT111 Lab Module 11. Address 00000 00001 00002 00003 00004 00005 00006 00007 00008 00009 Instruction LD LD NOT AND LD AND NOT OR LD AND LD AND OUT END Operands 00000 00001 00002 00003 00004 00005 01004 (10 marks) Total Marks: /100 marks 36 Engineering Skills ECT111/PCT111 Lab Module EXPERIMENT 2 TIMER AND COUNTER 1. OBJECTIVE: 1.1 To understand Timer and Counter operation. 1.2 To apply Timer and Counter concept in PLC programming 2 INTRODUCTION TO TIMER 2.1 From Table 3, CPM1A have 128 timers/counters that can be used for any applications. 2.2 Below is the basic Ladder Diagram for timer to trigger an output after 8 seconds of activation. TIM000 #080 00000 TIM000 Address Instruction Operands 00000 00001 00002 00003 00004 00005 LD TIM 00000 000 #080 TIM 000 01000 LD OUT END 01000 END Figure 2.1: Switching an Output after 8 Seconds 2.3 Example: 2.3.1 2.3.2 2.3.3 Develop the ladder logic that will turn on an output light, 15 seconds after switch A has been turned on. Give the mnemonic code. Design another ladder diagram that will turn off the output 01000 after 8 seconds the input 00000 is closed (pull down). Give the mnemonic code. What if the initial condition of the output 01000 is off? Give your mnemonic code. 37 Engineering Skills ECT111/PCT111 Lab Module 3.0 INTRODUCTION TO COUNTER 3.1 From Table 3, CPM1A have 128 timers/counters that can be used for any applications. 3.2 Below is the basic Ladder Diagram for counter (10 times). 00000 count input CNT001 00002 reset CNT001 01002 Address Instruction Operands 00000 00001 00002 00003 00004 00005 00006 LD LD CNT 00000 00002 001 #0010 CNT001 01002 LD OUT END END Figure 14: Counter Operation. 3.3 Example 3.3.1 Develop the ladder logic that will turn on a light (01004), after switch A (00002) has been closed 10 times. Push button B (00003) will reset the counters. 38 Engineering Skills ECT111/PCT111 Lab Module Name : ______________________________ Date: ______________ Matrix No : ______________________________ Group: _____________ LAB TASKS 2: TIMER & COUNTER. DESIGN AND APPLICATION PROBLEM 1. Refer the circuit below, S1 S2 A L L TIM L 000 #0050 TIM000 IR END Read all questions. For question i-iv, EXCLUDE A i. How many rung available at the above circuit? ii. What is mean by IR (internal relay)? iii. Rung number 1 is also known as a “holding circuit”. Inspect what is “holding circuit” and briefly, explain. iv. Explain how the circuit works. 39 Engineering Skills ECT111/PCT111 For question v-vi, consider Lab Module A v. __ What happened if IR positioned at vi. Use your own address, Get the final mnemonic code. A ? Explain in detail. *IR = internal relay (20000), L=lamp (output) Address Instruction Operand (20 marks) 40 Engineering Skills ECT111/PCT111 2. Lab Module Refer to ladder diagram below, S1 TIM000 Address Instruction Operand #0050 TIM000 TIM001 01000 01001 01002 S1 TIM001 #0050 END i. How many timer uses in the circuit above? ii. Toggle down switch S1. Wait for __ second. What happened to 01000? iii. Toggle up switch S1. Wait for __second. What happened to 01000? iv. The circuit above also known as “ON and OFF Delay Circuit”. Do you agree? Why? v. Give your own address, write the mnemonic code at the given table above. (20 marks) 41 Engineering Skills ECT111/PCT111 Lab Module 3. Answer all questions below. Draw the ladder diagram a) Toggle switch 00000 for 5 times, after 5 seconds output 01000 turns ON. Draw the ladder diagram. (5 marks) b) Toggle down switch 00001, after 5 seconds output 01002 turns ON. Toggle switch 00002 5 times to OFF output 01002. Draw the ladder diagram. (5 marks) c) Toggle down 00000, output 01002 turns ON. After 10 seconds, output 01002 automatically turns OFF. Draw the ladder diagram. (10 marks) 42 Engineering Skills ECT111/PCT111 Lab Module d) Toggle down 00000, output 01002 turns ON. Toggle for 5 times to OFF output 01002. Draw the ladder diagram. (10 marks) e) You are given reference as below: TIM000 = 10 s TIM001 = 10 s TIM002 = 10 s OUTPUT = 01000 Draw ladder diagram to ON 01000 after 30s. (10 marks) f) You are given reference as below: CNT000 = 5 CNT001 = 10 OUTPUT = 01000 Toggle 5 times to ON 01000. Toggle another 5 times to off 01000. Draw ladder diagram. (10 marks) 43 Engineering Skills ECT111/PCT111 Lab Module g) Use push button. Toggle switch 00003, output 01001goes ON. After 5 seconds, output 01002 goes ON. 5 seconds after 01002 ON, all output must be OFF automatically. (10 marks) Total marks: /100 marks 44 Engineering Skills ECT111/PCT111 Lab Module EXPERIMENT 3 Introduction to CX-Programmer 1. OBJECTIVE: 1.1 know basic step to program PLC using CX-PROGRAMMER 2. INTRODUCTION TO CX-PROGRAMMER Figure 3.0: Cx-programmer version 5.0 2.1 CX-Programmer is a PLC programming tool for the creation, testing and maintenance of programs associated with OMRON CS/CJ/CP-series PLCs, CV-series PLCs and C-series PLCs. 2.2 It provides facilities for the support of PLC device and address information and for communications with OMRON PLCs and their supported network. 2.3 It is based on graphical user interface that will help user in creating simple program, or even very complex program only by using mouse. 45 Engineering Skills ECT111/PCT111 Lab Module 2.4 With CX-Programmer, user can create new program from Ladder Diagram. Thus, this will give greater understanding while in debugging, plus good debugging technique provided. Figure 3.1: CX-Programmer Main Interface Figure 3.2: Toolbar for creating Ladder Diagram 46 Engineering Skills ECT111/PCT111 Lab Module Figure 3.3 : Toolbar for Work Online, PLC Monitoring, Transfer to PLC, Transfer from PLC, Program, Debug, Monitor and Run Mode, Respectively. LAB TASK 3 1. Repeat Lab Task 2 by using CX-Programmer. Verify your answer. 2. Design problem will be given in the lab later. 47