328

Click here to load reader

[eBook] PLC Beginner Guide (OMRON CPM1A)

Embed Size (px)

DESCRIPTION

plc

Citation preview

WWW.MIKROKONTROLCO.YUZa kom pletnu literaturu iz oblasti industrijske elektronikeposetite sa jt www.mikrokontrol.co.vu deo literaturaMore pdf books about industrial electronics atwww.mikrokontrol.co.yu page literaturaMikro KontrolDositejeva 7a11000 BeogradSrbija i Crna G oratel:011/3283840tel/fax:011/3283732e-mail: officemikrokontrol.co.vu WWW: http://www.m ikrokontrol.co.vu

iCONTENTSPAGE1. IntroductionWhat is a Control System------------------------------------ 1-1The Role of the Programmable Controllers------------------------------------ 1-3Input and Output Devices------------------------------------ 1-3What is a Programmable Controller------------------------------------ 1-5Conventional Control Panel and it's difficulties------------------------------------ 1-8Disadvantages of Conventional Control Panel------------------------------------ 1-8PLC Panel and their advantages------------------------------------ 1-9Conversion of Conventional Control Circuit to PLC------------------------------------ 1-10A Systematic Approach of control system Design------------------------------------ 1-14Programmable Controller Application------------------------------------ 1-16Consider A Simple Project------------------------------------ 1-172. System ConfigurationCPM1A CPU Components------------------------------------ 2-1CPM2A CPU Components------------------------------------ 2-3Expansion I/O Units Components------------------------------------ 2-6CPU and Expansion I/O Unit Configuration------------------------------------ 2-9CPM1A- Communications Host Link Communication------------------------------------ 2-11 Multi-drop Communications to Computer------------------------------------ 2-12 1 to 1 PLC Communication Links------------------------------------ 2-14 NT Link Communication------------------------------------ 2-15 Programming Example of 1:1 PLC Link Between 2 CPM1A Units------------------------------------ 2-15

CPM2A- Communications Host Link Communication------------------------------------ 2-16 Multi-drop Communications to Computer------------------------------------ 2-17 No-Protocol Communication (RS-232C Communication)------------------------------------ 2-18 NT Link Communication------------------------------------ 2-19 1 to 1 PLC Communication Links------------------------------------ 2-19 CompoBus/S I/O Link Connections------------------------------------ 2-20Peripheral Devices------------------------------------ 2-21Programming Console------------------------------------ 2-21Sysmac Window Based Support software------------------------------------ 2-22Training Kit Configuration------------------------------------ 2-24PLC Electrical Wiring I/O Connection------------------------------------ 2-253.Features and FunctionsCPM1A General------------------------------------ 3-1 Analog Setting Function------------------------------------ 3-2 Input Interrupt------------------------------------ 3-3 Quick Response Inputs Function------------------------------------ 3-4 Interval Timer Function------------------------------------ 3-4 High Speed Counter------------------------------------ 3-5CPM2A General------------------------------------ 3-6 Interrupt Functions------------------------------------ 3-7 Interrupt Inputs------------------------------------ 3-8 Interval Timer Interrupts------------------------------------ 3-8 High Speed Counter------------------------------------ 3-9 Interrupt Inputs (Counter Mode)------------------------------------ 3-10

iiCONTENTSPAGE Interrupt by High Speed Counter Inputs(Count-check Interrupts)------------------------------------ 3-10 Example of Input Interrupt in Counter Mode------------------------------------ 3-11 High Speed Counter------------------------------------ 3-12 Example of using High Speed Counter------------------------------------ 3-12 Pulse Output Function------------------------------------ 3-13 Synchronized Pulse Control------------------------------------ 3-14 Analog Controls------------------------------------ 3-15 Quick Response Inputs Function------------------------------------ 3-15- Marco Function------------------------------------ 3-164. Unit Specifications and ComponentsCPM1AGeneral Specifications------------------------------------ 4-1Characteristics------------------------------------ 4-2Structure of Memory Area------------------------------------ 4-3I/O Terminal - IR Bit Allocation------------------------------------ 4-4CPM2AGeneral Specifications------------------------------------ 4-5Characteristics------------------------------------ 4-6Structure of Memory Area------------------------------------ 4-8I/O Terminal - IR Bit Allocation------------------------------------ 4-9Expansion Unit for CPM1A and CPM2A------------------------------------ 4-9Example of I/O Allocation for CPM2A------------------------------------ 4-10Programming Console------------------------------------ 4-12Password Input------------------------------------ 4-14Clearing all Program------------------------------------ 4-155. Window Based Programming Software-SYSWINProgramming of CPM1A and CPM2A------------------------------------ 5-1Programming Using SYSWIN Version 3.3 Connection to the PC------------------------------------ 5-1 RS232C Connector Configuration------------------------------------ 5-1 Installing SYSWIN Program------------------------------------ 5-2 SYSWIN Window------------------------------------ 5-3 Start Up with SYSWIN------------------------------------ 5-3 Programming with SYSWIN------------------------------------ 5-4 Saving the Project------------------------------------ 5-7 Transfer Program to PLC------------------------------------ 5-86.Application Examples of Basic CommandsOverview of Instructions------------------------------------ 6-1Application #1 : Self Holding Circuit------------------------------------ 6-2Application #2 : On Delay Circuit------------------------------------ 6-19Application #3 : Control Circuit for Packaging Machine------------------------------------ 6-31Application #4 : Drilling Control Operation------------------------------------ 6-33Application #5 : Filling/Draining Control Operation------------------------------------ 6-37Application #6 : Overhead Crane Control of Degreasing Operation------------------------------------ 6-41Application #7 : Parts Sorting------------------------------------ 6-45Application #8 : Robot Movement Control------------------------------------ 6-47

iiiCONTENTSPAGEApplication #9 : A Simple Sequence Control Concept------------------------------------ 6-51Application #10: Automatic Control of Warehouse Door------------------------------------ 6-58Application #11: Automatic Lubrication of Gear------------------------------------ 6-60Application #12: Conveyor Belt Motor Control------------------------------------ 6-62Application #13: Display Error Code of Machine to Aid------------------------------------ 6-66In The Tracing Source of The ProblemApplication #14: Measuring the Life of a Cutting Knife------------------------------------ 6-78Application #15: Car Park Control------------------------------------ 6-817. Useful Ladder Circuitry1-Cycle Differentiation Circuit------------------------------------ 7-1Flicker Circuit------------------------------------ 7-3Single-shot Circuit------------------------------------ 7-4Long-time Timer Circuit------------------------------------ 7-5ON/OFF - Delay Circuit------------------------------------ 7-6Push-on/Push-off Circuit (Binary Circuit)------------------------------------ 7-7Scanning Counter------------------------------------ 7-8Concept of IL Instruction and JMP Instruction------------------------------------ 7-9First-in Priority Circuit------------------------------------ 7-11Last-in Input Priority Circuit------------------------------------ 7-14Non-Lock-in Annunciator------------------------------------ 7-16Lock-in Annunciator------------------------------------ 7-198. Installation and Wiring ConsiderationsPLC Power Interruptions------------------------------------ 8-1Installation Site Considerations------------------------------------ 8-2Panel/Cabinet Installation Guide------------------------------------ 8-2General Precautions for Wiring------------------------------------ 8-3Power Supply Wiring------------------------------------ 8-4Countermeasures For Inductive Load------------------------------------ 8-59. Maintenance and TroubleshootingThe PLC Cycle------------------------------------ 9-1Self-diagnosis Functions------------------------------------ 9-2Non-fatal Errors------------------------------------ 9-2Fatal Errors------------------------------------ 9-2User-defined Errors------------------------------------ 9-3Programming Errors------------------------------------ 9-4Troubleshooting Flowcharts------------------------------------ 9-6Preventive Maintenance------------------------------------ 9-710. Appendices (A-E)AppendixA------------------------------------ A-1AppendixB------------------------------------ B-1AppendixC------------------------------------ C-1AppendixD------------------------------------ D-1AppendixE------------------------------------E-1

Touch Panel1-11. INTRODUCTION0 What is a Control System ?In general, a Control System is a collection of electronic devices and equipment which are in place to ensure the stability, accuracy and smooth transition of a process or a manufacturing activity. It takes any form and varies in scale of implementation, from a power plant to a semiconductor machine. As a result of rapid advancement of technology, complicated control tasks accomplished with a highly automated control system, which may be in the form of Programmable Controller (PLC) & possibly a host computer, etc. Besides signal interfacing to the field devices (such as operator panel, motors, sensors, switches, solenoid valves and etc.), capabilities in network communication enable a big scale implementation and process co-ordination besides providing greater flexibility in realizing distributed control system. Every single component in a control system plays an important role regardless of size. For instance, as shown in Fig 1.1 the PLC would not know the happenings around it without any sensing devices. And if necessary, an area host computer has to be in place to co-ordinate the activities in a specific area at the shopfloor.Process Control Computer

