Program Control Instructions.

Slides:



Advertisements
Similar presentations
Dc input modules can either be sources or sinks for dc current. This depends on the transistor used in the input card and the polarity of the dc supply.
Advertisements

Copyright © 2005 Rockwell Automation, Inc. All rights reserved. 1 Micro Logix 1100 RSLogix 500 LAB#2 Timing, Counting & Comparing.
PLC Timer Instructions
Drafting RLL. SLC 500 Processor Operating Cycle Event in Operating Cycle Input Scan Program Scan Output Scan Communications Processor Overhead.
Switchgears Control Using SCADA System Based on PLC
5/20/2015IENG 475: Computer-Controlled Manufacturing Systems 1 IENG Lecture 14 Ladder Logic Programming of PLCs.
FUNCTION OF OUTPUT CONTROLLER AND APPLICATION
PLC OPERATION & PROGRAMMING Dr. ONUR TOKER. What is a PLC ? PLC is a computer system controlling a process. inputs - the keyboard is analogous to a proximity.
Programmable Logic Controllers
Chapter 19 Fundamental PLC Programming
Logic Functions OR Operation
Timers.
Advanced Instructions Most PLCs now support more advanced functions such as Floating point math, Boolean operations, Shifting, Sequencing, Program control.
MOV,MOVM,COP,FLL,BSL,BSR, FRD,TOD
Chapter 10 PLC Processors.
Program Control Instructions:
Programming PLCs using LADDER Logic
Counter The CTU CTD instruction counts upward & Down wards over a range Each time the rung goes from false- to-true. We can make an Up-Down counter by.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 4: Control Structures I (Selection)
Memory Layout and SLC500™ System Addresses. Processor Memory Division An SLC 500 processor's memory is divided into two storage areas. Like two drawers.
Memory Layout and SLC500 System Addresses. Processor Memory Division An SLC 500 processor's memory is divided into two storage areas. Like two drawers.
Chapter 8.
Chapter 10 Advanced Programming, PLC Interfacing, and Troubleshooting
Logic Functions and Symbols
PROGRAMMABLE LOGIC CONTROLLER
Timers and Counters by Dr. Amin Danial Asham. References  Programmable Controllers-Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
PLC PROGRAMMING.
LADDER PROGRAMMING LANGUAGE by Dr. Amin Danial Asham.
1 Micro Economix 1500 RSLogix 500 LAB#3 Sequencing and Subroutines.
PROGRAMMABLE LOGIC CONTROLLER (PLC) AND AUTOMATION
Programmable Logic Controllers
Sequencers SQO,SQC,SQL.
Timers. Mechanical Timing Relay Time delay relays are simply control relays with a time delay built in. Their purpose is to control an event based on.
SEMINAR ON P.L.C. SUBMITTED BY HRIDAY MUKHERJEE AMIT DEBNATH SOMNATH SHIL
Actuators and Control, Part 4 Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning.
Chapter 5.
Chapter 11 & 13 PLC Math Instructions Permission granted to reproduce for educational use only. 11 PLC Compare, Jump, and MCR Instructions.
Chapter 4: Control Structures I (Selection). Objectives In this chapter, you will: – Learn about control structures – Examine relational operators – Discover.
1 Introduction to PLCs: Programming Counters ELMT Basic Programmable Logic Controllers Chapter 0x_W Source: www Based on Ch 8 of Frank D. Petruzella.
Chapter 7.
6 CHAPTER PLC Programming. 6 CHAPTER PLC Programming.
Chapter 4: Control Structures I (Selection)
9 CHAPTER PLC Counter Instructions. 9 CHAPTER PLC Counter Instructions.
Chapter 5.
Programming Logic and Design Fourth Edition, Comprehensive
Chapter 10 © 2011, The McGraw-Hill Companies, Inc.
Scripts & Functions Scripts and functions are contained in .m-files
Programming Timers.
Programmable Logic Controllers
MicroEconomix 1500 RSLogix 500 LAB#2
Timer Instructions Overview
Chapter 4: Control Structures I (Selection)
MicroEconomix 1500 RSLogix 500 LAB#1
Lesson 19: PLC Programming Techniques
Programmable Controller Basics Files And Programs
Advanced Math Functions
Basic Relay Instructions
BIC 10503: COMPUTER ARCHITECTURE
GE Integers, ZCL, Jump Commands
Chapter 4 Selection.
BRX Technical Training
S RAJARAJAN_ASST PROF, BSARCIS&T
PLC 5 and ControlLogix Subroutine Parameters
Chapter 4: Control Structures I (Selection)
Programmable Logic Controllers (PLCs)
ECE 352 Digital System Fundamentals
Presentation transcript:

Program Control Instructions

Program Control Instructions Program control instructions are used to alter the program scan from its normal sequence. Sometimes referred to as override instructions, they provide a means of executing sections of the control logic if certain conditions are met. They allow for greater program flexibility and greater efficiency in the program scan.

Typical Program Control Instructions Based On The SLC 500 And Associated RSLogix Software TND TND Temporary End Makes a temporary end that halts program execution RET RET Return from Subroutine Exits current subroutine and returns to previous condition MCR MCR Master Control Reset Clears all set outputs between the paired MCR instruction SUS SUS Suspend Identifies specific conditions for program debugging and system troubleshooting JMP JMP Jump to Label Jump forward/backward to a corresponding label instruction JSR Jump to Subroutine Jump to a designated subroutine instruction JSR SBR SBR Subroutine Identifies the subroutine program LBL LBL Label Specifies label location Program Control

