LG master k Training 1

Embed Size (px)

Citation preview

  • 7/29/2019 LG master k Training 1

    1/74

    EHATraining center

    LG PLC training courseLevel I (beginner)

  • 7/29/2019 LG master k Training 1

    2/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 2 -

  • 7/29/2019 LG master k Training 1

    3/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 3 -

    EHATraining center

    LG PLC training courseLevel 1 (beginners level)

    Pre-requisites : None

    Duration:

    6 days two hours per dayDescription : Basics of PLC Operation and programmingTechnology : LG K7M/MK-120S

    PC

    KGL and other appropriate SoftwareTarget audience : All person that are required to deal with PLC

    circuits and PLC programming.contents : Lesson 1:

    Digital signal Digital input device

    Digital output device PLC architecture "PLC inside view" PLC circuit wiring and interface

    Lesson 2:

    Ladder logic

    Memory map KGL programming software

    Lesson 3:

    Timers1. On delay timer2. Off delay timer3. Mono stable timer

    Examples using master controller tool

    Lesson 4:

    Counters Examples

    Lesson 5:

    Step controller "sequence controller"and its' applications

    Lesson 6:

    How to choose suitable PLC for yourapplication

    General notes

  • 7/29/2019 LG master k Training 1

    4/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 4 -

    Course Philosophy:Training depends mainly on Practical applications. The

    course contents are spread out over a 6-day period one lessonper day every lesson is two hours, thus allowing absorption oftechnical data through practical example. Training manuals aresupplied to the student for future reference. Included in the course

    is a copy of the entire PLC and HMI reference manuals in softcopy version.

    Once a student has completed the LG PLC course level I,he/she will be able to:

    Create basic PLC programs. Understand the internals of a PLC. Have practical experience in choosing and

    connection and programming of PLC. Be ready to advance to the LG PLC course level II.

    Looking forward to having you on the course!

  • 7/29/2019 LG master k Training 1

    5/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 5 -

    Main points

    Digital Signal

    Digital input Devices

    Digital output Devices

    PLC in side view

    Hardware wiring

    Lesson1 introduction to PLC 1

  • 7/29/2019 LG master k Training 1

    6/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 6 -

    Definitions of Digital Signal

    An electrical signal that varies in discrete steps ON ( 24V or 5VTTL) And OFF (0V)

    A digital signal is composed only of electrical pulsesrepresenting either zero or one

    Digital value is non-sequentially changing valueWritten as the Number like 0,1,2,3. The signal of on orOff is written as digital Value of 0 or 1

    Digital Signal 1

  • 7/29/2019 LG master k Training 1

    7/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 7 -

    Inputs come from sensors that translate physical phenomena intoelectrical signals.

    Typical examples of sensors are listed below in relative order of

    popularity.

    Inductive proximity - is a metal object nearby?

    Capacitive proximity - is a dielectric object nearby?

    Optical presence - is an object breaking a light beam or reflectinglight?

    Mechanical contact - is an object touching a switch?

    Inputs for a PLC come in a few basic varieties, the simplest are ACand DC inputs.

    Sourcing and sinking inputs are also popular. Instead, the deviceonly switches current on or off, like a simple switch.

    Sensors allow a PLC to detect the state of a process. Logicalsensors can only detect a state that is either true or false.

    Digital input devices 2

  • 7/29/2019 LG master k Training 1

    8/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 8 -

    Inductive Sensors

    Inductive sensors use currents induced by magnetic fields to detectnearby metal objects. The inductive sensor uses a coil (an inductor)to generate a high frequency magnetic field as shown in Figure.

    If there is a metal object near the changing magnetic field, currentwill flow in the object. This resulting current flow sets up a newmagnetic field that opposes the original magnetic field. The neteffect is that it changes the inductance of the coil in the inductivesensor. By measuring the inductance the sensor can determinewhen a metal have been brought nearby.These sensors will detect any metals, when detecting multiple typesof metal multiple sensors are often used.The sensors can detect objects a few centimeters away from the

    end. But, the direction to the object can be arbitrary as shown inFigure.The magnetic field of the unshielded sensor covers a larger volumearound the head of the coil.By adding a shield (A metal jacket around the sides of the coil) themagnetic field becomes smaller, but also moredirected. Shields willoften be available for inductive sensors to improve theirdirectionality and accuracy.

  • 7/29/2019 LG master k Training 1

    9/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 9 -

    Example (CYLINDRICAL TYPE WITH LEADS)

    Part number: PR08DC

    Form autonics PR Series

    FEATURES:

    Size: 8-12-18-30 mm diameter2-wire DC, 3-wire DC or 2-wire AC models availableNormally open or normally closed

    Shielded or non-shielded models3-wire DC available NPN or PNPStandard or long body versionsLED indication of output status2 meter cable

  • 7/29/2019 LG master k Training 1

    10/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 10 -

    Capacitive Sensors

    Capacitive sensors are able to detect most materials at distances upto a few centimeters. Recall the basic relationship for capacitance.

    In the sensor the area of the plates and distance between them isfixed. But, the dielectric constant of the space around them willvary as different materials are brought near the sensor. Anillustration of a capacitive sensor is shown in Figure. an oscillatingfield is used to determine the capacitance of the plates. When thischanges beyond a selected sensitivity the sensor output isactivated.

    NOTE:For this sensor the proximity of any material near the electrodeswill increase the capacitance. This will vary the magnitude of theoscillating signal and the detector will decide when this is great

    enough to determine proximity.

    These sensors work well for insulators (such as plastics) that tendto have high dielectric coefficients, thus increasing the capacitance.But, they also work well for metals because the conductivematerials in the target appear as larger electrodes, thus increasing

    the capacitance as shown in Figure. In total the capacitancechanges are normally in the order of pFard

  • 7/29/2019 LG master k Training 1

    11/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 11 -

    Dielectrics and Metals Increase the Capacitance

    The sensors are normally made with rings (not plates) in theconfiguration shown in Figure. In the figure the two inner metalrings are the capacitor electrodes, but a third outer ring is added tocompensate for variations.Without the compensator ring the sensor would be very sensitive todirt, oil and other contaminants that might stick to the sensor.

    Example: (CYLINDRICAL TYPE WITH LEADS)

    Part number: CR18-8DNForm autonics CR Series

    FEATURES:Size: 18mm or 30 mm

    3-wire DC or 2-wire AC modelsnormally open or normally closed3-wire DC available NPN or PNPAdjustable sensitivityDetecting distance to 15mmLED indication of output status2 meter cableIP66 (18mm) or IP65 (30mm)

  • 7/29/2019 LG master k Training 1

    12/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 12 -

    Optical (Photoelectric) Sensors

    Light sensors have been used for almost a century - originallyphotocells were used for applications such as reading audio trackson motion pictures. But modern optical sensors are much moresophisticated.

    Optical sensors require both a light source (emitter) and detector.Emitters will produce light beams in the visible and invisiblespectrums using LEDs and laser diodes. Detectors are typically builtwith photodiodes or phototransistors. The emitter and detector arepositioned so that an object will block or reflect a beam whenpresent. A basic optical sensor is shown in Figure

    In the figure the light beam is generated on the left, focusedthrough a lens. At the detector side the beam is focused on thedetector with a second lens. If the beam is broken the detector willindicate an object is present. The oscillating light wave is used sothat the sensor can filter out normal light in the room. The lightfrom the emitter is turned on and off at a set frequency. Whenthe detector receives the light it checks to make sure that it is atthe same frequency.If light is being received at the right frequency then the beam isnot broken. The frequency of oscillation is in the KHz range, and too

    fast to be noticed.A side effect of the frequency method is that the sensors can beused with lower power at longer Distances.

  • 7/29/2019 LG master k Training 1

    13/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 13 -

    Digital outputs devices such that solenoids, valves

    SOLENOIDS

    Solenoids are the most common actuator components. The basicprinciple of operation is there is a moving ferrous core (a piston)that will move inside wire coil as shown in Figure 5.1. Normally thepiston is held outside the coil by a spring. When a voltage is appliedto the coil and current flows, the coil builds up a magnetic field thatattracts the piston and pulls it into the center of the coil. The pistoncan be used to supply a linear force. Well known applications ofthese include pneumatic values and car door openers.

    VALVES

    The flow of fluids and air can be controlled with solenoid controlledvalves. An example of a solenoid controlled valve is shown in Figurethe solenoid is mounted on the side. When actuated it will drive thecentral spool left. The top of the valve body has two ports that willbe connected to a device such as a hydraulic cylinder. The bottomof the valve body has a single pressure line in the center with twoexhausts to the side. In the top drawing the power flows in through

    the center to the right hand cylinder port. The left hand cylinderport is allowed to exit through an exhaust port. In the bottomdrawing the solenoid is in anew position and the pressure is nowapplied to the left hand port on the Top and the right hand port canexhaust. The symbols to the left of the figure show the schematicequivalent of the actual valve positions. Valves are also availablethat allow the valves to be blocked when unused.

    Digital outputs devices 3

  • 7/29/2019 LG master k Training 1

    14/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 14 -

  • 7/29/2019 LG master k Training 1

    15/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 15 -

    The PLC mainly consists of a CPU, memory areas, and appropriatecircuits to receive input/output data. We can actually consider the

    PLC to be a box full of hundreds or thousands of separate relays,counters, timers and data storage locations. Do these counters,timers, etc. really exist? No, they don't "physically" exist but ratherthey are simulated and can be considered software counters,timers, etc. These internal relays are simulated through bitlocations in registers. (More on that later)

    What does each part do? CPU - Central Processing Unit is the brain of a PLC controller.

    CPU itself is usually one of the microcontrollers. Aforetimethese were 8-bit microcontrollers such as 8051, and now

    these are 16- and 32-bit microcontrollers. INPUT RELAYS-(contacts) these are connected to the

    outside world. They physically exist and receive signals fromswitches, sensors, etc. Typically they are not relays but ratherthey may be transistors or opti-couplers.

    Marker RELAYS -these do not receive signals from theoutside world nor do they physically exist. They are simulatedrelays and are what enables a PLC to eliminate externalrelays. There are also some special relays that are dedicatedto performing only one task. Some are always on while some

    are always off. Some are on only once during power-on andare typically used for initializing data that was stored.

    COUNTERS-These again do not physically exist. They aresimulated counters and they can be programmed to countpulses. Typically these counters can count up, down or bothup and down. Since they are simulated they are limited intheir counting speed. There are also high-speed counters thatare hardware based. We can think of these as physicallyexisting. Most times these counters can count up, down or upand down.

    PLC in side view 3

  • 7/29/2019 LG master k Training 1

    16/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 16 -

    TIMERS-These also do not physically exist. They come inmany varieties and increments. The most common type is anon-delay type and off-delay. Increments vary from 1msthrough 1s.

    OUTPUT RELAYS-(coils) these are connected to the outsideworld. They physically exist and send on/off signals tosolenoids, lights, etc. They can be transistors, relays, or triacsdepending upon the model chosen.

    DATA STORAGE-Typically there are registers assignedto simply store data. They are usually used as temporarystorage for math or data manipulation. They can also typicallybe used to store data when power is removed from the PLC.Upon power-up they will still have the same contents asbefore power was removed. Very convenient and necessary!!

  • 7/29/2019 LG master k Training 1

    17/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 17 -

    PLC SCAN CYCLE

    A PLC works by continually scanning a program. We can think ofthis scan cycle as consisting of 3 important steps. There aretypically more than 3 but we can focus on the important parts andnot worry about the others. Typically the others are checking the

    system and updating the current internal counter and timer values.

    Step 1-CHECK INPUT STATUS

    First the PLC takes a look at each input to determine if it is on oroff. In other words, is the sensor connected to the first input on?How about the second input? How about the third... It records this

    data into its memory to be used during the next step.

    Step 2-EXECUTE PROGRAM

    Next the PLC executes your program one instruction at a time.Maybe your program said that if the first input was on then itshould turn on the first output. Since it already knows which inputsare on/off from the previous step it will be able to decide whetherthe first output should be turned on based on the state of the firstinput. It will store the execution results for use later during the nextstep.

    Step 3-UPDATE OUTPUT STATUS

    Finally the PLC updates the status of the outputs. It updates the outputs based onwhich inputs were on during the first step and the results of executing your programduring the second step. Based on the example in step 2 it would now turn on the firstoutput because the first input was on and your program said to turn on the first outputwhen this condition is true. After the third step the PLC goes back to step one andrepeats the steps continuously. One scan time is defined as the time it takes to executethe 3 steps listed above.

  • 7/29/2019 LG master k Training 1

    18/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 18 -

    Memo

    .

  • 7/29/2019 LG master k Training 1

    19/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 19 -

    Input wiring

    Output wiring

    Hardware wiring 1.5

    Dc 24v

  • 7/29/2019 LG master k Training 1

    20/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 20 -

  • 7/29/2019 LG master k Training 1

    21/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 21 -

    Wiring precautions:

    Re-check the input voltage for the input part. If a voltage over the

    maximum switching capacity (24V) is applied, it can cause faults,destruction or fire.

    Before applying the power to part that has polarities, be sure tocheck its polarities.

    During drilling or wiring, do not allow any wire scraps to enter thePLC. It can cause malfunction and fault.

    Wiring I/O wires with high voltage cable or power supply line can

    cause malfunction or disorder.

    Be sure that any wire does not pass across during input LED (I/Ostatus will not be clearly identified).

    If an inductive load has been connected to output part, connectparallel surge killer or diode to a load. Connect the cathode of diodeto the + part of the power supply.

    Be cautious that strong shock does not applied to the I/O part.

    Do not separate the PCB from its case.

  • 7/29/2019 LG master k Training 1

    22/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 22 -

    Memo

    .

  • 7/29/2019 LG master k Training 1

    23/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 23 -

    Main points

    Ladder Logic

    Memory Map

    KGL Programming Software

    Lesson 2 2

  • 7/29/2019 LG master k Training 1

    24/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 24 -

    Ladder logic is the main programming method used for PLCs.Relay is a simple device that uses a magnetic field to control a

    switch, when a voltage is applied to the input coil; the resultingcurrent creates a magnetic field the magnetic field pulls a metalswitch (or reed) towards it and the contacts touch, closing theswitch. The contact that closes when the coil is energized is callednormally open.The normally closed contacts touch when the input coil is notenergized. Relays are normally drawn in schematic form using acircle to represent the input coil.

    Example1:

    Now let's compare a simple ladder diagram with its real worldexternal physically connected relay circuit and see the differences.

    Figure (1.6)

    In the above circuit, the coil will be energized when there is aclosed loop between the + and - terminals of the battery. We cansimulate this same circuit with a ladder diagram. Aladder diagramconsists of individual rungs just like on a real ladder. Each rungmust contain one or more inputs and one or more outputs. The firstinstruction on a rung must always be an input instruction and thelast instruction on a rung should always be an output (or itsequivalent).

    Ladder Logic 2.1

  • 7/29/2019 LG master k Training 1

    25/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 25 -

    K 24VDC

    24VDC

    220VACM

    P0

    COM

    P1

    P40

    COM

    K

    Example 3:

    MOTOR START WITH LATCHMake a program to control motor through push button but motornot stop after releasing the button but can stop by pushing pushbutton (P1)

  • 7/29/2019 LG master k Training 1

    26/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 26 -

    [[[[[[[[[[[[[[[

    To study PLC you must know the memory mapping of the datamemory of this PLC, the PLC data memory is divided into severalparts , every part have a name & special specifications , these parts

    called devices .

    MK 120S DATA MEMORY DEVIDED INTO

    1- P area2- M area3- K area

    1- P input &output image.This device for real input and real outputs only, you can changethese device status (write in these bits) using hardware, if you put24v on p0 input, and the bit of p0 get high (on)

    Example:

    P0 input for point labeled 0 on plc.P40 output for point labeled 40 on plc.

    Note:

    No. of points (pxx) limited to plc

    2- M auxiliary relay. (Markers)This device for not real input and not real outputs, you can only

    write in these bits using software instructions.

    Example:

    M0 internal imagine input or output in plc.

    Note:

    No. of points (mxx) limited to plc software pointFor example for master k120s from m000 tom191f (191*16= 3056 marker)

    memory mapping 2.2

  • 7/29/2019 LG master k Training 1

    27/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 27 -

    3- K keep relayThis device the same like m device but it can keep its value even ifpower off and on again.

    Example:

    K0internal imagine input or output in plc canKeep its value even power off and on again.

    Note:No. of points (kxx) limited to plc software point

    For example for master k120s from k00 to k31f(31*16= 496) Keep relay.

    (I.e. if power off while k0 was on, when power turn on again weWill find k0 on)

    4- F special relay. (Flags)These special relays (flags) are predetermined flags each one

    make one predetermined job only cant be changed

    Example:

    F10always no flag.F11always off flag.

    Note:You can get list of flags by click f3 from the keyboard then select

    flags

  • 7/29/2019 LG master k Training 1

    28/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 28 -

    The programming software of LG Master K PLC's is named KGLWIN,KGLWIN is under windows package which you can use to writeladder or mnemonic (statement) programs and to download it to

    PLC also to emulate the downloaded

    Programming software 2.3

  • 7/29/2019 LG master k Training 1

    29/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 29 -

  • 7/29/2019 LG master k Training 1

    30/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 30 -

  • 7/29/2019 LG master k Training 1

    31/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 31 -

    You can open an existing files b KGL win

  • 7/29/2019 LG master k Training 1

    32/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 32 -

  • 7/29/2019 LG master k Training 1

    33/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 33 -

    Memo

    .

  • 7/29/2019 LG master k Training 1

    34/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 34 -

    Memo

    .

  • 7/29/2019 LG master k Training 1

    35/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 35 -

    Main points

    Timers

    Examples

    Using Master controller tool

    Lesson3 3

  • 7/29/2019 LG master k Training 1

    36/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 36 -

    The most popular types of timers

    1 TON ON DELAY TIMER2 TOFF OFF DELAY TIMER3 TMON MONOSTABLE TIMER

    Let's now see how a timer works. What is a timer? It's exactly whatthe word says.. It is an instruction that waits a set amount oftime before doing something. Sounds simple doesn't it.

    On-Delay timer

    This type of timer simply "delays turning on". In other words, afterour sensor (input) turns on we wait x seconds before activating asolenoid valve (output). This is the most common timer. It is oftencalled TON (timer on delay)

    Off-Delay timer

    This type of timer is the opposite of the on-delay timer listed

    above. This timer simply "delays turning off". After our sensor(input) sees a target we turn on a solenoid (output). When thesensor no longer sees the target we hold the solenoid on for x-seconds before turning it off. It is called a TOFF (timer off-delay)and is less common than the on-delay type listed above. (i.e. fewmanufacturers include this type of timer)

    Let's now see how to use them. We typically need to know 2 things:

    1. What will enable the timer? Typically this is one of the

    inputs.(a sensor connected to input P0000 for example)2.How long we want to delay before we react. Let's wait 5

    seconds before we turn on a solenoid, for example.

    When the instructions before the timer symbol are true the timerstarts "ticking". When the time elapses the timer will automaticallyclose its contacts. When the program is running on the plc theprogram typically displays the elapsed or "accumulated" time for usso we can see thecurrent value. Typically timers can tick from 0 to65535 times.

    Timers 3.1

  • 7/29/2019 LG master k Training 1

    37/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 37 -

    Why this specified numbers? Again it's because LG MK PLCs have16-bit timers. We'll get into what this means in a later chapter butfor now suffice it to say that 65535 is 16-bit binary. Each tick of theclock is equal to x-seconds.

    Typically LG MK series offers several different ticks. 10 and 100 ms

    increments (ticks of the clock). An "ms" is a milli-second or1/1000th of a second. MK 120s also offer 1ms increments. Thesedifferent increment timers work the same as above but sometimesthey have different names to show their time base. Shown below isa typical timer instruction symbol we will encounter and how to useit.

    This timer is the on-delay type and is named T0. When the enableinput is on the timer starts to tick. When it ticks 10 (the presetvalue) times, it will turn on its contacts that we will use later in theprogram. Remember that the duration of a tick (increment) varieswith the time base used. (I.e. in MK 120s I can set some timers thetime base 100msec, others to the time base 10msec ...)

    In this diagram we wait for input P0 to turn on. When it does, timerT000 (a100ms increment timer) starts ticking. It will tick 100 times.Each tick (increment) is 100ms so the timer will be a 10000ms (i.e.

    10 second) timer. 100ticks X 100ms = 10,000ms. When 10 secondshave elapsed, the T000 contacts close and P40 turns on. Wheninput P0 turns off (false) the timer T000 will reset back to 0 causingits contacts to turn off (become false) thereby making output P40

    turn back off.

    To get help on timers just click F10 (dialogue box will appear) then SELECT TON FROM the LIST THEN CLICK help

  • 7/29/2019 LG master k Training 1

    38/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 38 -

    To put timer in the ladder diagram click F10 from the keypad,dialogue box will appear then write the following expression

    I nstruction op1 op2

    Where:

    Op1 is the timer number, in MK120s there are 256 timerfrom T0 to T255

    Op2 is the delay time multiplied by 0.1 sec

    (To make 10 sec delay then make op2=100)

    Example

    To put on delay timer with 100sec delay do the following Click F10----write Ton Tn 1000 as n any number from 0-255

    Hint:

    Dont use the same timer more than one

    Hint:

    Every timer has a bit or contact take the same name of the timerfor example t10 is contact of the timer T10 this bit condition depend

    on its timer condition.

  • 7/29/2019 LG master k Training 1

    39/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 39 -

    1-TON Example

    Examples 3.2

  • 7/29/2019 LG master k Training 1

    40/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 40 -

    Example: Lamp flickers

  • 7/29/2019 LG master k Training 1

    41/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 41 -

    2-TOFF example:

    Write a program to operate a lamp for 20 sec if I hit a button.Solution connect the button with P0 and connect the lamp with P40,the program are as following

    When push the button P0 get on the contact T0 get on, whenrelease the button P0 get off T0 will keep on for 20 sec then get off

  • 7/29/2019 LG master k Training 1

    42/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 42 -

    3- Monostable Timer example:

  • 7/29/2019 LG master k Training 1

    43/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 43 -

  • 7/29/2019 LG master k Training 1

    44/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 44 -

    Extra Examples

    Example1:

    Motor with two direction with time

    OBJECT:

    Make a program to control motor with two directions with twoDEFFERINT TIME.

    SOLUTION:

    When start p.b (P0) pushed motor run in forward direction so Tillcertain time (T144) then motor stop running at forward direction

    (P40 off ) and reverse direction Begin till certain time (T145) thenmotor stop running at backward direction (P41 off ) and runforward again and so on.

  • 7/29/2019 LG master k Training 1

    45/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 45 -

    Example 2When click start pushbutton we want the conveyer to run with thesequence C---10sec delayB20sec delay ---A when I click stop Iwant the conveyer to stop with the sequence C10sec delayb-10sec delay

  • 7/29/2019 LG master k Training 1

    46/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 46 -

    Let's now look at what are called master controls. Master controlscan be thought of as "emergency stop switches".

    An emergency stop switch typically is a big red button on amachine that will shut it off in cases of emergency. Next timeyou're at the local gas station look near the door on the outside tosee an example of an e-stop.

    Note:

    We're not implying that this instruction is a substitute for a "hardwired" e-stop switch. There is no substitute for such a switch!Rather it's just an easy way to get to understand them.

    The master control instruction typically is used in pairs with amaster control clear (reset). Abbreviated as MCS/MCSCLR (mastercontrol/master control reset),

    Here is the master control symbol looks.

    Below is an example of a master control clear.

    MCS & EXAMPLE

    Master Control 3.3

  • 7/29/2019 LG master k Training 1

    47/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 47 -

  • 7/29/2019 LG master k Training 1

    48/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 48 -

  • 7/29/2019 LG master k Training 1

    49/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 49 -

    Memo

    .

  • 7/29/2019 LG master k Training 1

    50/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 50 -

    Memo

    .

  • 7/29/2019 LG master k Training 1

    51/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 51 -

    Main points

    Counters

    Examples

    Using Positive edge and negative tool

    Lesson4 4

  • 7/29/2019 LG master k Training 1

    52/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 52 -

    There are four types of counters:-

    1- CTR RING COUNTER2- CTU UP COUNTER.3- CTD DOWN COUNT4- CTUD UP DOWN COUNTER

    A counter is a simple device intended to do one simple thing -count.There are up-counters (they only count up 1, 2, 3...).These are called CTU (count up), there are down counters (theyonly count down 9, 8, 7...).These are typically called CTD (count down) when they are aseparate instruction.there are also up-down counters(they count up and/or down1,2,3,4,3,2,3,4,5,...) these are typically called CTUD (up-down

    counter) when they are separate instructions.

    To get help on counters Just click F10 (dialogue box will

    appear) then write CTU help

    To put counter in the ladder diagram, click F10 from keypaddialogue box will appear write in it the following expression CTU C0

    10 AS CTU the counter type may be CTU or CTD or CTUD or CTRevery type is explained in details in the following pages C0 thecounter number, there are 256 counter in mk120s plc, from C0 toC255, I can use every counter only once the set point of thecounter, it can from 0 to 65535

    Hint:every counter have a bit or a contact, these bit state changedepending on the state of it's counter for example if the counter isCTU then it's bit will have 0 as the present value in the counter lessthan the set point, when the present value in the counter is more

    than or equal the set point the bit of this counter will be 1Hint:The bit of any counter take the same number of these counters, asc100 is the bit of the counter c100

    Counters 4.1

  • 7/29/2019 LG master k Training 1

    53/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 53 -

    CTU+EXAMPLE

  • 7/29/2019 LG master k Training 1

    54/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 54 -

    CTD+EXAMPLE

  • 7/29/2019 LG master k Training 1

    55/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 55 -

    CTUD+EXAMPLE

  • 7/29/2019 LG master k Training 1

    56/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 56 -

  • 7/29/2019 LG master k Training 1

    57/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 57 -

    CTR+EXAMPLE

  • 7/29/2019 LG master k Training 1

    58/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 58 -

    MAKE A WATCH

    Make a program to make out contact after 1 monthSolution:make counter (C1) with enable F93 ( this is special clock flag for 1sec ) C1 preset value is 60 his counter express seconds , so after1minute (60 second) C1 make pulse to C2 (minute counter) and C2after 60 minute (Pulse) give pulse to C3 ( hour counter) and whenhour counter reach 24 Hour (pulse) give C4 (month counter).

  • 7/29/2019 LG master k Training 1

    59/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 59 -

    3- STORE EXAMPLE

    OBJECT:Store with maximum capacity 200 car, has two gates each onehas sensor make a program to output signal when store empty

    and other one when full

    Solution:By up down counter, up enable (P0) from entrance gate and downenable from exit Gate and compare counter value if less than 1 outEMPTY signal (P40) and ifGreater Than 200 out FULL signal (P41)

  • 7/29/2019 LG master k Training 1

    60/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 60 -

    A one-shot (D& DNOT) is an interesting and invaluableprogramming tool. At first glance it might be difficult to figure outwhy such an instruction is needed. After we understand what this

    instruction does and how to use it, however, the necessity willbecome clear.A one-shot is used to make something happen for ONLY 1 SCAN.(You do remember what a scan is, right??) . The name of theinstruction is D / D NOT (differentiate up/down).

    D Instruction, device may be any P,M,K,L device

    Above is the symbol for a D (differentiate) instruction. A D NOT

    instruction looks the same but inside the symbol it says "D NOT",Lets now setup an application to see how this instruction actuallyfunctions in a ladder. This instruction is most often used with someof the advanced instructions where we do some things that MUSThappen only once. However, since we haven't gotten that far yet,let's set up a flip/flop circuit. In simple terms, a flip/flop turnssomething around each time an action happens. Here we'll use asingle pushbutton switch. The first time the operator pushes it wewant an output to turn on. It will remain "latched" on until the nexttime the operator pushes the button. When he does, the output

    turns off.

    Here's the ladder diagram that does just that:Now this looks confusing! Actually it's not if we take it one step at atime.

    D & D NOT INSTRUCTIONS 4.2

  • 7/29/2019 LG master k Training 1

    61/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 61 -

    Rung 1-When NO (normally open) input P0000 becomes true

    D M10 becomes true. Rung 2- NO M10 is true, NO M15 remains false, NC M15

    remains true, and NC M10 turns false. Since we have a truepath, (NO M10 & NC M15) OUT M15 becomes true.

    Rung 3- NO M15 is true therefore OUT P40 turns true.

    Next Scan

    Rung 1- NO P0 remains true. M10 now becomes false. This isbecause the D instruction is only true for one scan. (i.e. therising edge of the logic before it on the rung)

    Rung 2- NO M10 is false, NO M15 remains true, NC M15 false,NC M10 turns true. Since we STILL have a true path, (NO

    M15 & NC M10) OUT M15 remains true.

    Rung 3- NO M15 is true therefore OUT P40 remains true.

    After 100 scans, NO P0 turns off (becomes false, user release thepush button connected P0). The logic remains in the same state as"next scan" shown above. (D doesn't react therefore the logicstays the same on rungs 2 and 3)

    On scan 101 NO P0 turns back on. (Becomes true, user re pushthe button)

    Rung 1-When NO (normally open) input P0 becomes true DM10 becomes true.

    Rung 2- NO M10 is true, NO M15 remains true, NC M15becomes false, and NC M10 also becomes false. Since we nolonger have a true path, OUT 1001 becomes false.

    Rung 3- NO 1001 is false therefore OUT 500 becomes false

    D mean differentiate , this instruction write 1 in the bit itapplied on for 1 scan cycle when the devices before ittranslate from disconnect to connect state

  • 7/29/2019 LG master k Training 1

    62/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 62 -

    D NOT , this instruction write 1 in the bit it applied on for1 scan cycle , when the devices before it translate fromconnect to disconnect state

    When P0 get on m10 get on for one scan cycle, when P0 getoff m12 get on for one scan cycle

  • 7/29/2019 LG master k Training 1

    63/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 63 -

    EXAMPLE:

    OBJECT:Great knife driven by motor, make a program to operate this knifethrough selector and when Overload occur knife sops and neverrun again before make the selector off and ON again

    Solution:

    As it requested the run command hanged on the rising edge of theSELECTOR So we have to take the rising edge of the SELECTOR byD command on marker (m10 for example) And use this marker forrun the motor (P40) and when overload point come (P1) motorstop and will not work till p1 return to its initial position and thenextrising edge come again by changing the SELECTOR from ONto off and make it ON again

  • 7/29/2019 LG master k Training 1

    64/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 64 -

    Memo

    .

  • 7/29/2019 LG master k Training 1

    65/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 65 -

    Main points

    STEPCONTROLLER

    Lesson5 5

  • 7/29/2019 LG master k Training 1

    66/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 66 -

    Step controllers like no. of ladders each one contain of no. of stairsOnly one stair (step) can be on and all stairs for this ladder are off.

    For example:

    For ladder S00.00 (it varies from S00.00 to S00.99) Step S00.00ON firstly and if any step come (like S00.07) S00.00 OFF.

    There are two ways to use the step controller

    Last in priority Step controller(sequence command)

    OUT Sxx.xx SET xx.xx

    LAST IN PRIORITY OUT Sxx.xx

    For this method we can move from any step to the other onewithout any condition, but we must remember that only one stepwill be ON

  • 7/29/2019 LG master k Training 1

    67/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 67 -

    SEQUENCE COMMAND SET Sxx.xxIn this method I can only move from step to the next step (thenext only) by SET order, and there are two conditions

    1- The previous step was ON before trying to SET this step (forexample to SET S00.02 S00.01 must be ON first)

    2- Use SET order

    Notes:Only the first step (for example S00.00 for ladder S00) can come atany time (i.e. If we SET S00.00 for ladder S00 at any time S00.00will be ON)

  • 7/29/2019 LG master k Training 1

    68/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 68 -

  • 7/29/2019 LG master k Training 1

    69/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 69 -

    Example:

    This program shows briefly an example of sequential control byusing SET Sxx.xx instruction.In this Example, there are 4 processes and each process isperformed in sequence. The process 2 starts after the process 1ended, and process 3 starts after the process 2 finished.When the process 4 is completed, the process 1 will start again.

  • 7/29/2019 LG master k Training 1

    70/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 70 -

    Memo

    .

  • 7/29/2019 LG master k Training 1

    71/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 71 -

    Main points

    How to choose suitable PLC for your application

    General notes

    Lesson6 6

  • 7/29/2019 LG master k Training 1

    72/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 72 -

    How to choose suitable PLC for your application

    1-determine number of digital inputs and digital outputs

    2-if there are analog inputs or analogue outputs

    Determine them number

    3-if there are any other special inputs (Like RTD,

    Thermocouple and high speed pulses (encoder)...etc)

    Determine its number

    after determine these data you can found more than plc

    type match with these data , you will found that mk10s1

    the most cheapest type , after that mk80S ,after that

    mk120s, after that mk200s , after that mk300s

    *there are no Thermocouple expansion modules in

    MK120S

    *there are no RTD expansion modules in MK200S

    * For digital inputs and digital outputs it is preferable totake plc

    Have inputs outputs 120% of required inputs outputs

    *for MK 200s, mk300s it is preferable to take baseboard

    have

    Two slots more the required number of slots

  • 7/29/2019 LG master k Training 1

    73/74

    Electro Hydraulic Automation (EHA)

    (+202)4941760-499377 Fax.(+202)49192896- 73 -

    Memo

    .

  • 7/29/2019 LG master k Training 1

    74/74

    Memo

    .