Touch PanelArea Host ComputerBZNetworkLimit switchSensorMotorSolenoidLightsBuzzerControl ComponentsFig. 1.1:It could also be an application as small as a single PLC controlling a single or some output devices.

1-21. INTRODUCTION

SensorTerminal BlockMagnetic ContactorMechanical structureRobot ArmPushbutton &Selector SwitchIndicatorsLightRevolvingSwitchesPLCRelays0 Typical Programmable Logic Controller-base Control SystemFig 1.2, is a typical application of a Gantry Robot Control Machine. It is used in a pick and place operation. The whole process sequence is controlled by a PLC. The various input devices such as selector switches, push buttons, togle switches, sensors are connected to the input of the PLC via the input terminal block. The output devices such as the revolving light, indicators, relays, contactors and solenoid valves are connected to the output terminals of the PLC. The whole process is controlled by a ladder program loaded into the PLC CPU memory. The program will execute a sequence automatically according to the pre-defined sequence of operations. Manual operation are also provided to allow operator to activate the machine manually by the switches, emergency push-button for the purpose of safety in case you need to stop the operation abruptly. In this application, the control system operates as a stand-alone operation

1-31. INTRODUCTION0 The Role of the Programmable Controllers (PLC)In an automated system, the PLC is commonly regarded as the heart of the control system. With a control application program (stored within the PLC memory) in execution, the PLC constantly monitors the state of the system through the field input devices' feedback signal. It will then based on the program logic to determine the course of action to be carried out at the field output devices.The PLC may be used to control a simple and repetitive task, or a few of them may be interconnected together with other host controllers or host computers through a sort of communication network, in order to integrate the control of a complex process.Input DevicesIntelligence of an automated system is greatly depending on the ability of a PLC to read in the signal from various types of automatic sensing and manual input field devices.

INPUTLimit SwitchTimerPhotoelectricSwitchRotary EncoderProximity SwitchPush-buttons, keypad and toggle switches, which form the basic man-machine interface, are types of manual input device. On the other hand, for detection of workpiece, monitoring of moving mechanism, checking on pressure and or liquid level and many others, the PLC will have to tap the signal from the specific automatic sensing devices like proximity switch, limit switch, photoelectric sensor, level sensor and so on. Types of input signal to the PLC would be of ON/OFF logic or analogue. These input signals are interfaced to PLC through various types of PLC input module.

1-41. INTRODUCTIONOutput DevicesAn automatic system is incomplete and the PLC system is virtually paralysed without means of interface to the field output devices. Some of the most commonly controlled devices are motors, solenoids, relays indicators, buzzers and etc. Through activation of motors and solenoids the PLC can control from a simple pick and place system to a much complex servo positioning system. These type of output devices are the mechanism of an automated system and so its direct effect on the system performance.However, other output devices such as the pilot lamp, buzzers and alarms are merely meant for notifying purpose. Like input signal interfacing, signal from output devices are interfaced to the PLC through the wide range of PLC output module.

1. INTRODUCTION0 What is a Programmable Controller ?A PLC consists of a Central Processing Unit (CPU) containing an application program and Input and Output Interface modules, which is directly connected to the field I/O devices. The program controls the PLC so that when an input signal from an input device turns ON, the appropriate response is made. The response normally involves turning ON an output signal to some sort of output devices.

Power Supply

Signals from Switches Sensor etcInput InterfaceCentral

Processing

Unit (CPU)Output InterfaceSignals to Solenoids Motors etcMemory

1-5Fig. 1.3: Block Diagram of PLCCentral Processing UnitThe Central Processing Unit (CPU) is a microprocessor that co-ordinates the activities of the PLC system. It executes the program, processes I/O signals & communicates with external devices.MemoryThere are various types of memory unit. It is the area that hold the operating system and user memory. The operating system is actually a system software that co-ordinates the PLC. Ladder program, Timer and Counter Values are stored in the user memory. Depending on user's need, various types of memory are available for choice:(a) Read Only Memory (ROM)ROM is a non-volatile memory that can be programmed only once. It is therefore unsuitable. It is least popular as compared with others memory type.(b) Random Access Memory (RAM)RAM is commonly used memory type for storing the user program and data. The data in the volatile RAM would normally be lost if the power source is removed. However, this problem is solved by backing up the RAM with a battery.

1-61. INTRODUCTION(c) Erasable Programmable Read Only Memory (EPROM)EPROM holds data permanently just like ROM. It dose not require battery backup. However, its content can be erased by exposing it to ultraviolet light. A prom writer is required to reprogram the memory.(d) Electrically Erasable Programmable Read Only Memory (EEPROM) EEPROM combines the access flexibility of RAM and the non-volatility of EPROM in one. Its contents can be erased and reprogrammed electrically, however, to a limit number of times.

1-71. INTRODUCTIONSCAN TIMEThe process of reading the inputs, executing the program and updating the outputs is known as scan. The scan time is normally a continuous and sequential process of reading the status of inputs, evaluating the control logic and updating outputs. Scan time specification indicates how fast the controller can react to the field inputs and correctly solve the control logic.

I/O UpdatePROGRAM SCANPROGRAM

01100010002TIM0#501000Factors influencing Scan TimeThe time required to make a single scan (scan time) varies from 0.1 ms to tens of ms depending on its CPU processing speed and the length of the user program. The user of remote I/O subsystems increases the scan time as a result of having to transmit the I/O updates to remote subsystem. Monitoring of the control program also adds overhead time to the scan because the controller's CPU has to send the status of coils and contacts to the CRT or other monitoring device.

1-81. INTRODUCTION Conventional Control Panel and Its DifficultiesIn the beginning of the Industrial revolution, especially in the 1960 & 1970, automated machines were controlled by electromechanical relays. These relays were all hardwired together inside the control panel. In some cases, the control panel was so huge that it could cover the entire wall. Every connections in the relay logic must be connected. Wiring is not always perfect, it takes time to troubleshoot the system. This is a very time consuming affair. On top of that, the relays have limited contacts. If modification is required, the machine has to be stopped, space may not available and wiring has to be traced to accommodate changes. The control panel can only be used for that particular process. It cannot be changed immediately to a new system. It has to be redone. In terms of maintenance, an electrician must be well trained and skillful in troubleshooting the control system. In short, conventional relay control panel are very inflexible.typical example of the conventional control panel is shown in Fig. 1.4Fig. 1.4: Typical Conventional Control Panel Disadvantage of Conventional Control PanelIn this panel we can observe the following points There are too many wiring work in the panel. Modification can be quite difficult. Troubleshooting can be quite troublesome as you may require a skillful person. !ower consumption can be quite high as the coil consumes power. Machine downtime is usually long when problems occur, as it takes a longer time to troubleshoot the control panel. ;rawings are not updated over the years due to changes. It causes longer downtime in maintenance and modification.

1-91. INTRODUCTION0 Programmable Controller Control Panel and Their AdvantagesWith the arrival of programmable controllers, the control design and concept improve tremendously. There are many advantages in using the programmable controllers.typical example of the PLC control panel is shown in Fig 1.5.Fig. 1.5: Typical PLC Control Panel0 Advantages of PLC Control Panel D Here are the major advantages that can be distinguishably realized. D The wiring of the system usually reduces by 80% compared to conventional relay control system. D The power consumption is greatly reduced as PLC consume much less power. D The PLC self diagnostic functions enable easy and fast troubleshooting of the system. D Modification of control sequence or application can easily be done by programming through the console or computer software without changing of I/O wiring, if no additional Input or Output devices are required. D In PLC System spare parts for relays and hardware timers are greatly reduced as compared to conventional control panel. D The machine cycle time is improved tremendously due to the speed of PLC operation is a matter of milliseconds. Thus, productivity increases. D It cost much less compared to conventional system in situation when the number of I/Os is very large and control functions are complex. D The reliability of the PLC is higher than the mechanical relays and timers. D An immediate printout of the PLC program can be done in minutes. Therefore, hardcopy of documentation can be easily maintained.

1-101. INTRODUCTION0 Conversion of Conventional Control Circuit to PLCExample 1: Starting and Stopping of a 3-phase motor.

Motor (1.5 kw)RYBCircuit BreakerNEMgStart Push -buttonIMgFig. 1.5ThTTvWPB1PB2MgStart