Hardwired Master Control Relay Circuit Hardwired master control relays are used in relay circuitry to provide input/output power shutdown of an entire circuit.

Hardwired Master Control Relay Circuit

MCR Instruction MCR The master control reset (MCR) instruction can be programmed to control an entire circuit or to control only selected rungs of a circuit. When the MCR instruction is false, or de-energized, all nonretentive (nonlatched) rungs below the the MCR will be de-energized even if the programmed logic for each rung is true. All retentive rungs will remain in their last state. The MCR instruction establishes a zone in the user program in which all nonretentive outputs can be turned off simultaneously. Therefore, retentive instructions should not normally be placed within an MCR zone because the MCR zone maintains retentive instructions in the last active state when the instruction goes false.

MCR Instruction Programmed To Control An Entire Circuit

MCR Instruction Programmed To Control A Fenced Zone The Master Control Reset (MCR) instruction is used in pairs to disable or enable a zone within a ladder program and has no address. You program the first MCR with input instructions in the rung and the ending MCR without any other instructions in the rung. Fenced Zone

MCR Instruction Programmed To Control A Fenced Zone MCR Zone True Lab # 1

MCR Instruction Programmed To Control A Fenced Zone MCR Zone False Lab # 1

Programming MCR Instructions If you start instructions such as timers and counters in an MCR zone, instruction operation ceases when the zone is disabled. The TOF timer will activate when placed inside a false MCR zone. When troubleshooting a program that contains an MCR zone you need to be aware of which rungs are within zones in order to correctly edit the circuit. MCR controlled areas must contain only two MCR instructions – one to define the start and one to define the end.

JMP Jump Instruction As in computer programming, it is sometimes desirable to be able to jump over certain program instructions. The jump instruction (JMP) is an output instruction used for this purpose. The advantages to the jump instruction include: the ability to reduce the processor scan time by jumping over instructions not pertinent to the machines operation at that instant The PLC can hold more than one program and scan only the program appropriate to operator requirements Sections of a program can be jumped when a production fault occurs

Jump-To-Label Instructions In a SLC 500 the JMP will have a number from 0 to 255, and the corresponding LBL will have the same number. In the ControlLogix controller the JMP and LBL have the same name. Avoid jumping backwards in the program too many times as this may increase the scan beyond the maximum allowable time. The processor has a watchdog timer that sets the maximum time for a total program scan. If this time is exceeded, the processor will indicate a fault and shut down. You should never jump into an MCR zone. Instructions that are programmed within the MCR zone starting at the LBL instruction and ending at the end MCR instruction will always be evaluated as though the MCR zone is true, without consideration to the state of the start MCR instruction.

Jump Operation By using the jump instruction, you can branch or skip to different portions of a program and freeze all affected outputs in their last state. Jumps are normally allowed in both the forward and backward directions. Jumping over counters and timers will stop them from being incremented.

Jump-To-Label With Allen-Bradley PLCs the jump (JMP) instruction and the label (LBL) instruction are employed together so the scan can jump over a portion of the program. The label is a target for the jump, it is the first instruction in the rung, and it is always true. A jump jumps to a label with the same address. The area that the processor jumps over is defined by the locations of the jump and label instructions in the program. If the jump coil is energized, all logic between the jump and label instructions is bypassed and the processor continues scanning after the LBL instruction.

Jump To Label Program Jumped program Timers should be programmed outside the jumped section Input conditions are not examined and outputs remain in their last state Jumped program rungs (5,6,7) are not scanned by the processor Lab # 2

Jump-To-Label From Two Locations 20

Jump - To - Subroutine Another valuable tool in PLC programming is to be able to escape from the main program and go to a program subroutine to perform certain functions and then return to the main program.

Allen-Bradley Subroutine-Related Instructions The JSR instruction causes the scan to jump to the program file designated in the instruction. It is the only parameter entered in the instruction. When rung conditions are true for this output instruction, it causes the processor to jump to the targeted subroutine file. Each subroutine must have a unique file number (decimal 3-255).

Allen-Bradley Subroutine-Related Instructions The SBR instruction is the first instruction on the first rung in the subroutine file. It serves as an identifier that the program file is a subroutine. This is the file number that is used in the JSR instruction to identify the target to which the program should jump. It always true and although its use is optional, it is still recommended.

Allen-Bradley Subroutine-Related Instructions The RET instruction is an output instruction that marks the end of the subroutine file. It causes the scan to return to the main program at the instruction following the JSR instruction where it exited the program. The scan returns from the end of the file if there is no RET instruction. The rung containing the RET instruction may be conditional if this rung precedes the end of the subroutine. In this way, the processor omits the balance of a subroutine only if its rung condition is true.

Setting Up A Subroutine File

Flashing Pilot Light Subroutine If the weight on the conveyor exceeds a preset value, the solenoid is de-energized and the alarm light will begin flashing. Process When the weight sensor switch closes, the JSR is activated and the processor scan jumps to the subroutine area. The subroutine is continually scanned and the light flashes. When the sensor switch opens, the processor will no longer scan the subroutine area and will return to the on state.

Setting Up A Subroutine File SLC-500 controller subroutines are located in different program files from the main program. The main program is located in program file 2, whereas subroutines are assigned to program file numbers 3 to 255. Note each ladder location where a subroutine should be called. Create a subroutine file for each location. Each subroutine file should begin with an SBR instruction. At each ladder location where a subroutine is called, program a JSR instruction specifying the subroutine file number. The RET instruction is optional as the end of a subroutine program will cause a return to the main program.

Nested Subroutines 5/02 Processors allow up to 8 nesting sub routines