Programming PLCsusing LADDER LogicProgramming PLCsusing LADDER Logic
Presentation OutlinePresentation Outline
Review of Ladder ProgrammingReview of Ladder Programming
Keyence PLC Ladder BuilderKeyence PLC Ladder Builder
Example 1: Motor ControlExample 1: Motor Control
Example 2: Drill ControlExample 2: Drill Control
Example 3: Traffic LightExample 3: Traffic Light
Programming the PLCProgramming the PLC
Ladder Logic DiagramsLadder Logic Diagrams
Function Block DiagramsFunction Block Diagrams
Sequential Function ChartsSequential Function Charts
Instruction ListInstruction List
Structured TextStructured Text
High-Level LanguageHigh-Level Language
PLC Scan CyclePLC Scan Cycle
ReadRead
InputsInputs
ExecuteExecute
ProgramProgram
UpdateUpdate
OutputsOutputs
Ladder Logic ExecutionLadder Logic Execution
Rungs of Ladder diagram are solved from Leftto right and top to bottomRungs of Ladder diagram are solved from Leftto right and top to bottom
Branches within rungs are solved top left tobottom rightBranches within rungs are solved top left tobottom right
 P P
SS
RR
AA
BB
DD
EE
FF
GG
HH
II
JJ
KK
Left Power RailLeft Power Rail
BranchBranch
Right Power RailRight Power Rail
Ladder RungLadder Rung
Basic Ladder ProgrammingBasic Ladder Programming
Basic Ladder ProgrammingBasic Ladder Programming
Basic Ladder ProgrammingBasic Ladder Programming
Basic Ladder ProgrammingBasic Ladder Programming
TimerTimer
OutputOutput
Input TriggeredInput Triggered
Timer SettingTimer Setting
Keyence Ladder BuilderKeyence Ladder Builder
Free evaluation version – up to 50 timesFree evaluation version – up to 50 times
KV -> PLC Series from KeyenceKV -> PLC Series from Keyence
vkv1
Keyence Ladder BuilderKeyence Ladder Builder
Start -> Programs -> Keyence Applications ->Start -> Programs -> Keyence Applications ->
Ladder Builder for KV Sample Ver.Ladder Builder for KV Sample Ver.
Keyence Ladder BuilderKeyence Ladder Builder
Create new file. Select the KV10 model.Create new file. Select the KV10 model.
Keyence Ladder BuilderKeyence Ladder Builder
ToolbarToolbar
LadderEditorLadderEditor
Keyence Ladder BuilderKeyence Ladder Builder
Basic Table of I/OBasic Table of I/O
KV-10KV-10
InputRelaysInputRelays
OutputRelaysOutputRelays
InternalRelaysInternalRelays
Timers/Timers/
CountersCounters
DataMemoryDataMemory
     0000      0000 
     0005     0005
     0500      0500 
     0503     0503
     1000      1000 
     1915     1915
  T/C 000   T/C 000 
         063         063
     DM      DM 
     0999     0999