Push-buttonTHWhen the push-button PB1 is pressed, current I will flow through the circuit and energize magnetic contact Mg which in turn closes the Mg contacts. The contact Mg parallel the pushbutton PB1 is for self-holding so that PB1 can be released. The other Mg contacts closes to switch on the 3-pbase motor.To connect the above circuit in a PLC system to PLC wiring circuit, we need to identify the input and output devices. The input devices are start push-button (PB1) and stop push-button (PB2) and the output device in this case is only one magnetic contactor that controls the 3-phase motor. The wiring circuit is shown in Fig. 1.6

1. INTRODUCTION

ThCircuit BreakerRBVWFig. 1.6 Motor CircuitUMotor (1.5 kw)Mg

ENPB2Start Push-buttonPB1Stop Push-buttonDC24V+FUSE COMINPUTOUTPUTAssignmentInput = Channel 00 Output = Channel 10MgTh

Magnetic ContactorFig. 1.7 Hard Wire Circuit for PLC ConnectionPB1 (0000)PB2 (0001)

1000

Start Pushbutton1000

Stop Pushbutton

Control MgEND (01)

1-11Fig. 1.8 Ladder diagramFig. 1.7 shows the wiring circuit of the I/O devices.Fig. 1.8 is the ladder diagram for the conversion. It must be programmed into the PLC.

1. INTRODUCTION

12345678Example 2: Sorting Machine

CR1(Start)PB1(Stop)PB2N Begin Cycle 2, 3, 7CTR1CR

CR1CR1S1 ( Limit Switch)CR2Conveyor (0.1A) MotorRun LightSortingCylinder

PB2CRT 1S2 ( Limit Switch)CTR1CounterEnd Cycle Bell

1-12rtFig. 1.9 Conventional Circuit for Sorting MachineIn this example, you have to determine again the number of input and output devices used for the control circuit. Assign the I/O for the PLC and then wire it according to the actual I/O devices. The wiring circuit is shown in Fig. 1.10. The input devices such as PB1 is assign to the input 0, LS1 as input 1, LS2 as input 2 and PB2 as input 3. The output devices such as conveyor motor is assigned to output 1000, cylinder solenoid as output 1001 and End Cycle Bell as output 1002.

1. INTRODUCTION

+.:"nd !8cle (ell$!*20!onve8or +otor#1P(*I#P/.O/.P/.P(I:un ight.h!8linder )olenoidFig. 1.10 Wiring Circuit of PLC for Sorting Machine

!#.1*&&&P(1P(*

&&&&*&&&&&&9(egin !8cle)top*&&&

1&&&

)i % imit )witch'!onve8or +otor

4nd :/# ight

*&&1

&&&1*&&1)* % imit )witch'1&&1!8linder )olenoid!/!#.1 ON transi stion in its input signal. DIFD turns its output ON when it detect s an ON -> OFF transi stion in its input signal.

6. APPLICATION EXAMPLES OF BASIC COMMANDS0 Application #5: Filling/Draining Control Op eration

MV 1Control Panel

TLB1(5)TLB2(6)MV 2MPB1(0)PB2(1)PB3(2)PL(1004)BZ(1005)STARTSTOPRESETENDBUZZERI/O AssignmentsInputDevic e00000Start Button (PB1)00001Stop Button (PB2)00002Re set Button (PB3)00005Upper Level Switch (TLB1)00006Lower Level Switch (TLB2)ProcedurOutputD evice01000Water Supply Valve (MV1)01001Drain Valve (MV2)01002Stirring Motor (M)01004End Indicator01005Buzzer

1. 6-37A s the PB1 i s pressed, MV1 opens and the water begins to fill the tank. At the same time, the stirring motor M starts operations.2. When the water level passes TLB2 and reaches TLB1, the MV1 closes and the stirring motor stops.3. Next, MV2 opens and starts draining the water. When the water levels drops below TLB2, MV2 closes.4. When the cycle of operation has repeated four times, the operation END indicator illuminates, and the filling and draining operation will not restart even if PB1 i s pressed.

6. APPLICATION EXAMPLES OF BASIC COMMANDSLadder diagram : Main 1 Network 1Main 1 - Fill / DrainingFilling / Draining control operationNetwork 1 - Start condition

000_00010_05

010_04200_02000_01010_00

tartB7PLReachStopMV1010_00MV1200_04MV2clo seNetwork 2 - Stirring010_00010_02MV1StirrerNetwork 3 - Reach TLB 1000_05DIFU(13) TLB1200_01Reach TLB1Network 4 - Water reach TLB000_06200_01200_02TLB2ReachTLB1ReachNetwork 5 - Drain010_00000_05000_06010_01

MV1TLB1010_01MV2

TLB2MV2

6-38Network 6 - MV2 close010_01DIFD(14) MV2200_04MV2closeNetwork 7 - Pass TLB2000_06DIFD(14) 200_03TLB2PassTLB2

6. APPLICATION EXAMPLES OF BASIC COMMANDS

Network 8 - Counter Counter preset at 4

200.03CNTPassTLR2000.02047 Counter

#0004

ResetNetwork 9 - End indicationCNT047010.04CounterPL

Network 10 - Delay Delay for 2 seconds

PL010.04

TIM000#0020

Network 11 - BuzzerCNT047TIM000010.05

6-39CounterR7Network 12 - EndEND (01)

6. APPLICATION EXAMPLES OF BASIC COMMANDS0 Shift Register SFT(10)Shift Regi ster (SFT) shifts a 16-bit data in specified channel by 1 bit. Although thi s instruction shifts data within channel s, both a start channel and an end channel mu st be specified a s the data.

Ladder diagramOperand Data AreasINCP RSFT(10)S EI/O, Internal auxiliary RelayHolding Relay

Start CHEnd CH

001501020102010215001500

Example circuitLadder DiagramMnemonic cod

0000400005Re set0000200003Data InputClock PulseSFT(10)200200200001000Addr essInstructionData

0000LD00002

0001AND NOT00003

0002LD00004

0003LD00005

0004SFT(10)

200

200

0005LD20000

0006OUT1000

0003END(01)

6-40End(01) Note :When a reset input i s applied to the Shift Register, all 16 bits are reset together. If the Holding

Relay area i s used, the data are retained during power failure.

6-416. APPLICATION EXAMPLES OF BASIC COMMANDS0 Application #6: Overhead Crane Control of Degreasing OperationIn thi s application, the part need s to be degreased in the degreasing tank before being passed to the next section.

Left (1001)Right (1003)(S5)(S4)(S1)Buzzer(1004)Roller652Up Sensor (S3) 4 Down Sensor (S2) 3PB1 (Start)(0)Degreasing TanksOperatorOperatorUp (1000)Down (1002)(07)ResetStop Button (8)PB2 (1)When the PB1 i s pressed, the roller will coil up the hook until the up-sensor (S3). The hook will then transverse left (via 01001) until it reaches the S4 position.It will then stop and lower the product into the degreasing tank. When it reaches down to S2, the product will stay in the degreasing tank for 20 seconds. After the time i s up, the product i s lifted up and transverse left until S5 position and stop. It continue to come down. Until the down position, where the Buzzer will sound. The operator will collect the product and press the PB2 to return the crane back to the home position.

I/O AssignmentOutputD evice01000Up motor01001Left motor01002Down motor01003Right motor01004BuzzerInputD evice 00000PB1 (Start button) 00001PB2 (Return button) 00002S1 (Sensor 1) 00003S2 (Down sensor) 00004S3 (Up sensor) 00005S4 (Degrea se sensor) 00006S5 (End sensor) 00007RST (Re set button) 00008Stop (Stop button latch) 6-426. APPLICATION EXAMPLES OF BASIC COMMANDSAt anytime, the Stop Pu sh Button can stop the crane from moving. Upon release, it will continue from where it stop s. The Re set Push Button i s used when you want to start over again from the beginning.

6. APPLICATION EXAMPLES OF BASIC COMMANDSi adder diagram : Main 1 Network 1Main 1 -Program for degreasing tankNetwork 1 - Start Start operation

00000. 03000 . 02

PR1S2S1

DIFI T(13) 2

6-43Network 2 - Set 1st bit on Set 1st bit of HR 00 on

200. 00

MOV(21)

#0001

HR00

Network 3 - Shift Register

253.14

SFT(1 0)

NO200. 01

HR00

HR00. 09

HR00

END_OP000. 07

Rst

Network 4 - Shift operationThe shift register clock input to control the sequence of operation

HR00. 00000. 02000. 04200. 01200. 01

I TPS1S3HR00 . 01000. 05

i EFT1S4HR00 . 02000.03TIM000

DOWN1S2HR00 . 03000. 04

I TP2S3HR00 . 04000. 06

i EFT2S5HR00 . 05000. 03000. 01

DOWN2S2PR2HR00 . 06000. 04

I TP3S3HR00. 07000. 02

RIGHTS1HR00. 0R000. 03

DOWN3S2

6. APPLICATION EXAMPLES OF BASIC COMMANDSNetwork 5 - InterlockRIL(02)StopNetwork 6 - T TpHR00. 0001 0.

T TP_ MOTORT TP1

HR00. 03T TP2T TP3HR00 . 06

Network 7 - LeftHR00 . 0101 0.

LEFT_ MOTORLEFT1 HR00. 04LEFT2

Network 8 - DownHR00. 0201 0. 02

DOWN_ MOTORDOWN1 HR00. 05DOWN2 HR00. 0RDOWN3

Network 9 - Time delay Time delay for 20 secs

HR00. 02DOWN1TIM#02Network 1 0 - Buzzer

HR00 . 05. 0301 0. 04

DOWN2S2Buzzer

Network 11 - Right

HR00. 071 0. 03

6-44RIGHTFWD MOTOR

Network 12 - Close interlockILC(03)Network 13 - EndEND(01)

6-456. APPLICATION EXAMPLES OF BASIC COMMANDS0 Application #7: Parts SortinIn this application, effective products are detected and rejected from those being carried on the conveyor.Photoelectric sensor (PH1) serves as the data input to the shift register. The signal output from this sensor turns ON when a defective product has been detected; otherwise it remains OFF.Photoelectric sensor (PH2) is used as a clock generator that serves as the clock input to the shift register. It generates one pulse each time the product, spaced at a fixed interval from each other, has traveled a predetermined distance.From the moment a defective product is detected by PH1, it is traced by the shift register until the product arrives at the predetermined position on the conveyor where it is ejected by the magnetic valve MV.

6. APPLICATION EXAMPLES OF BASIC COMMANDS

Ladder diagramPH1SFTHRShift

3PH25314HRRegister

104HR0004MV Valve open for defective part

6END (01)

6-46Mnemonic codesAddressInstructionData

0000LD00002

0001LD00003

0002LD25314

0003SFTHR00

HR00

0004LDHR0004

0005OUT01 000

0006END (01)

6-476. APPLICATION EXAMPLES OF BASIC COMMANDS0 Application #8: Robot Movement Control

PH1 (4)(check grasp work)(counterclockwise rotation)(Detect workpiece)(Start button)PB1 (0)(clockwise rotation)LS3LS1 (1)LS2 (2)(3)conveyor B(1000) SOL 1(clockwise rotation)(counterclockwise rotation)conveyor A (1003)SOL2 (1001)This kind of robot is seen in many automated factories. As is apparent from the figure, this robot picks up a work being carried on conveyor A and places it on conveyor B.The operations and conditions are as follows:1. When the start button is pressed, the robot rotates its arm clockwise.2. When the robot arm has moved to the position of the work on the conveyor A, arm grasps the work.3. When the arm has grasped the work, it rotates counterclockwise.4. When the arm has rotated to the position of conveyor B, it releases the work.

6. APPLICATION EXAMPLES OF BASIC COMMANDS I/O AssignmentProcedure

Arm rotates CounterclockwiseArm rotates ClockwiseRelease workpieceConveyor A OFF Arm grasp workConveyor A ONPhoto

eye sense

workpiece?Start

Button

Pressed?Is

LS3

OFF?Arm atIs

LS3

ON?Arm atYesYesYesYesYesYesNoNoNoNoNoNo6-48InputDevices

0000PB1(start button)

0001LS1(clockwise rotation)

0002LS2(counterclockwise rotation)

0003LS3(checking grasped work)

0004PH1(detect workpiece)

0005Stop button

0006Reset button

OutputDevices

1 000Sol 1(clockwise rotation)

1 001Sol 2(counterclockwise rotation)

1 002Sol 3(grasping work)

1 003Conveyor A

200. 01200. 01HR01. 01HR00. 00000. 01StopsignalClockClock. 00000. 02200.MOV(21)HR00. 05#0001KEEP (11)HR01. 00 StartconditionResetStopssignalNetwork 2 - StartHR01.StartconditionDIFU(13)200.Network 3 - Set 1st bit on Set 1st bit of HR 00 onHRNetwork 4 - Shift registerStartI .S206HR01. 01253.14SFT(1 0)HRHRSenuence2PH1HR00. 02000. 03Senuence3I .S3HR00. 03000. 02Senuence1I .S1HR00. 01000. 04Normaloff200. 01Clock000. 06HR1 01

6. APPLICATION EXAMPLES OF BASIC COMMANDSNetwork 6 - Stop condition

. 05KEEP(11)HR01. 01 StopsignalStopStart.Network 7 - Arm clockwiseHR00. 0001 0.

Sermence1Armclkwise

Network 8 - Conveyor AHR00. 0101 0. 03Seauence2ConveyorA

Network 9 - GraspHR00. 02HR00. 04200. 021 0. 02

GraspSenuence31 0. 02Grasp

Network 1 0 - Arm anticlockwiseHR00. 0301 0. 01

Sermence4

Armanticlk

Network 11 - Reset Reset after stop

HR00. 01000. 06200. 02

6-5StopsignalReset

Network 12 - EndEnd(01)

InputDevices 00000Stop PB 00001LS1 (HOME) 00002 LS2 00003Start PB 6-516. APPLICATION EXAMPLES OF BASIC COMMANDS0 Application #9: A Simple Sequence Control ConceptWhen the start button is pushed, the motor (M) will move from left to right. When LS2 is ON, the Motor stops, delay for 5 seconds and then moves back to Home. When LS1 (Home) is ON, Motor cuts off, signifying that the sequence is completed.

LS1 (1)LS1 (2)Stop PBStart PB(3)M1 000 (Motor Right) 1 001 (Motor Left)HOMEI/O AssignmentOutputDevices01 000Motor (right)01 001Motor (Left)

1LS1LS23

12

Motor (Right)

Start PB125 sec DelayLS2TIM#511 001Motor (Left)1 001LS1

6-526. APPLICATION EXAMPLES OF BASIC COMMANDS0 Example : PBC Packing ConveyorPiston

Start ( 0)Stop (1)RST (5)Proximity switch (4)RS1(2)Limit Switch(6)RS2(3)Lifter motorDown (1 004)Up (1 001)Conveyor motor (1 000)TrayIn this application, a lifter motor is used to lift a tray of PCB boards up, before being pushed by the piston onto the conveyor for packing.When the start button is pressed, the conveyor motor and the lifter motor will turn on. The proximity switch will temporarily stop the lifter motor for the piston to push the PCB onto the conveyor belt.After the PCB is pushed, the piston will retract and the lifter motor starts again. The whole procedure will repeat itself thereafter.

I/O AssignmentOutputDevice01000Conveyor motor01001Up Lifter motor01002Right piston01003Left piston01004Down lifter motorInputDevice 00000Start Push Button 00001Stop Push Button 00002RS1 ( Left Limit) 00003RS2 (Right Limit) 00004Proximity Switch 00005 Reset 00006Limit Switch 6-536. APPLICATION EXAMPLES OF BASIC COMMANDSWhen all the PCBs have been pushed onto the conveyor belt, the lifter motor will move down until the limit switch (LSW) is being activated. Thereafter, the whole procedure can only be started by the start switch.

6. APPLICATION EXAMPLES OF BASIC COMMANDSdder diagram : Main 1 Network 1Main1 PCB packing conveyor program utilising (Conventional method)Network 1 Start / Stop control000.00000.01CNT001010.00

StopConveyorStart010.00Conveyor

6-54Network 2 - Left limitLeft limit reached for piston

010.00000.06DIFU(13)

ConveyorLSW

200.00

Network 3 - Lifter up Lifter motor up

200.00200.02CNT001010.01

010.01LifterstopUp

Up200.03

Network 4 - Index switchProximity switch detect the next index of PCB

000.04DIFU(13)

Proximitysw

200.01

Network 5 - Lifter upLift the PCB up one after another

200.01010.02200.02

200.02RightLifterstopTIM

000 delay

Lifterstop

110010

Network 6 - Pistonright

000.02TIM000000.03010.02

RS1( LEFT LIMIT)Delay010.02RS2(RIGHTLIMIT)Right

Right

6-556. APPLICATION EXAMPLES OF BASIC COMMANDS

Network 7 - PistonleftMove piston after right limit is reached

000.03010.03 Left

RS2(RIGHT LIMIT)

Network 8 - Pistonleft

010.03000.02

DIFU(13)

LeftRS1( LEFTLIMIT)

200.03

Network 9 - Counter Counter preset at 20

200.03

CNT

000.05CNT001

001

0020

RST

Network 10 - Delay of 1 sec

CNT001

TIM

002

0010

Network 11 - Liftdown

200.02TIM002010.04 Down

RS1( LEFT LIMIT)3

Network 12 - End

End (01)