Example – Motor ControlExample – Motor Control
K1K1
~~
StartStart
StopStop
K1K1
~~
~~
~~
M1M1
K1K1
The overload relay has been omitted in order tosimplify the circuitThe overload relay has been omitted in order tosimplify the circuit
Example – Motor ControlExample – Motor Control
Stop ->  Input Relay 0000 (X000)Stop ->  Input Relay 0000 (X000)
Normally Closed (NC)Normally Closed (NC)
Start -> Input Relay 0001 (X001)Start -> Input Relay 0001 (X001)
Normally Open (NO)Normally Open (NO)
Motor -> Output Relay 0500 (Y050)Motor -> Output Relay 0500 (Y050)
Example – Motor ControlExample – Motor Control
ENDHENDH
ENDEND
Ladder Diagram:Ladder Diagram:
StartStart
StopStop
MotorMotor
MotorMotor
Example – Motor ControlExample – Motor Control
Add normally open contactAdd normally open contact
Select relaySelect relay
00010001
Example – Motor ControlExample – Motor Control
Add normally closed contactAdd normally closed contact
Select relaySelect relay
00000000
Example – Motor ControlExample – Motor Control
Add horizontal connection linesAdd horizontal connection lines
Example – Motor ControlExample – Motor Control
Add an output relayAdd an output relay
Select relaySelect relay
05000500
Example – Motor ControlExample – Motor Control
Connect the circuit to the right power lineConnect the circuit to the right power line
Example – Motor ControlExample – Motor Control
Place the cursor below the contact of relay 0001Place the cursor below the contact of relay 0001
Add Branch with NO contact (OR logic)Add Branch with NO contact (OR logic)
Select relaySelect relay
05000500
Example – Motor ControlExample – Motor Control
Place the cursor below the NO contact of relay 0500.Place the cursor below the NO contact of relay 0500.
Type END -> for end of routine Click OK.Type END -> for end of routine Click OK.
Example – Motor ControlExample – Motor Control
Place the cursor below on line 0004.Place the cursor below on line 0004.
Type ENDH -> for end of program Click OK.Type ENDH -> for end of program Click OK.
Example – Motor ControlExample – Motor Control
Run the simulatorRun the simulator
Example – Motor ControlExample – Motor Control
Execute the program for continuous scanExecute the program for continuous scan
Example – Motor ControlExample – Motor Control
Start the motorStart the motor
(turn on and then off the start button)(turn on and then off the start button)
Change the status here andChange the status here and
Then press Write Current ValueThen press Write Current Value
…ordoubleclick withthe mouseleft button…ordoubleclick withthe mouseleft button
Example – Motor ControlExample – Motor Control
Stop the motorStop the motor
(watch the status of the motor – relay 0500)(watch the status of the motor – relay 0500)
Example – Motor ControlExample – Motor Control
Stop the simulation and return to the editorStop the simulation and return to the editor
Example – Motor ControlExample – Motor Control
Using labelsUsing labels
Example – Motor ControlExample – Motor Control
Right click with the mouse button on the deviceRight click with the mouse button on the device
and select Change Labeland select Change Label
Example – Motor ControlExample – Motor Control
Type the label and press OK (or Enter)Type the label and press OK (or Enter)
Example – Motor ControlExample – Motor Control
Type all labels (save the program – optional)Type all labels (save the program – optional)
If you use labels you can enter the device by its labelIf you use labels you can enter the device by its label
(instead of its number)(instead of its number)
Example – Drill ControlExample – Drill Control
M1M1
M2M2
L1L1
L2L2
UpperUpper
Limit SwitchLimit Switch
LowerLower
Limit SwitchLimit Switch
Drill MotorDrill Motor
VerticalVertical
MotorMotor
(up and down)(up and down)
Example – Drill ControlExample – Drill Control
In the beginning of the drilling cycle the Upper LimitSwitch (0001) is closedIn the beginning of the drilling cycle the Upper LimitSwitch (0001) is closed
The START button (0000) starts the drilling cycleThe START button (0000) starts the drilling cycle
The drill motor M1 (0500) must start. At the sametime, the vertical motor M2 must start to descend thedrill (0501)The drill motor M1 (0500) must start. At the sametime, the vertical motor M2 must start to descend thedrill (0501)
The drill will stop at the Lower Limit Switch (0002).The drill will stop at the Lower Limit Switch (0002).
At this time, the vertical motor start to ascend the drill(0502).At this time, the vertical motor start to ascend the drill(0502).
The drill motor must stop just at the upper position.The drill motor must stop just at the upper position.
Wait for new drilling cycleWait for new drilling cycle
Example – Drill ControlExample – Drill Control
Non-retentive contacts:Non-retentive contacts:
Example – Drill ControlExample – Drill Control
Go to Help -> Instruction Word -> Instructionsin Alphabetical Order -> DIFUGo to Help -> Instruction Word -> Instructionsin Alphabetical Order -> DIFU
Example – Drill ControlExample – Drill Control
SET – RESET instructionsSET – RESET instructions
Example – Drill ControlExample – Drill Control
Go to Help -> Instruction Word -> Instructionsin Alphabetical Order -> SET  (RES)Go to Help -> Instruction Word -> Instructionsin Alphabetical Order -> SET  (RES)
Example – Drill ControlExample – Drill Control
Timing diagram:Timing diagram:
STARTSTART
LIMIT1LIMIT1
MOTOR1MOTOR1
LIMIT2LIMIT2
M2-DOWNM2-DOWN
M2-UPM2-UP
Example – Drill ControlExample – Drill Control
Example – Traffic LightExample – Traffic Light
Start the operation with the switch S1(input 0000)Start the operation with the switch S1(input 0000)
The red signal must be ON for seconds(output 0500)The red signal must be ON for seconds(output 0500)
The green signal must be ON for 8seconds (output 0501)The green signal must be ON for 8seconds (output 0501)
The yellow signal must be ON for 3seconds (output 0502)The yellow signal must be ON for 3seconds (output 0502)
The cycle must continues until the switchThe cycle must continues until the switch
 S1 is released S1 is released
Example – Traffic LightExample – Traffic Light
Go to Help -> Instruction Word -> Instructionsin Alphabetical Order -> TMRGo to Help -> Instruction Word -> Instructionsin Alphabetical Order -> TMR
Example – Traffic LightExample – Traffic Light
Example – Traffic LightExample – Traffic Light
Place the cursor at the position you want toadd Timer. Then, double click with the mouseleft button and select Instruction -> TMRPlace the cursor at the position you want toadd Timer. Then, double click with the mouseleft button and select Instruction -> TMR
Example – Traffic LightExample – Traffic Light
Define the Timer number and the Preset value.Define the Timer number and the Preset value.
Timer numberTimer number
Preset valuePreset value
Example – Traffic LightExample – Traffic Light