6-566. APPLICATION EXAMPLES OF BASIC COMMANDSdder Diagram : Main 1 Network 1Main 1 - SFT (10) methodPCB packing conveyor program utilising (shift register method)

Network 1 - Conveyor

000.00000.06000.02000.01010.00

StartLimitswitchRS1010.00StopConveyor

Conveyor

Network 2 - Set bit

010.00

DIFU(13)

Conveyor

200.00

Network 3 - Set 1st bit Set first bit of HR 00 on

200.00CNT001

MOV(21)

HR00.03#0001

HR00

Network 4 - Shift register

253.14

SFT(10)

200.01

HR00

HR00.05

HR00

Network 5 - ClockClock input to shift register to control sequence of operations

HR00.00000.04200.01200.01

ProximityswHR00.01000.03

RS2HR00.02000.02

RS1HR00.03CNT001

HR00.04000.06

imitswitchNetwork 6 - CounterHR00.02

6-576. APPLICATION EXAMPLES OF BASIC COMMANDSCounter preset at 20CNT

000.05CNT001001Reset#0020

Network 7 - Lifter upHR00.00010.01ifterupNetwork 8 - Piston rightHR00.01010.02PistonrightNetwork 9 - Piston leftHR00.02010.03PistonleftNetwork 10 - Lifter downHR00.04010.04ifterdownNetwork 11 - EndEnd (01)

I/O AssignmentOutputDevices01000Motor to raise door01001Motor to lower doorMotorPhotoInputDevices 00000Ultrasonic switch 00001Photoelectric switch 00002Door upper limit switch 00003Door lower limit switch 6-586. APPLICATION EXAMPLES OF BASIC COMMANDS0 Application #10: Autom atic Control Of Warehouse Door

Door positionRIftricPushbuttonCPM2Aleri Switch ectThe input ultrasonic switch is employed to detect the presence of an approaching vehicle. A separate photosensor detects the passing of a vehicle via the interruption of the light beam. In response to these signals, the control circuit controls the outputs that drive the motor of the door for opening and closing.

6. APPLICATION EXAMPLES OF BASIC COMMANDSdder diagram : Main 1 Network 1Main 1 - AutodoorThis program shows the automatic control of warehouse doorNetwork 1 - Raise door000.00000.02010.01010.00

RaisedoorUltraswitch010.00UpperLSLowerdoorRaisedoor

Network 2 - PhotosensorSense until differentiation down

000.01DIFD(14)200.00Photosensor

00000 Ultrasonic switch 00002 Upper limit switch 10000 Motor to raise door 00001 Photoelectric switch 04000 DIFD00003 Lower limit switch 10001 Motor to lower door6-59Network 3 - Lower door

010.01200.00000.03010.00werLSRaisedoorLowerdoor010.01werdoorNetwork 4 - EndEnd (01)Timing diagram

I/O AssignmentInputDevices00000Position detection (S1)00001Lower limit of oil (S2)OutputDevices01000Electromagnetic valve for oil supply (V1)01001Oil shortage alarm indicator6-606. APPLICATION EXAMPLES OF BASIC COMMANDS0 Application #11: Autom atic Lubrication of Gear

S2 (1)Lubricating Oil TankOil shortage alarm indicatorV1 (1000)S1(0)When the gear is moved towards S1, the sensor S1 will detect the gear and signal the electromagnetic valve for oil supply on the gear. The valve (V1) will open for a short period of time, supplying a predetermined quantity of oil. When sensor S2 sense that the lubricating tank oil level is low, the oil shortage alarm indicator will be ON.

6. APPLICATION EXAMPLES OF BASIC COMMANDSdder Diagram : Main 1 Network 1Main 1 - Auto lubricate Auto lubricate of gear

Network 1 - Start

DIFU(13)200.00000.00Positiondet

Network 2 - Open valve Open valve and delay 1.5 sec

1 scan time1.5 sec000000400010000TIM 0000000110001Position detection DIFUValve OpensTimer's preset timeLower limit of oil levelOil shortage alarm indicator6-61200.00TIM000010.01

010.00ValvecloseValveopensTIM000Valveclose

Valveopens

#0015Network 3 - Oil shortage000.01010.01

werlevelOilshortage

Network 4 - EndEnd (01)Timing diagr am

I/O AssignmentInputDevices00000Sensor 100001Sensor 200002Sensor 3OutputDevices01000Motor 101001Motor 201002Motor 36-626. APPLICATION EXAMPLES OF BASIC COMMANDS0 Application #12: Conveyor Belt Motor ControlIn this application, the PLC is used to start and stop the motors of a segmented conveyor belt. This allows only belt sections carrying an object (i.e. mental plate) to move. The position of a mental plate is detected by a proximity switch located next to each belt segment. As long as the plate is within the detecting range of the switch, the motor will work. If the plate moves beyond the range, a timer is activated and when this set time has lapsed, the motor of that belt stops.

Motor 3 (1002)Sensor 1Sensor 2Sensor 3Copper plateMotor 2Motor 1 (1000)CPM2A

S3Motor26. APPLICATION EXAMPLES OF BASIC COMMANDSLadder diagram : Main 1 Network 1Main 1 - Conveyorcontrol Conveyor belt control application

Network 1 - Motor2000_02ITM000010_01

010_01Motor2

Network 2 - Motor1

000_01I001010_00TM

S2010_00Motor1

Motor1

Network 3 - Delay for 2sec

010_00000_01

IIM

Motor1S2

000

#0020

Network 4 - Sensor1

000_00I001200_00TM

S1200_00

Network 5 - Delay for 2sec200_00000_00

S1IIM001#0020Network 6 - Motor3253_13010_02

6-63NCMotor3

Network 7 - EndEnd (01) Operation :a) Motor 2 turns ON when Sensor 3 detects the productb) Motor 2 i s ON until Motor 1 i s turned ON and product i s out of detection range of Sensor 2c) Motor 1 turns ON when Sensor 2 detects the productd) Motor 1 i s ON until product i s out of detection range of Sensor 1

6. APPLICATION EXAMPLES OF BASIC COMMANDSu Move - MOV(2 1)MOV transfer source data (either the data in a specified channel or a four digit hexadecimal constant) to a de stination channel. Therefore, MOV require s two data parameter s to be specified: the source channel or constant and the de stination channel.Operand Data Areas

S: Source channelIR, SR, AR, DM, HR, TC, LR, #D: Destination channelIR, AR, DM, HR, LRLadder SymbolsMOV(21)S

D

6-64Example circuit Ladder diagram25313

MOV(21)000200

Source Destination

AddressInstructionData

0000LD25313

0001MOV(21)

000

200

0003END (01)

6. APPLICATION EXAMPLES OF BASIC COMMANDSThe following diagram illustrate s the MOV operation:SOURCEDESTINATIONINPUTOUTPUTCH 000CH 200

000001000011000020000031000041000050000060000071000081000091000101000110000120000130000140000151200001200011200020200031200041200050200060200071200081200091200101200110200120200130200140200151Channel 000 bit 00tobit 15Channel 200 bit 00tobit 15

6-65StatusStatuIn this case, data in Input Channel 000 i s moved to Output Channel 200.

6-666. APPLICATION EXAMPLES OF BASIC COMMANDS0 Application # 13: Display Error Code Of Machine To Aid In Tracing The Source Of The Problem1. Activation of error input signal 00001 to 00004 will sound an alarm and at the same time di splay the error code.2. Input 00005 serve s to re set the error code di splayed upon machine recovery.Error code

CodeFault location

001Feeding section problem Check Sensor No: S01 Check Limit Switch No: L03

002Labeling Unit FaultCheck Contactor No: C01

003Conveyor JamCheck Label Sensor No: S05

004Emergency stopCheck Emergency Stop button

6. APPLICATION EXAMPLES OF BASIC COMMANDSDiagramI/O Assignment

OutputDevices1000AlarmAnnunicatorEmergency Stop buttonCODE 004

Fault location

CODE 002 fault location

Label Sensor S05Labeling unitMotorConveyorLimit Switch L03Sensor S01

CODE 001 fault locationCODE 003

fault locationInput Devices 00001 PB1 00002 PB2 00003 PB3 00004 PB4 6-67

6-686. APPLICATION EXAMPLES OF BASIC COMMANDSLadder Diagram : Main 1 Network 1Main 1 - Error DisplayDisplay error code of machine to aid tracing source of problem

Network 1 - Alarm

000_01010_00 Alarm

PR1

000_02

PR2

000_03

PR3

000_04

PR4

Network 2 - Code 1

Feeding Problem

000_01

MOV(21)

PR1

#0001

010

Network 3 - Code 2

No Label

000_02

MOV(21)

PR2

#0002

010

Network 4 - Code 3

Conveyor Jam

000_03

MOV(21)

PR3

#0003

010

Network 5 - Code 4

Emergency Stop

000_04

MOV(21)

PR4

#0004

010

Network 6 - Code 5

Reset Code Display

000_05

MOV(21)

Resetsw

#0000

010

Network 7 - End

End (01)

6. APPLICATION EXAMPLES OF BASIC COMMANDS0 Compare - CMP(20)Compare (CMP) i s used to compare the data in a specific channel, with the data in another channel, or a four-digit, hexadecimal constant. Therefore, two data mu st be specified immediately after the CMP(20) instruction.Operand Data Areas

Cp : First compare wordIR, SR, AR, DM, HR, TC, LR, #Cp2 : Second compare wordIR, SR, AR, DM, HR, TC, LR, #Ladder SymbolsCMP(20)Cp 1Cp 2

25506 (=)25507 ()CMP(20)#01F0000TR 0010000100101002253136-69AddressInstructionData

0000LD25313

0001OUTTR 0

0002CMP(20)

#01F0

000

0003AND25505

0004OUT01000

0005LDTR 0

0006AND25506

0007OUT01001

0008LDTR 0

0009AND25507

0010OUT01002

6. APPLICATION EXAMPLES OF BASIC COMMANDSThe following diagram illustrates the CMP operation

ItDATA00 0 0 0 1 1 1 1 1 0 00000Constant

Compare with

ChannelCH 000DATA

It01F0

If the constant (It01F0) i s equal to Channel 000 data, special relay 25506 turns ON. However, special relay 25505 will turn ON if the constant i s greater than Channel 000 data and special relay 25507 will turn ON if the constant i s less than Channel 000 data. At any one time, only one result i s true, either relay 25505(>) or 25506(=) or 25507( > >

AddressInstructionData

00000LD00000

00001LD01005

OR 1

00002KEEP(11)HR 0100

00003LDHR 0100

00004@MOV(21)

# 0009

6

00005LD25313

00006AND NOT TIM001

00007TIM1

#0012

00008LDHR 0100

00009AND TIM1

00010@DEC(39)

6

00011LD25313

00012OUT TR0

00013ANDHR 0100

00014CMP(20)

6

# 0000

00015LD TR0

00016AND25506

00017OUT00500

00018LD00500

00019OR01005

00020AND NOT TIM0

00021AND NOT1

00022OUT01005

00023LD00500

00024OR00501

00025OUT TR0

00026AND NOT1

00027AND NOTTIM 000

00028OUT00501

00029LD TR0

TIM000

00030# 0050

00031LD00001

00032ORTIM 000

00033MOV(21)

# 0000

6

00034LD600

00035OUT1000

00036LD601

00037OUT1001

00038LD602

00039OUT1002

00040LD603

00041OUT1003

00042END(01)

CommentComment Statement

6-74Start PbHolding Relay Move 9 toClk PulseDecrement o/p every clkCompare the o/p with

Condition meet ON bit On BUZZERTimer to cut the buzzerSTOP PBRESET CH1248

6. APPLICATION EXAMPLES OF BASIC COMMANDS0 Add - ADD(30)ADD totals the data in two different channels, or one channel and a constant and then outputs the sum to a third channel.Therefore, three data parameters must be specified : an augend, an addend and a result channel.Operand Data Areas

R: Result channel

IR, AR, DM, HR, LRAu: Augend channelIR, SR, AR, DM, HR, TC, LR, #Ad: Addend channelIR, SR, AR, DM, HR, TC, LR, #Ladder SymbolsADD(30)AuAd R

AddressInstructionData0000LD000000001CLC(41)0002ADD(30)HR04#12342000004END(01)Augend Addend Result00000CLC(41)ADD(30)HR04#12342006-75Example circuit

Ladder diagram

6. APPLICATION EXAMPLES OF BASIC COMMANDSIn the program, when input 00000 is turned ON, the data in internal relay HR040 is added to the constant 1234. The result of the addition is output to CH 200. If a carry is generated as a result of the addition, the carry flag (special relay 25504) is turned ON. If the result of the addition is 0000, special relay 25506 (the "=" flag) is turned ON.The following diagram illustrates the ADD operation.AugendAddend

Result

Internal auxiliary relay CHCH 200HR 04

carry255040+ 1234 +100002 010 010001211000222100032 310004201000521100062210 1100072 3100082 01000921100102210 2100112 3100122 01001321100142210 3100152 3carry255040/1

In the above example, before executing ADD, the Carry Flag/CY (special relay 25504) is turned OFF by the Clear Carry (CLC). The addition and subtraction instructions include CY in the calculation as well as in the result. Be sure to clear CY if its previous status is not required in the calculation, and to use the result placed in CY, if required, before it is changed by execution of any other instruction.The augend and addend must be in BCD, if not special relay 25503 (Error Flag) is turned ON and ADD is not executed.

04000200400121040022210 0040032 304004200400521040062210 1040072 304008200400921040102210 2040112 3040122 00401321040142210 3040152 36-76ADD is executed each time the CPU scans the program. To execute it only once.

6. APPLICATION EXAMPLES OF BASIC COMMANDSu Subtract - SUB(31)S UB finds the difference between the data in one channel and the data in another channel or a constant, and then outputs the result to a third channel.Therefore, three data must be specified : an minuend, an subtrahend and a result channel.Operand Data Areas

R: Result channel

IR, AR, DM, HR, LRMi: Minuend channelIR, SR, AR, DM, HR, TC, LR, #Su: Subtrahend channelIR, SR, AR, DM, HR, TC, LR, #Ladder SymbolsS UB(31)MiSu R

Example circuit Ladder diagram00000CLC(41)S UB(31)HR04#1234200Minuend Subtrahend ResultAddressInstructionData

0000LD00000

0001CLC(41)

0002S UB(31)

HR04

#1234

200

0004END (01)

6-77In the above example, before executing SUB, the Carry Flag (special relay 25504) is turned OFF by the Clear Carry (CLC). The addition and subtraction instructions include CY in the calculation as well as in the result. Be sure to clear CY if its previous status is not required in the calculation, and to use the result placed in CY, if required, before it is changed by execution of any other instruction.The minuend and subtrahend must be in BCD, if not special relay 25503 (Error Flag) is turned ON and ADD is not executed.SUB is executed each time the CPU scans the program. To execute it only once.

6. APPLICATION EXAMPLES OF BASIC COMMANDS0 Application #14: Measuring The Life Of A Cutting KnifeA knife is used to cut 3 products A, B and C and has to be changed after cutting 1000 pieces of A or 500 pieces of B or 100 pieces of C. but the products come at random. A buzzer is sound when the life of the knife is up.3 sensors are assign to differentiate the 3 products. Another sensor is used to signal cutting completion. A pushbutton to start the process.

I/O AssignmentOutputDevice01000Buzzer01001Cutter (Knife)Start Push-button (4)Reset Push-button (5)Buzzer (1000)Product A, B or CKnife (1001)

InputDevice 00000Cutter Sensor00001Product A 00002 Product B 00003Product C 00004Start pushbutton 00005 Reset6-78Cutting Machine

6. APPLICATION EXAMPLES OF BASIC COMMANDS

Ladder Diagram : Main 1 Network 1Main 1 - Knife liftApplication : Measuring the life of a cutting lifeNetwork 1 - Cutter Cutter activation

Start010.01200.00000.00010.01CutsensorCutterCutterNetwork 2 - Cutter Cutter start pushbutton

000.04StartpbDIFU(13)200.00 Start

Network 3 - Add 1

200.00000.01StartProductACLC(41)ADD(30)HR00 add2 #0001HR00 add 2

Network 4 - Add 2200.00000.02CLC(41)

Mnemonic codesAddressInstructionData

0000LD20000

0001OR01001

0002AND NOT00000

0003OUT01001

0004LD00004

0005DIF U(13)20000

0006LD20000

0007AND00001

0008CLC(41)

0009ADD(30)

HR00

#0001

HR00

0010LD20000

0011AND00002

0012CLC(41)

0013ADD(30)

HR00

#0002

HR00

0014LD20000

0015AND00003

0016CLC(41)

0017ADD(30)

HR00

#0010

HR00

StartProductB

ADD(30) HR00 add2 #0002HR00 add 2

Network 5 - Add 10200.00000.03CLC(41)

StartProductC6-79ADD(30)HR00 add2 #0010HR00 add 2

6. APPLICATION EXAMPLES OF BASIC COMMANDS

Network 6 - Compare#1000200.01255.06200.02255.07CPM(20)HR00 add2=Flag Flag

6-82Network 6 -End (01)

I/O AssignmentOutputDevice01000Top cylinder01001Bottom cylinder01002PusherInputDevice 00000Start PB 00001Ball sensor (S1) 00002Colour sensor ( S2) 00003Stop PB 6-836. APPLICATION EXAMPLES OF BASIC COMMANDS0 Example: Ball Sorter Mechanism

Hopper with 2 colour balls (black &white)Top CylinderBottom CylinderIn this application, the system is to sort out the black & white balls into 2 different container.The start button will start the operation, Ball sensor ( S1) will sense the presence of the ball in the hopper. The top solenoid will release the ball for the colour sensor ( S2) to differentiate the colour before being release into the container.

6. APPLICATION EXAMPLES OF BASIC COMMANDSLadder Diagram : Main 1 Network 1Main 1 Ball Sorting (Conventional Method)Network 1 - Start cond

000.00000.03200.01

topStartcondtart200.01tartcond

BottomcylinWhite TIM0036-84Network 2 - Top cylinder

20i0 0V1000.01200.03010.00

StartcondS1010.00Topcylinder

Topcylinder

Network 3 - Timer

010.00

TIM

Topcylinder

000

#0015

Network 4 - Delay

TIM000TIM004200.03

200.03

Network 5 - White&black

200.03000 02

TIM

Colorsense000.02001 White

#0005

TIM

Colorsense

002 Black

#0005

Network 6 - Bottomcylinder

TIM001010.01

6. APPLICATION EXAMPLES OF BASIC COMMANDSNetwork 7 - Delay 0.5sec

010.01Bottomcylin

TIM004#0005

Network 8 - Pusher

TIM002Black010.02Pusher

TIM

003#0010

6-85Network 9 - EndEnd(01)

topCondtart200.00CondLadder Diagram : Main 1 Network 1Main 1 - Balls sortingThis program separates white balls from black balls using the shift register methodNetwork 1 - Start000.00000.03200.00Network 2 Differentiation up200.01DIFU(13)200.00CondClock000.03hift.036-866. APPLICATION EXAMPLES OF BASIC COMMANDSNetwork 3 - Set bit 1 on First bit of HR 00 is set

200.01HR00.04hift.04MOV(21)#0001HR00 Shift

Network 4 - Shift register253.14

No200.02FT(10)HR00 Shift

HR00 Shift

topNetwork 5 - Process

1S2

TIM003HR00.03TIM001000.02hift.01HR00.02HR00 0000.01200.02200.02ClockClockTIM000HR00.01hifthift.00Process sequencing clock input to shift register

Pusher6. APPLICATION EXAMPLES OF BASIC COMMANDSNetwork 6 - Set bit 1 onHR00.01010.00

hift.01ToDcv

TIM

001#0010Network 7 - Set bit 1 onHR00.03010.00

hift.03Botcv

TIM001

#0010Network 8 - Delav 1sec

HR00.02000.02

TIMhift.022002

#0010Network 9 - Pusher

TIM002HR00.04010.02

010.02hift.04Pusher

TIM003

6-87#0010Network 10 - EndEnd(01)

7. USEFUL CIRCUITRY

Signal(input signal)7-11 - Cycle Differentiation CircuitDescriptionDifferentiation up circuit operates for only one cycle time when an input signal turns on (i.e., at the leading edge of the input signal).

Signal(input signal)TDifferentiation outputT: 1 cycle execution timeDifferentiation down circuit operates for only one cycle time when an input signal turns off (i.e., at the falling edge of the input signal).Differentiation output

TApplication exampleUsing the 1-cycle differentiation up circuit when an arithmetic operation is to be executed only once at the leading edge of an input signal (i.e., when the input signal turns on), when a given program (A, in the example below) is to be executed only once at the leading edge of the input signal, etc. To execute the arithmetic operation, the given program, etc., only once at the trailing edge of an input signal (i.e., when the input signal turns off), use the 1-cycle differentiation down circuit.I/O AssignmentSignal (input signal)0000Differentiation output0200.utput relay1000.utput relay1001

Circuit Example 1

DIFU (13)02001000 .utput(DIFU)0200Differentiation up outputDIFU (13)0200IMP (04)Differentiation up outputProgram AIMP (05)DIFD (14)0200Differentiation Down output02001001 .utput00000000(DIFU)02000000(DIFD)Write theand JMEand after program A, respectively.This circuit causes program A to be executed only once at the leading edge of input signal 0000.instructions beforeCircuit Example 2This circuit is an application example of the differentiation circuit using an auxiliary relay.Signal (input signal)0000Differentiation output1000Auxiliary relay1001

7. USEFUL CIRCUITRY

00000000000002010000DIFU (13)0200Differentiation up output101001001000 Differentiation up output0000(DIFU)0200JMP (04)Program AJMP (05)Differentiation down outputThis circuit causes program A to be executed only once at the leading edge of input signal 0000.

Write theJMPandJMEinstructions before

10017-2and after program A, respectively.

7. USEFUL CIRCUITRY

Flicker CircuitDescriptionThis circuit repeat outputs at specified .N/.FF intervals when a signal (input signal) is applied.Signal(input signal)Flicker output

T1 T2T1, T2: Specified .N and .FF timesApplication examplesUse this circuit for the count input of a long-timer (using a CNT instruction), the flickering failure indication of an annunciator, the timing generation of a relay circuit, etc.I/O AssignmentSignal (Input signal)0000Flicker outputrelay 10001-sec clock pulseAuxiliary relay 25502Circuit ExampleThe circuit examples below are applicable to many PLCs. (1) Timers are used.0000TIM002

TIM001.N time 1 sec

(2) 1- sec clock pulse (Auxiliary relay 25502) is usedT1: 00003200T2 T1 T2 T1 T2 T1T2T1Flicker

output10000000255020.5 secT2: This time changes depending on the program position.(3) 1-cycle execution time i s used

1000Flicker

output0000100000001000

T2 T2 T2 T2 T2 T2

T1: This time changes depending on the program position.T2: 1-cycle execution time

TIM0010000TIM001

TIM0021000

.ff time 2 secFlicker output

00003200

T17-3T1 T2 T1 T2 T1 T2 T1T1: 1 secT2: 2sec

7. USEFUL CIRCUITRY

7-4Single-shot CircuitDescriptionThis circuit is used to keep the .N time of a single (input signal) constant.

Signal(input signal)Differentiation outputTTT: Single-shot time (constant)I/O AssignmentSignal (Input signal)0000Single-shot outputrelay 1001.utput relay 1000

Circuit Example

00001000TIM0011000Single-shot time 3 sec1000TIM001TIM0011001Single-shot output1000This circuit is applicable to many PLCs.

7. USEFUL CIRCUITRY

Long-Time Timer CircuitDescriptionThe timers can be set to a maximum of 999.9 sec. Use this circuit if the time setting exceeding this maximum is required.

Timer outputTimer .N conditionTime setting (999.9 sec min)I/O AssignmentTimer .N condition0000Timer output: .utput relay 1002

The circuit examples below are applicable to many PLCs.(1) A combination of two timers0000500 secTIM1TIM001Circuit Example

(2) A combination of a timer and a counter

0000TIM001TIM0015 secCNT0021002 Timer output2,000 counts0000TIM001With this combination, a 10,000-sec (5sec x 2,000 counts) timer circuit is configured.Timer TIM001 is used to generate 5-sec pulses which are then counted by counter CNT002 to 2,000 counts.When the CNT instruction is used, the present value of the timer is retained during a power failure.(3) A combination of a 1- sec clock (25502) and a counter (memory retentive type timer)

TIM002800 secTimer output1002TIM2CNT001#50000000255020000

CNT001

1002 Timer output

Without two timers, a 1,300-sec (500 + 800sec) timer circuit is configured.A timer circuit of 1999.8 sec (999.9 + 999.9sec) maximum can be configured.

With this combination, a 5,000-sec timer circuit is configured.

7-5Special auxiliary relay 25502 generates a 1-sec clock.When the CNT instruction is used, the present value of the timer is retained during a power failure.

7. USEFUL CIRCUITRY

7-6ON/OFF-Delay CircuitDescriptionThis circuit is used to delay the .N/.FF time of a signal (input signal) for a given time.Signal (input signal) .N/.FF delay output

T1T2T1 : .N-delay timeT2 : .FF-delay timeApplication exampleWhen a data input (BCD) and a data read input are received simultaneously from external devices, it is necessary to turn on the data read input after data has been accepted. With consideration given to the non-uniformity of response time among the input cards, use an .N-delay circuit for the data read input.

I/O AssignmentSignal (input signal) 0000.N/.FF-delay output : .utput relay 1003Circuit Example

100300000000TIM001TIM001TIM0021003.N/.FF-delay1003output0.1sec .N-delay time0.1sec.FF-delay timeTIM002The circuit examples below are applicable to CPM1

7. USEFUL CIRCUITRYPush-On/Push-Off circuit (Binary Circuit)

0000 (DIFU)0200DIFU(13)0200IMP (04)Description

InputOutputThis circuit repeat outputs at specified ON/OFF intervals when a signal (input signal) is applied.

1 2 3 4 50000IMP (05)1000 Output

IMP (04)00000200

I/O Assignment

(DIFU)00000200100002001000Set Reset1000 OutputInput0000Output1000Work bit020002010202Circuit ExamplesWhen data retention during power failure is unnecessary

1000

IMP (05)1000 Output

02000000When data retention during power failure is unnecessary0000DIFU(13)0200differentiation1-scan(DIFU)

DIFU(13)0200

1-scan differentiation (clock)

0200HR0000(DIFU)0200HR000002010201

0201 ON Condition0202 OFF ConditionKEEP(II) Holding relay HR0000 HR0000

0000(DIFU)020010001000Always onCNT0000000 ilur53131000HR000

DIFU(13)0200

(DIFU)02000201 On Condition0202 Off Condition1-scan differentiation (clock)

1000 OutputIn

Down counterCNT000R=0002CMP(20) CNT000

1002=0001

02010201000 Output50(=)

7-7Auxiliary relay 25313 is normally ON. Auxiliary relay 25506 turns ON if the result when the Compare (CMP) instruction is executed is equal.

7. USEFUL CIRCUITRYScanning CounterDescriptionThis circuit is used to count scan clocks to obtain timing at a very precise pulse duration.1 scan

1 2 3 4 5 6 7Scan clockCount input (0000)Count output (1005)TT = 1 scan x 7 (count value)I/O AssignmentCount input0000Count output1005Work bit2000Circuit Example000

000 1-scan clock

2000InCNT000 Down

0000R #0007 counter

CNT000

7-81005 Count output

7. USEFUL CIRCUITRYConcept of IL Instruction and JMP instruction

Description

7-9The IL instruction must always be used in conjunction with an ILC instruction, e.g., IL-ILC or IL-IL-ILC. When the IL condition is logical 1, the programs between the IL and IC instructions are executed according to the ladder diagram. When the IL condition is logical , all the output relays, internal auxiliary relays and timers in the programs between the IL and ILC instructions are turned OFF, and any counters, shift registers, holding relays and data memory relays in the same programs are held in their present status.The JMP instruction must always be used in conjunction with a JMP instruction, e.g., JMP-JMP or JMP-JMPJME. When the JMP condition is logical 1, the programs between the JMP and JME instructions are executed according to the ladder diagram. When the JMP condition is logical, all the output relays, internal auxiliary relays, timers, counters, shift register, holding relays and data memory relays in the same programs are held in their present status.Combination of IL and JMP instructions with combinations such as IL-JMP-ILC-JME and JMP-ILJME-ILC, the CPU cannot execute programs properly and must therefore be avoided. However, with combinations such as IL-JMP-JME-ILC and JMP-ILILC-JME, the CPU performs program execution without problem.

Circuit Example

ILXProgram A

JMPYProgram BJMEProgram CILC

JMPYProgram A

ILXProgram BILCProgram CJME

7-107. USEFUL CIRCUITRYLegendX: IL conditionY: JMP conditionA: The programs are executed according to the ladder diagram.B: Output relays, internal auxiliary relays and timers are turned off; counters, shift registers, holding relays and data memory relays are held in their present status.C: Output relays, internals auxiliary relays, timers, relays are held in their present status.ConcitionIL-JMP-JME-ILCJMP-IL-ILC-JMP

Program AProgram BProgram CProgram AProgram BProgram C

X"1"AAAAAA

Y"1"

X11ACACCC

Y10

X10BBBABA

Y11

X10BBBCCC

Y00

X00BBBCBC

Y10

X0BBBCCC

Y0

X01ACACCC

Y00

X00BBBABA

Y01

X11AAAAAA

Y01

X01AAAAAA

Y01

OutputDevice1000Output 01001Output 11002Output 21003Output 31004Output 41005Output 51006Output 61007Output 71008Output 81009Output 9InputDevice 0000Input 0 0001Input 1 0002Input 2 0003Input 3 0004Input 4 0005Input 5 0006Input 6 0007Input 7 0008Input 8 0009Input 9 0010Reset Input 7-117. USEFUL CIRCUITRYFirst-In Input Priority CircuitDescriptionWhen there are plural inputs, this circuit is used to accept only the first input and ignore all subsequent inputs. This circuit accepts only the first input after it has been cleared by a reset input.I/O Assignment

7. USEFUL CIRCUITRYCircuit ExampleExample 1This circuit is applicable to CPM1A

IL(02)0100 Reset input000010011002

1003100410051006100710081009

1000

00011000100100021 010110000031002100300041003

1004

00051004

1000 Output 0 1001 Output 1 10 Output 1003 Output 31004 Output 41005 Output 51006 Output 61007 Output 700081007100710080009100810091008 Output 81009 Output 9ILC(03)7-1100500061005100600071006

100Output1003Output 31004Output 41005Output 51006Output 61008Output 87. USEFUL CIRCUITRYExample 2IL(02)1000100110021003100410051006100710081009JMP(04)0100 Reset input00001000JMP(04)1000Output 000011001Output 1JMP(04)JMP(04)JMP(04)JMP(04)JMP(04)JMP(04)10011002100310041005100600071007Output 7JMP(04)JMP(04) 10090009Output 910071008000200030004000500060008JMP(04)ILC(03)7-13

7. USEFUL CIRCUITRYLast-In Input Priority CircuitDescriptionWhen there are plural inputs, this circuit is used to accept only the first input and clear all the preceding inputs. This is cleared by a reset input.I/O Assignment

Others0300Auxillarytorelay0315

Circuit Example

0000

DIFU(13)0300This circuit outputs the differentiation of inputs 0 to 15 (i.e.,0000 to 0015).

0300

DIFU(13)030100010301DIFU(13)0302000030DIFU(13)0303IL00030303IL(02)IL(02)IL0004InputDevice 0000Input 0 0001Input 1 0002Input 2 0003Input 3 0004Input 4 0005Input 5 0006Input 6 0007Input 7 0008Input 8 0009Input 9 0010Input 10 0011Input 11 001 2Input 1 2 0013Input 13 0014Input 14 0015Input 15 OutputDevice 1000Output 0 1001Output 1 1002Output 2 1003Output 3 1004Output 4 1005Output 5 1006Output 6 1007Output 7 1008Output 8 1009Output 9 1010Output 10 1011Output 11 101 2Output 1 2 1013Output 13 1014Output 14 1015Output 15 7-14For the differentiation outputs, auxiliary relays 0300 to 0315 are used.

DIFU(13)0304

0304IL(02)DIFU(13)030500050305000603067. USEFUL CIRCUITRY030700080308When inputs 0 to 15 (0000 to 0015) turn ON within the same cycle, the input with the lowest program address number takes precedence over the other inputs.If the differentiation outputs are 0000, auxiliary relay 25506 turns ON.If the differentiation outputs are not 0000, the data in auxiliary relay channel 03 are transferred to output relay channel 10. Therefore, the data in auxiliary relays 0300 to 0315 are transferred to 1000 to 1015 and the latter group of auxiliary relays are the outputs.7-15000903090010031000110311001031001303130014031400153135506(=DIFU(13)0309ILDIFU(13)0310ILDIFU(13)0311IL(02)DIFU(13)031 2IL(02)(Normally ON)DIFU(13)0313ILDIFU(13)0314ILDIFU(13)0315ILC(03)CMP(20)03;0000MOV(21)33100007DIFU(13)0307ILDIFU(13)0308ILILDIFU(13)0306IL

This circuit is applicable to CPM1A(1-sec clock)25502 00001000Alarm display output000001000110000Buzzer stop000000Alarm buzzer output0000200010017. USEFUL CIRCUITRYNon-Lock-In AnnunicatorDescriptionThis circuit is used to generate alarm display outputs if a failure occurs.Alarm input 0000Alarm display output 10000Alarm buzzer output 1001Lamp test input 0010Buzzer reset input 0011One-point Non-lock-in Annunicator(1) I/O assignment(2) Circuit example

OutputDevice

1000Alarm display output

1001Alarm buzzer output

Others55020001-sec clock Work bit

InputDevice 0000Alarm input 0010Lamp test input 0011Buzzer reset input 7-16

7. USEFUL CIRCUITRY16-point Non-lock-in Annunicator(1) I/O assignment(2) Programming concept (Flowchart)

OutputDevice

1000 to 1015

(16 points)Alarm display output

1100Alarm buzzer output

Others

255021-sec clock

25 31 3Normally ON relay

25506Equal (=)

25507Less than (