SlideShare a Scribd company logo
1 of 34
Comparison, Forcing I/O and 
Subroutines 
Chapter 07 Sections 7-4 through 7-6 
Chapter 08 Sections 8-1, 8-2, 8-3-3 through 
8-3-5 
Northampton Community College 1
Comparison Instructions 
Chapter 07 Sections 7-4 through 7-6 
Northampton Community College 2
Data Compare Instructions 
Northampton Community College 3 
 
Data compare instructions are input instructions. 
 
Data compare instructions compare the data, or value, 
stored in two words (or registers) and makes a decision 
based upon those values and the type of comparison being 
performed. 
 
The SLC-500 series processors have eight and the 
ControlLogix has nine comparison instructions. We will 
cover seven of them. 
 Equal (EQU) 
 Not Equal (NEQ) 
 Less Than (LES) 
 Less Than or Equal To (LEQ) 
 Greater Than (GRT) 
 Greater Than or Equal To (GEQ) 
 Limit Test (LIM)
Comparison Instruction Parameters 
Northampton Community College 4 
 
Comparison instructions in the SLC500 are word level instructions and 
in the ControlLogix a tag of data type SINT, INT, DINT REAL or 
STRING. The instructions have two parameters: 
 Source A 
 Source B 
Source A 
Source B
Instruction Comparison Rules 
Northampton Community College 5 
 
Comparison instruction parameters have several rules: 
 In the SLC500, Source A and Source B can be WORD level addresses. In 
the ControlLogix Source A and Source B can be a tag of data type SINT, 
INT, DINT, REAL or STRING. 
 Source A can be a WORD level address in the SLC500 or a tag in the 
ControlLogix and Source B can be a program constant. 
 Source A and Source B can not both be program constants. 
Two WORD level 
addresses 
A WORD level 
address and a 
Constant 
Two Constants 
Illegal
Equal (EQU) Instruction 
Northampton Community College 6 
 
The EQU instruction is an input instruction that compares the value referenced 
in Source A to the value referenced in source B. When the value of Source A is 
equal to the value of Source B the instruction is true, otherwise it is false. 
 
When the accumulator value of counter C5:0 (C5:0.ACC) referenced in Source 
A is equal to the accumulator value of counter C5:1 (C5:1.ACC) referenced in 
Source B, the instruction is true and output O:2/5 is energized, otherwise the 
instruction is false and the output is de-energized. 
When the program is 
running, the value of the 
WORD level address will 
be displayed in this field. 
True when Source A = Source B
Not Equal (NEQ) Instruction 
Northampton Community College 7 
 
The NEQ instruction is an input instruction that compares the value 
referenced in Source A to the value referenced in source B. When the 
value of Source A is not equal to the value of Source B the instruction is 
true, otherwise it is false. 
 
When the accumulator value of timer T4:0 (T4:0.ACC) referenced in 
Source A is not equal to the program constant of 36 referenced in 
Source B, the instruction is true and output O:2/5 is energized, 
otherwise the instruction is false and the output is de-energized. 
When the program is 
running, the value of the 
WORD level address will 
be displayed in this field. 
True when Source A ≠ Source B
Greater Than (GRT) Instruction 
Greater Than (A>B) 
Source A SetPoint 
0 
Source B Furnace_Temp 
0 
Northampton Community College 8 
 
The GRT instruction is an input instruction that compares the value 
referenced in Source A to the value referenced in source B. When the 
value of Source A is greater than the value of Source B the instruction is 
true, otherwise it is false. 
 
When the value stored in tag name SetPoint referenced in Source A is 
greater than the value stored in tag name Furnace_Temp referenced in 
Source B, the instruction is true and the output with tag name Heater is 
energized, otherwise the instruction is false and the output is de-energized. 
True when Source A > Source B 
GRT 
Heater 
<Local:3:O.Data.5> 
When the program is 
running, the value of the 
WORD level address will 
be displayed in this field.
Less Than (LES) Instruction 
When the program is 
running, the value of the 
WORD level address will 
be displayed in this field. 
Northampton Community College 9 
 
The LES instruction is an input instruction that compares the value 
referenced in Source A to the value referenced in source B. When the 
value of Source A is less than the value of Source B the instruction is 
true, otherwise it is false. 
 
When the value stored in the preset of timer T4:0 (T4:0.PRE) referenced 
in Source A is less than the accumulator value of counter C5:2 
(C5:2.ACC) referenced in Source B, the instruction is true and output 
O:2/5 is energized, otherwise the instruction is false and the output is 
de-energized. 
True when Source A < Source B
Greater Than or Equal To (GEQ) Instruction 
Northampton Community College 10 
 
The GEQ instruction is an input instruction that compares the value 
referenced in Source A to the value referenced in source B. When the 
value of Source A is greater than or equal to the value of Source B the 
instruction is true, otherwise it is false. 
 
When the value stored in word B3:1 referenced in Source A is greater 
than or equal to the program constant of 568 referenced in Source B, the 
instruction is true and output O:2/5 is energized, otherwise the 
instruction is false and the output is de-energized. 
When the program is 
running, the value of the 
WORD level address will 
be displayed in this field. 
True when Source A ≥ Source B
Less Than or Equal To (LEQ) Instruction 
Less Than or Eql (A<=B) 
Source A Refrg_Temp 
0 
Source B SetPoint 
0 
Northampton Community College 11 
 
The LEQ instruction is an input instruction that compares the value 
referenced in Source A to the value referenced in source B. When the 
value of Source A is less than or equal to the value of Source B the 
instruction is true, otherwise it is false. 
 
When the value of the tag name Refrg_Temp referenced in Source A is 
less than or equal to the value of the tag named SetPoint referenced in 
Source B, the instruction is true and the output with tag name 
Refrg_at_Temp is energized, otherwise the instruction is false and the 
output is de-energized. 
True when Source A ≤ Source B 
LEQ 
Refrg_at_Temp 
<Local:3:O.Data.13> 
When the program is 
running, the value of the 
WORD level address will 
be displayed in this field.
Limit Test (LIM) Instruction 
Northampton Community College 12 
 
The Limit Test instruction is an input instruction that tests for values that 
are inside of, or outside of, a specified range. The output of the 
instruction is dependent upon how the limits are set. 
 
The LIM instruction has three instruction parameters: 
 Low Limit (Low Lim) 
 Test 
 High Limit (High Lim) 
Low Limit (Low Lim) 
Test 
High Limit (High Lim)
LIM Parameter Rules 
Northampton Community College 13 
 
There are several rules associated with entering 
parameters into the LIM instruction: 
 The parameter values in the SLC 500 can be WORD 
level addresses or program constants and in the 
ControlLogix they can be tags of data type SINT, INT, 
DINT, REAL or program constants, with the following 
restrictions: 
If the Test parameter is a program constant, than the High Lim 
and Low Lim parameters must be WORD level addresses or 
tags. 
If the test parameter is a WORD level address or tag, than the 
Low Lim and High Lim parameters can be a program constant, a 
WORD level address or tag or a combination thereof.
LIM Instruction Operation 
O:2/7 OFF O:2/7 ON O:2/7 OFF 
Northampton Community College 14 
 
If the value referenced in the Low Lim is less than or equal 
to the value referenced in the High Lim, the instruction will 
be true when the value referenced in the Test parameter is 
between or equal to either of the limits. 
O:2/7 will be true (ON) 
when T4:1.ACC is: 
≥78 and ≤156 
78 156 
T4:1.ACC
LIM Instruction Operation 
78 156 
Heater ON Heater OFF Heater ON 
Northampton Community College 15 
 
If the value referenced in the Low Lim is greater than the 
value referenced in the High Lim, the instruction will be true 
when the value referenced in the Test parameter is equal to 
or outside of the limits. 
SetPoint 
4 Limit Test (CIRC) 
Low Limit LO_Temp_Lmt 
156 
Test SetPoint 
36 
High Limit HI_Temp_Lmt 
78 
LIM 
Heater 
<Local:3:O.Data.5> 
Heater will be true 
(ON) when the value 
stored in SetPoint is: 
≤78 OR ≥156
Performing Comparison Windows 
Northampton Community College 16 
 
Assume an output is being controlled based upon the value 
of a counter accumulator, C5:0.ACC. Following is the output 
operation criteria: 
 Output is OFF when C5:0.ACC is 0 to and including 3. 
 Output is ON when C5:0.ACC is 4 to and including 7. 
 Output is OFF when C5:0.ACC is 8 to and including 10. 
 Output is ON when C5:0.ACC is 11 to and including 25. 
 Output is OFF when C5:0.ACC is >25. 
 
Comparison instructions can be used in combinations to 
achieve the desired results.
Performing Comparison Windows 
Northampton Community College 17
Subroutines 
Chapter 08 
Sections 8-3-3 to 8-3-5 
Supplement Document 
Northampton Community College 18
Subroutines 
Northampton Community College 19 
 
Subroutine(s) is a group of program code that performs a specific 
task. The subroutine(s) are part of a program (in our case the 
MainProgram) and are not part of the MainRoutine. 
 
A subroutine can be invoked, (called), from anyplace in the 
MainRoutine or from another subroutine. When a subroutine is 
called from within another subroutine it is referred to as nesting 
subroutines. 
 
Most, if not all, computer programs and PLC/PAC programs 
contain subroutines. 
 
Subroutines are used to make what would be an enormous 
program more manageable by breaking up the code into smaller 
tasks. Specific functions within a task should be placed in 
subroutines. 
 
Organizing a program by using subroutines makes the code 
easier to read, understand and maintain. 
 
Subroutines can also be reused in other programs that require 
the same task be performed.
Subroutines 
SLC500 
 
The SLC500 uses 
separate ladder files to 
store and execute 
subroutines. There are a 
total of 253 subroutine 
ladder files; #3 through 
#255. 
Northampton Community College 20 
 
Ladder file #2 (LAD2) is 
the main ladder file and is 
the one we have been 
using in all labs to this 
date. 
 
Scan starts at rung 0 LAD2 
and ends at the End 
statement in LAD2. 
ControlLogix 
 
The ControlLogix uses 
separate routines to store 
and execute subroutines. 
The number of routines is 
limited to 32 per program. 
 
The MainRoutine is the 
main ladder routine and is 
the one we have been 
using in all labs to this 
date. 
 
Scan starts at rung 0 in the 
MainRoutine and ends at 
the End statement in the 
MainRoutine
Creating a ControlLogix Subroutine 
1. To create a new subroutine right 
click on MainProgram and select 
New Routine… from the pop-up 
menu 
2. New Routine dialog box will open. 
Type in the name of the subroutine 
and from the Type: dropdown, 
select the type of program code. 
3. The new 
subroutine will appear 
listed under the 
program that it was 
created in. Double 
click the subroutine to 
open the ladder 
editor. 
Northampton Community College 21
Program Control Instructions 
Northampton Community College 22 
 
There are many program control instructions. Below is a list of them and the 
platforms they are available on: 
Instruction CL 500 Sim Instruction CL 500 Sim 
JMP – Jump to Label ● ● ● 
UID – User Interrupt 
Disable 
● 
LBL – Label ● ● ● 
UIE – User Interrupt 
Enable 
● 
JXR – Jump to External Routine ● 
SFR – Reset Sequential 
Chart 
● 
JSR – Jump to Subroutine ● ● ● 
SFP – Pause Sequential 
Chart 
● 
RET – Return from Subroutine ● ● ● 
EVENT – Trigger Event 
Task 
● 
SBR – Subroutine Label ● ● ● EOT – End of Transition ● 
TND – Temporary End ● ● ● AFI – Always False ● 
MCR – Master Control Reset ● ● ● NOP – No Operation ● 
SUS - Suspend 
 
This course will only cover the instructions shown in Red. The instruction in 
Green can be used, but they will not be discussed in class.
ControlLogix Program Control Instructions 
Northampton Community College 23 
 
JSR – Jump to Subroutine 
 
The JSR is an output instruction that is used to “call” a 
subroutine. 
 
The instruction rung can be conditional or unconditional. 
 
JSR instructions can have several parameters. The one 
shown here has 3-parameters. Subroutine name to 
be “called” (required) 
Parameter to pass to 
the subroutine 
(optional) 
Parameter to accept a 
value returning from 
the subroutine 
(optional)
ControlLogix Program Control Instructions 
Northampton Community College 24 
 
Entering JSR parameters: 
 Routine Name (Required) – 
Double-click this parameter field, 
click the dropdown arrow and 
select the subroutine name from 
the dropdown list. The subroutine 
name will only be in the list if the 
subroutine has been created. 
 Input Par and Return Par 
(Optional) – These parameters 
will not be used in this course. 
When a parameter is not used it 
must be removed. Right click on 
the parameter field and select 
Remove Instruction Parameter 
from the pop-up menu. Do this for 
each parameter that is not 
required. The picture on this slide 
illustrates removing a parameter 
field.
ControlLogix Program Control Instructions 
Northampton Community College 25 
 
JSR operation 
 
When the rung containing a JSR instruction is true, the 
processor scan jumps to the subroutine referenced in the 
Routine Name parameter and begins program execution at 
the first rung in that subroutine 
 
A jump cannot be made into the middle of a subroutine. 
Execution will always start at the first instruction on the first 
rung in that ladder routine. 
This rung will unconditionally jump to the 
subroutine named Routine04
ControlLogix Program Control Instructions 
Northampton Community College 26 
 
SBR – Subroutine Label 
 
The SBR in an input instruction that is always true and 
marks the beginning of a subroutine. It must be the first 
instruction on the first rung of the subroutine. 
 
The input parameter field(s) is used to reference tags 
whose data is to be used (passed) to the subroutine. (This 
course will not be using these parameters). 
 
SBR instructions can have several parameters. The one 
shown here has one parameters. 
Parameter that passes 
data to the subroutine 
(optional)
ControlLogix Program Control Instructions 
Northampton Community College 27 
 
For this course the Input Par parameter will need to be 
removed from the SBR instruction. To remove the 
parameter right-click on the parameter and select Remove 
Instruction Parameter from the pop-up menu.
ControlLogix Program Control Instructions 
Northampton Community College 28 
 
RET – Return from Subroutine 
 
The RET instruction is an output instruction that is used to 
stop executing the subroutine and return to the ladder file 
that originally “called” the subroutine. 
 
The instruction can be conditional or unconditional and can 
contain several parameters. The RET instruction shown 
here has one parameter. (This course will not use these 
parameters). 
Parameter that passes 
data back to the 
ladder file that 
originally “called” the 
subroutine. (optional)
ControlLogix Program Control Instructions 
Northampton Community College 29 
 
For this course the Input Par parameter will need to be 
removed from the RET instruction. To remove the 
parameter right-click on the parameter and select Remove 
Instruction Parameter from the pop-up menu.
ControlLogix Program Control Instructions 
Northampton Community College 30 
 
Several conditional RET instructions can be present in a 
subroutine. As an example: 
 If an RET instruction becomes true that is on rung 0006 in a 
subroutine containing 45-rungs, the program scan will return to the 
ladder file that originally called the subroutine and rungs 0007 
through 0045 will not execute. 
 If the RET instruction on rung 0006 becomes false another RET 
instruction becomes true that is on rung 0010 in the same 
subroutine, the program scan will return to the ladder file that 
originally called the subroutine and rungs 0011 through 0045 will not 
executed. 
 
If the entire subroutine ladder file is to be always scanned, 
placing a RET instruction on the last rung of the program is 
optional. If an RET instruction is not found in the subroutine 
ladder file, the END statement performs the return.
Program Execution using Subroutines 
Northampton Community College 31
Forcing I/O 
Northampton Community College 32
Using the Force I/O Function 
Northampton Community College 33 
 
The force function will only work on field I/O devices, 
therefore the input and output data files in the SLC500 and 
the Controller tags in the ControlLogix. 
 
Before applying a force to any input or any output device, 
an understanding of the potential effect that force(s) will 
have on the machine or process operation and to the safety 
of personal is essential. 
DO NOT INSTALL FORCES WITHOUT FIRST 
UNDERSTANDING WHAT AFFECT IT WILL HAVE ON 
THE OPERATION OF THE MACHINE OR PROCESS 
 
Most programming software provide some visible means of 
alerting the user that a force is in affect or installed. 
 
Most processor modules have an LED indicator that will be 
lit if there are any forces installed.
Installing and Enabling Forces 
Northampton Community College 34 
 
This is an instructor led, interactive lab. 
 
If there is no program running in the PLC at your 
workstation, open a program that uses I/O field devices, 
download the program to the PLC, then place the PLC in 
RUN mode. 
 
Your instructor will also switch to RSLogix and attach to 
someone’s workstation to lead you through and 
demonstrate the force functions.

More Related Content

What's hot

Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generationIffat Anjum
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler DesignShine Raj
 
Compiler Design File
Compiler Design FileCompiler Design File
Compiler Design FileArchita Misra
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)bolovv
 
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Saikrishna Tanguturu
 
Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Chinmayee samal
 
Chapter Seven(2)
Chapter Seven(2)Chapter Seven(2)
Chapter Seven(2)bolovv
 
Intermediate code- generation
Intermediate code- generationIntermediate code- generation
Intermediate code- generationrawan_z
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazationSiva Sathya
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generationIffat Anjum
 
Report on c and c++
Report on c and c++Report on c and c++
Report on c and c++oggyrao
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generationRamchandraRegmi
 

What's hot (20)

Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generation
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler Design
 
Back patching
Back patchingBack patching
Back patching
 
Compiler Design File
Compiler Design FileCompiler Design File
Compiler Design File
 
Compiler unit 4
Compiler unit 4Compiler unit 4
Compiler unit 4
 
Code generation
Code generationCode generation
Code generation
 
Compiler unit 5
Compiler  unit 5Compiler  unit 5
Compiler unit 5
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)
 
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
 
Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085
 
Chapter Seven(2)
Chapter Seven(2)Chapter Seven(2)
Chapter Seven(2)
 
Interm codegen
Interm codegenInterm codegen
Interm codegen
 
Intermediate code- generation
Intermediate code- generationIntermediate code- generation
Intermediate code- generation
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazation
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generation
 
Report on c and c++
Report on c and c++Report on c and c++
Report on c and c++
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Chapter 5 programming concepts iv
Chapter 5  programming concepts ivChapter 5  programming concepts iv
Chapter 5 programming concepts iv
 
Code optimization
Code optimizationCode optimization
Code optimization
 
Co&amp;al lecture-07
Co&amp;al lecture-07Co&amp;al lecture-07
Co&amp;al lecture-07
 

Viewers also liked

Move mask moves_rev01_fa16
Move mask moves_rev01_fa16Move mask moves_rev01_fa16
Move mask moves_rev01_fa16John Todora
 
NB Designer Manual Operation [unlockplc.com]
NB Designer Manual Operation [unlockplc.com]NB Designer Manual Operation [unlockplc.com]
NB Designer Manual Operation [unlockplc.com]unlockplc123
 
Diseño de juegos
Diseño de juegosDiseño de juegos
Diseño de juegosNicole2411
 
04 scaling analog_datal_sp17
04 scaling analog_datal_sp1704 scaling analog_datal_sp17
04 scaling analog_datal_sp17John Todora
 
03 analog control_sp17
03 analog control_sp1703 analog control_sp17
03 analog control_sp17John Todora
 
Data Manipulation and Math Instruction on RSLogix 500
Data Manipulation and Math Instruction on RSLogix 500Data Manipulation and Math Instruction on RSLogix 500
Data Manipulation and Math Instruction on RSLogix 500Lino Hugun Saputra
 
Manejo de avisos y alarmas en HMI
Manejo de avisos y alarmas en HMIManejo de avisos y alarmas en HMI
Manejo de avisos y alarmas en HMIjohn piñeros
 
Cap5. circuitos neumaticos
Cap5. circuitos neumaticosCap5. circuitos neumaticos
Cap5. circuitos neumaticoschorisin87
 
Programación estructurada Siemens - TIA PORTAL
Programación estructurada Siemens - TIA PORTALProgramación estructurada Siemens - TIA PORTAL
Programación estructurada Siemens - TIA PORTALjohn piñeros
 
Manual manejo TIA PORTAL SIEMENS
Manual manejo TIA PORTAL SIEMENSManual manejo TIA PORTAL SIEMENS
Manual manejo TIA PORTAL SIEMENSjohn piñeros
 

Viewers also liked (20)

Move mask moves_rev01_fa16
Move mask moves_rev01_fa16Move mask moves_rev01_fa16
Move mask moves_rev01_fa16
 
Slc500cap6
Slc500cap6Slc500cap6
Slc500cap6
 
NB Designer Manual Operation [unlockplc.com]
NB Designer Manual Operation [unlockplc.com]NB Designer Manual Operation [unlockplc.com]
NB Designer Manual Operation [unlockplc.com]
 
Diseño de juegos
Diseño de juegosDiseño de juegos
Diseño de juegos
 
04 scaling analog_datal_sp17
04 scaling analog_datal_sp1704 scaling analog_datal_sp17
04 scaling analog_datal_sp17
 
03 analog control_sp17
03 analog control_sp1703 analog control_sp17
03 analog control_sp17
 
Data Manipulation and Math Instruction on RSLogix 500
Data Manipulation and Math Instruction on RSLogix 500Data Manipulation and Math Instruction on RSLogix 500
Data Manipulation and Math Instruction on RSLogix 500
 
Sap -mise_en_oeuvre
Sap  -mise_en_oeuvreSap  -mise_en_oeuvre
Sap -mise_en_oeuvre
 
Controllogix 5000 Training
Controllogix 5000 TrainingControllogix 5000 Training
Controllogix 5000 Training
 
Arquitectura Integrada
Arquitectura IntegradaArquitectura Integrada
Arquitectura Integrada
 
Examen sap master 2015
Examen sap master 2015Examen sap master 2015
Examen sap master 2015
 
Manejo de avisos y alarmas en HMI
Manejo de avisos y alarmas en HMIManejo de avisos y alarmas en HMI
Manejo de avisos y alarmas en HMI
 
PLC and SCADA
PLC and SCADAPLC and SCADA
PLC and SCADA
 
Cap5. circuitos neumaticos
Cap5. circuitos neumaticosCap5. circuitos neumaticos
Cap5. circuitos neumaticos
 
Programación estructurada Siemens - TIA PORTAL
Programación estructurada Siemens - TIA PORTALProgramación estructurada Siemens - TIA PORTAL
Programación estructurada Siemens - TIA PORTAL
 
Allen Bradley- Micrologix PLC Instructions
Allen Bradley- Micrologix PLC InstructionsAllen Bradley- Micrologix PLC Instructions
Allen Bradley- Micrologix PLC Instructions
 
Programación SIEMENS S7 200
Programación SIEMENS S7 200Programación SIEMENS S7 200
Programación SIEMENS S7 200
 
Manual manejo TIA PORTAL SIEMENS
Manual manejo TIA PORTAL SIEMENSManual manejo TIA PORTAL SIEMENS
Manual manejo TIA PORTAL SIEMENS
 
Step 7 avanzado
Step 7 avanzadoStep 7 avanzado
Step 7 avanzado
 
INSTALACIÓN NEUMATICA
INSTALACIÓN NEUMATICAINSTALACIÓN NEUMATICA
INSTALACIÓN NEUMATICA
 

Similar to 13 chap07 and_08_comparison_subs_force_fa14

Lecture05 abap on line
Lecture05 abap on lineLecture05 abap on line
Lecture05 abap on lineMilind Patil
 
Java Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdfJava Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdfROWELL MARQUINA
 
Programming Fundamentals lecture 7
Programming Fundamentals lecture 7Programming Fundamentals lecture 7
Programming Fundamentals lecture 7REHAN IJAZ
 
Microcontroladores: introducción a la programación en lenguaje ensamblador AVR
Microcontroladores: introducción a la programación en lenguaje ensamblador AVRMicrocontroladores: introducción a la programación en lenguaje ensamblador AVR
Microcontroladores: introducción a la programación en lenguaje ensamblador AVRSANTIAGO PABLO ALBERTO
 
The 8051 microcontroller
The 8051 microcontrollerThe 8051 microcontroller
The 8051 microcontrollerPallaviHailkar
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in Csana shaikh
 
Enhanced pid pide
Enhanced pid pideEnhanced pid pide
Enhanced pid pideKamit Patel
 
CIS 1403 lab 4 selection
CIS 1403 lab 4 selectionCIS 1403 lab 4 selection
CIS 1403 lab 4 selectionHamad Odhabi
 
C language UPTU Unit3 Slides
C language UPTU Unit3 SlidesC language UPTU Unit3 Slides
C language UPTU Unit3 SlidesRakesh Roshan
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfssuserf86fba
 
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
Algorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTSAlgorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTS
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTSAlicia Edwards
 
De so 1
De so 1De so 1
De so 1kiennt
 
Umts parameter reference
Umts parameter referenceUmts parameter reference
Umts parameter referenceamini110
 

Similar to 13 chap07 and_08_comparison_subs_force_fa14 (20)

Lecture05 abap on line
Lecture05 abap on lineLecture05 abap on line
Lecture05 abap on line
 
Java Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdfJava Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdf
 
Black-Box.ppt
Black-Box.pptBlack-Box.ppt
Black-Box.ppt
 
Lect07
Lect07Lect07
Lect07
 
Programming Fundamentals lecture 7
Programming Fundamentals lecture 7Programming Fundamentals lecture 7
Programming Fundamentals lecture 7
 
Microcontroladores: introducción a la programación en lenguaje ensamblador AVR
Microcontroladores: introducción a la programación en lenguaje ensamblador AVRMicrocontroladores: introducción a la programación en lenguaje ensamblador AVR
Microcontroladores: introducción a la programación en lenguaje ensamblador AVR
 
The 8051 microcontroller
The 8051 microcontrollerThe 8051 microcontroller
The 8051 microcontroller
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in C
 
C language
C languageC language
C language
 
Enhanced pid pide
Enhanced pid pideEnhanced pid pide
Enhanced pid pide
 
CIS 1403 lab 4 selection
CIS 1403 lab 4 selectionCIS 1403 lab 4 selection
CIS 1403 lab 4 selection
 
C++
C++ C++
C++
 
C operator and expression
C operator and expressionC operator and expression
C operator and expression
 
C language UPTU Unit3 Slides
C language UPTU Unit3 SlidesC language UPTU Unit3 Slides
C language UPTU Unit3 Slides
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
 
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
Algorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTSAlgorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTS
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
 
Algorithm manual
Algorithm manualAlgorithm manual
Algorithm manual
 
De so 1
De so 1De so 1
De so 1
 
Ch05
Ch05Ch05
Ch05
 
Umts parameter reference
Umts parameter referenceUmts parameter reference
Umts parameter reference
 

More from John Todora

01 control logix_arrays_sp17
01 control logix_arrays_sp1701 control logix_arrays_sp17
01 control logix_arrays_sp17John Todora
 
Subroutines rev01 fa16
Subroutines rev01 fa16Subroutines rev01 fa16
Subroutines rev01 fa16John Todora
 
ControlLogix Counters FA16
ControlLogix Counters FA16ControlLogix Counters FA16
ControlLogix Counters FA16John Todora
 
ControlLogix Timers FA16
ControlLogix Timers FA16ControlLogix Timers FA16
ControlLogix Timers FA16John Todora
 
02 chapter02 fa16
02 chapter02 fa1602 chapter02 fa16
02 chapter02 fa16John Todora
 
01 introduction to_plc-pac_rev01_fa16
01 introduction to_plc-pac_rev01_fa1601 introduction to_plc-pac_rev01_fa16
01 introduction to_plc-pac_rev01_fa16John Todora
 
07 chapter07 loop_diagrams
07 chapter07 loop_diagrams07 chapter07 loop_diagrams
07 chapter07 loop_diagramsJohn Todora
 
06 chapter06 binary_logic_systems_Rev02
06 chapter06 binary_logic_systems_Rev0206 chapter06 binary_logic_systems_Rev02
06 chapter06 binary_logic_systems_Rev02John Todora
 
04 chapter04 specification_forms
04 chapter04 specification_forms04 chapter04 specification_forms
04 chapter04 specification_formsJohn Todora
 
03 chapter03 lists_indexes_databases
03 chapter03 lists_indexes_databases03 chapter03 lists_indexes_databases
03 chapter03 lists_indexes_databasesJohn Todora
 
02 chapter02 p&ids_and_symbols_split_animations
02 chapter02 p&ids_and_symbols_split_animations02 chapter02 p&ids_and_symbols_split_animations
02 chapter02 p&ids_and_symbols_split_animationsJohn Todora
 
01 chapter01 process_flow_diagram
01 chapter01 process_flow_diagram01 chapter01 process_flow_diagram
01 chapter01 process_flow_diagramJohn Todora
 
EMEC130 P&ID Symbol Primer
EMEC130 P&ID Symbol PrimerEMEC130 P&ID Symbol Primer
EMEC130 P&ID Symbol PrimerJohn Todora
 
02 copy file_fill_sp16
02 copy file_fill_sp1602 copy file_fill_sp16
02 copy file_fill_sp16John Todora
 
Control Systems Basics
Control Systems BasicsControl Systems Basics
Control Systems BasicsJohn Todora
 
01 overview of_industrial_automation_sp15
01 overview of_industrial_automation_sp1501 overview of_industrial_automation_sp15
01 overview of_industrial_automation_sp15John Todora
 
05 analog control_sp15
05 analog control_sp1505 analog control_sp15
05 analog control_sp15John Todora
 

More from John Todora (20)

01 control logix_arrays_sp17
01 control logix_arrays_sp1701 control logix_arrays_sp17
01 control logix_arrays_sp17
 
Lab02 review
Lab02 reviewLab02 review
Lab02 review
 
Subroutines rev01 fa16
Subroutines rev01 fa16Subroutines rev01 fa16
Subroutines rev01 fa16
 
ControlLogix Counters FA16
ControlLogix Counters FA16ControlLogix Counters FA16
ControlLogix Counters FA16
 
Lab02 lead in
Lab02 lead inLab02 lead in
Lab02 lead in
 
ControlLogix Timers FA16
ControlLogix Timers FA16ControlLogix Timers FA16
ControlLogix Timers FA16
 
02 chapter02 fa16
02 chapter02 fa1602 chapter02 fa16
02 chapter02 fa16
 
01 introduction to_plc-pac_rev01_fa16
01 introduction to_plc-pac_rev01_fa1601 introduction to_plc-pac_rev01_fa16
01 introduction to_plc-pac_rev01_fa16
 
07 chapter07 loop_diagrams
07 chapter07 loop_diagrams07 chapter07 loop_diagrams
07 chapter07 loop_diagrams
 
06 chapter06 binary_logic_systems_Rev02
06 chapter06 binary_logic_systems_Rev0206 chapter06 binary_logic_systems_Rev02
06 chapter06 binary_logic_systems_Rev02
 
04 chapter04 specification_forms
04 chapter04 specification_forms04 chapter04 specification_forms
04 chapter04 specification_forms
 
03 chapter03 lists_indexes_databases
03 chapter03 lists_indexes_databases03 chapter03 lists_indexes_databases
03 chapter03 lists_indexes_databases
 
02 chapter02 p&ids_and_symbols_split_animations
02 chapter02 p&ids_and_symbols_split_animations02 chapter02 p&ids_and_symbols_split_animations
02 chapter02 p&ids_and_symbols_split_animations
 
01 chapter01 process_flow_diagram
01 chapter01 process_flow_diagram01 chapter01 process_flow_diagram
01 chapter01 process_flow_diagram
 
00 introduction
00 introduction00 introduction
00 introduction
 
EMEC130 P&ID Symbol Primer
EMEC130 P&ID Symbol PrimerEMEC130 P&ID Symbol Primer
EMEC130 P&ID Symbol Primer
 
02 copy file_fill_sp16
02 copy file_fill_sp1602 copy file_fill_sp16
02 copy file_fill_sp16
 
Control Systems Basics
Control Systems BasicsControl Systems Basics
Control Systems Basics
 
01 overview of_industrial_automation_sp15
01 overview of_industrial_automation_sp1501 overview of_industrial_automation_sp15
01 overview of_industrial_automation_sp15
 
05 analog control_sp15
05 analog control_sp1505 analog control_sp15
05 analog control_sp15
 

Recently uploaded

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 

13 chap07 and_08_comparison_subs_force_fa14

  • 1. Comparison, Forcing I/O and Subroutines Chapter 07 Sections 7-4 through 7-6 Chapter 08 Sections 8-1, 8-2, 8-3-3 through 8-3-5 Northampton Community College 1
  • 2. Comparison Instructions Chapter 07 Sections 7-4 through 7-6 Northampton Community College 2
  • 3. Data Compare Instructions Northampton Community College 3  Data compare instructions are input instructions.  Data compare instructions compare the data, or value, stored in two words (or registers) and makes a decision based upon those values and the type of comparison being performed.  The SLC-500 series processors have eight and the ControlLogix has nine comparison instructions. We will cover seven of them.  Equal (EQU)  Not Equal (NEQ)  Less Than (LES)  Less Than or Equal To (LEQ)  Greater Than (GRT)  Greater Than or Equal To (GEQ)  Limit Test (LIM)
  • 4. Comparison Instruction Parameters Northampton Community College 4  Comparison instructions in the SLC500 are word level instructions and in the ControlLogix a tag of data type SINT, INT, DINT REAL or STRING. The instructions have two parameters:  Source A  Source B Source A Source B
  • 5. Instruction Comparison Rules Northampton Community College 5  Comparison instruction parameters have several rules:  In the SLC500, Source A and Source B can be WORD level addresses. In the ControlLogix Source A and Source B can be a tag of data type SINT, INT, DINT, REAL or STRING.  Source A can be a WORD level address in the SLC500 or a tag in the ControlLogix and Source B can be a program constant.  Source A and Source B can not both be program constants. Two WORD level addresses A WORD level address and a Constant Two Constants Illegal
  • 6. Equal (EQU) Instruction Northampton Community College 6  The EQU instruction is an input instruction that compares the value referenced in Source A to the value referenced in source B. When the value of Source A is equal to the value of Source B the instruction is true, otherwise it is false.  When the accumulator value of counter C5:0 (C5:0.ACC) referenced in Source A is equal to the accumulator value of counter C5:1 (C5:1.ACC) referenced in Source B, the instruction is true and output O:2/5 is energized, otherwise the instruction is false and the output is de-energized. When the program is running, the value of the WORD level address will be displayed in this field. True when Source A = Source B
  • 7. Not Equal (NEQ) Instruction Northampton Community College 7  The NEQ instruction is an input instruction that compares the value referenced in Source A to the value referenced in source B. When the value of Source A is not equal to the value of Source B the instruction is true, otherwise it is false.  When the accumulator value of timer T4:0 (T4:0.ACC) referenced in Source A is not equal to the program constant of 36 referenced in Source B, the instruction is true and output O:2/5 is energized, otherwise the instruction is false and the output is de-energized. When the program is running, the value of the WORD level address will be displayed in this field. True when Source A ≠ Source B
  • 8. Greater Than (GRT) Instruction Greater Than (A>B) Source A SetPoint 0 Source B Furnace_Temp 0 Northampton Community College 8  The GRT instruction is an input instruction that compares the value referenced in Source A to the value referenced in source B. When the value of Source A is greater than the value of Source B the instruction is true, otherwise it is false.  When the value stored in tag name SetPoint referenced in Source A is greater than the value stored in tag name Furnace_Temp referenced in Source B, the instruction is true and the output with tag name Heater is energized, otherwise the instruction is false and the output is de-energized. True when Source A > Source B GRT Heater <Local:3:O.Data.5> When the program is running, the value of the WORD level address will be displayed in this field.
  • 9. Less Than (LES) Instruction When the program is running, the value of the WORD level address will be displayed in this field. Northampton Community College 9  The LES instruction is an input instruction that compares the value referenced in Source A to the value referenced in source B. When the value of Source A is less than the value of Source B the instruction is true, otherwise it is false.  When the value stored in the preset of timer T4:0 (T4:0.PRE) referenced in Source A is less than the accumulator value of counter C5:2 (C5:2.ACC) referenced in Source B, the instruction is true and output O:2/5 is energized, otherwise the instruction is false and the output is de-energized. True when Source A < Source B
  • 10. Greater Than or Equal To (GEQ) Instruction Northampton Community College 10  The GEQ instruction is an input instruction that compares the value referenced in Source A to the value referenced in source B. When the value of Source A is greater than or equal to the value of Source B the instruction is true, otherwise it is false.  When the value stored in word B3:1 referenced in Source A is greater than or equal to the program constant of 568 referenced in Source B, the instruction is true and output O:2/5 is energized, otherwise the instruction is false and the output is de-energized. When the program is running, the value of the WORD level address will be displayed in this field. True when Source A ≥ Source B
  • 11. Less Than or Equal To (LEQ) Instruction Less Than or Eql (A<=B) Source A Refrg_Temp 0 Source B SetPoint 0 Northampton Community College 11  The LEQ instruction is an input instruction that compares the value referenced in Source A to the value referenced in source B. When the value of Source A is less than or equal to the value of Source B the instruction is true, otherwise it is false.  When the value of the tag name Refrg_Temp referenced in Source A is less than or equal to the value of the tag named SetPoint referenced in Source B, the instruction is true and the output with tag name Refrg_at_Temp is energized, otherwise the instruction is false and the output is de-energized. True when Source A ≤ Source B LEQ Refrg_at_Temp <Local:3:O.Data.13> When the program is running, the value of the WORD level address will be displayed in this field.
  • 12. Limit Test (LIM) Instruction Northampton Community College 12  The Limit Test instruction is an input instruction that tests for values that are inside of, or outside of, a specified range. The output of the instruction is dependent upon how the limits are set.  The LIM instruction has three instruction parameters:  Low Limit (Low Lim)  Test  High Limit (High Lim) Low Limit (Low Lim) Test High Limit (High Lim)
  • 13. LIM Parameter Rules Northampton Community College 13  There are several rules associated with entering parameters into the LIM instruction:  The parameter values in the SLC 500 can be WORD level addresses or program constants and in the ControlLogix they can be tags of data type SINT, INT, DINT, REAL or program constants, with the following restrictions: If the Test parameter is a program constant, than the High Lim and Low Lim parameters must be WORD level addresses or tags. If the test parameter is a WORD level address or tag, than the Low Lim and High Lim parameters can be a program constant, a WORD level address or tag or a combination thereof.
  • 14. LIM Instruction Operation O:2/7 OFF O:2/7 ON O:2/7 OFF Northampton Community College 14  If the value referenced in the Low Lim is less than or equal to the value referenced in the High Lim, the instruction will be true when the value referenced in the Test parameter is between or equal to either of the limits. O:2/7 will be true (ON) when T4:1.ACC is: ≥78 and ≤156 78 156 T4:1.ACC
  • 15. LIM Instruction Operation 78 156 Heater ON Heater OFF Heater ON Northampton Community College 15  If the value referenced in the Low Lim is greater than the value referenced in the High Lim, the instruction will be true when the value referenced in the Test parameter is equal to or outside of the limits. SetPoint 4 Limit Test (CIRC) Low Limit LO_Temp_Lmt 156 Test SetPoint 36 High Limit HI_Temp_Lmt 78 LIM Heater <Local:3:O.Data.5> Heater will be true (ON) when the value stored in SetPoint is: ≤78 OR ≥156
  • 16. Performing Comparison Windows Northampton Community College 16  Assume an output is being controlled based upon the value of a counter accumulator, C5:0.ACC. Following is the output operation criteria:  Output is OFF when C5:0.ACC is 0 to and including 3.  Output is ON when C5:0.ACC is 4 to and including 7.  Output is OFF when C5:0.ACC is 8 to and including 10.  Output is ON when C5:0.ACC is 11 to and including 25.  Output is OFF when C5:0.ACC is >25.  Comparison instructions can be used in combinations to achieve the desired results.
  • 17. Performing Comparison Windows Northampton Community College 17
  • 18. Subroutines Chapter 08 Sections 8-3-3 to 8-3-5 Supplement Document Northampton Community College 18
  • 19. Subroutines Northampton Community College 19  Subroutine(s) is a group of program code that performs a specific task. The subroutine(s) are part of a program (in our case the MainProgram) and are not part of the MainRoutine.  A subroutine can be invoked, (called), from anyplace in the MainRoutine or from another subroutine. When a subroutine is called from within another subroutine it is referred to as nesting subroutines.  Most, if not all, computer programs and PLC/PAC programs contain subroutines.  Subroutines are used to make what would be an enormous program more manageable by breaking up the code into smaller tasks. Specific functions within a task should be placed in subroutines.  Organizing a program by using subroutines makes the code easier to read, understand and maintain.  Subroutines can also be reused in other programs that require the same task be performed.
  • 20. Subroutines SLC500  The SLC500 uses separate ladder files to store and execute subroutines. There are a total of 253 subroutine ladder files; #3 through #255. Northampton Community College 20  Ladder file #2 (LAD2) is the main ladder file and is the one we have been using in all labs to this date.  Scan starts at rung 0 LAD2 and ends at the End statement in LAD2. ControlLogix  The ControlLogix uses separate routines to store and execute subroutines. The number of routines is limited to 32 per program.  The MainRoutine is the main ladder routine and is the one we have been using in all labs to this date.  Scan starts at rung 0 in the MainRoutine and ends at the End statement in the MainRoutine
  • 21. Creating a ControlLogix Subroutine 1. To create a new subroutine right click on MainProgram and select New Routine… from the pop-up menu 2. New Routine dialog box will open. Type in the name of the subroutine and from the Type: dropdown, select the type of program code. 3. The new subroutine will appear listed under the program that it was created in. Double click the subroutine to open the ladder editor. Northampton Community College 21
  • 22. Program Control Instructions Northampton Community College 22  There are many program control instructions. Below is a list of them and the platforms they are available on: Instruction CL 500 Sim Instruction CL 500 Sim JMP – Jump to Label ● ● ● UID – User Interrupt Disable ● LBL – Label ● ● ● UIE – User Interrupt Enable ● JXR – Jump to External Routine ● SFR – Reset Sequential Chart ● JSR – Jump to Subroutine ● ● ● SFP – Pause Sequential Chart ● RET – Return from Subroutine ● ● ● EVENT – Trigger Event Task ● SBR – Subroutine Label ● ● ● EOT – End of Transition ● TND – Temporary End ● ● ● AFI – Always False ● MCR – Master Control Reset ● ● ● NOP – No Operation ● SUS - Suspend  This course will only cover the instructions shown in Red. The instruction in Green can be used, but they will not be discussed in class.
  • 23. ControlLogix Program Control Instructions Northampton Community College 23  JSR – Jump to Subroutine  The JSR is an output instruction that is used to “call” a subroutine.  The instruction rung can be conditional or unconditional.  JSR instructions can have several parameters. The one shown here has 3-parameters. Subroutine name to be “called” (required) Parameter to pass to the subroutine (optional) Parameter to accept a value returning from the subroutine (optional)
  • 24. ControlLogix Program Control Instructions Northampton Community College 24  Entering JSR parameters:  Routine Name (Required) – Double-click this parameter field, click the dropdown arrow and select the subroutine name from the dropdown list. The subroutine name will only be in the list if the subroutine has been created.  Input Par and Return Par (Optional) – These parameters will not be used in this course. When a parameter is not used it must be removed. Right click on the parameter field and select Remove Instruction Parameter from the pop-up menu. Do this for each parameter that is not required. The picture on this slide illustrates removing a parameter field.
  • 25. ControlLogix Program Control Instructions Northampton Community College 25  JSR operation  When the rung containing a JSR instruction is true, the processor scan jumps to the subroutine referenced in the Routine Name parameter and begins program execution at the first rung in that subroutine  A jump cannot be made into the middle of a subroutine. Execution will always start at the first instruction on the first rung in that ladder routine. This rung will unconditionally jump to the subroutine named Routine04
  • 26. ControlLogix Program Control Instructions Northampton Community College 26  SBR – Subroutine Label  The SBR in an input instruction that is always true and marks the beginning of a subroutine. It must be the first instruction on the first rung of the subroutine.  The input parameter field(s) is used to reference tags whose data is to be used (passed) to the subroutine. (This course will not be using these parameters).  SBR instructions can have several parameters. The one shown here has one parameters. Parameter that passes data to the subroutine (optional)
  • 27. ControlLogix Program Control Instructions Northampton Community College 27  For this course the Input Par parameter will need to be removed from the SBR instruction. To remove the parameter right-click on the parameter and select Remove Instruction Parameter from the pop-up menu.
  • 28. ControlLogix Program Control Instructions Northampton Community College 28  RET – Return from Subroutine  The RET instruction is an output instruction that is used to stop executing the subroutine and return to the ladder file that originally “called” the subroutine.  The instruction can be conditional or unconditional and can contain several parameters. The RET instruction shown here has one parameter. (This course will not use these parameters). Parameter that passes data back to the ladder file that originally “called” the subroutine. (optional)
  • 29. ControlLogix Program Control Instructions Northampton Community College 29  For this course the Input Par parameter will need to be removed from the RET instruction. To remove the parameter right-click on the parameter and select Remove Instruction Parameter from the pop-up menu.
  • 30. ControlLogix Program Control Instructions Northampton Community College 30  Several conditional RET instructions can be present in a subroutine. As an example:  If an RET instruction becomes true that is on rung 0006 in a subroutine containing 45-rungs, the program scan will return to the ladder file that originally called the subroutine and rungs 0007 through 0045 will not execute.  If the RET instruction on rung 0006 becomes false another RET instruction becomes true that is on rung 0010 in the same subroutine, the program scan will return to the ladder file that originally called the subroutine and rungs 0011 through 0045 will not executed.  If the entire subroutine ladder file is to be always scanned, placing a RET instruction on the last rung of the program is optional. If an RET instruction is not found in the subroutine ladder file, the END statement performs the return.
  • 31. Program Execution using Subroutines Northampton Community College 31
  • 32. Forcing I/O Northampton Community College 32
  • 33. Using the Force I/O Function Northampton Community College 33  The force function will only work on field I/O devices, therefore the input and output data files in the SLC500 and the Controller tags in the ControlLogix.  Before applying a force to any input or any output device, an understanding of the potential effect that force(s) will have on the machine or process operation and to the safety of personal is essential. DO NOT INSTALL FORCES WITHOUT FIRST UNDERSTANDING WHAT AFFECT IT WILL HAVE ON THE OPERATION OF THE MACHINE OR PROCESS  Most programming software provide some visible means of alerting the user that a force is in affect or installed.  Most processor modules have an LED indicator that will be lit if there are any forces installed.
  • 34. Installing and Enabling Forces Northampton Community College 34  This is an instructor led, interactive lab.  If there is no program running in the PLC at your workstation, open a program that uses I/O field devices, download the program to the PLC, then place the PLC in RUN mode.  Your instructor will also switch to RSLogix and attach to someone’s workstation to lead you through and demonstrate the force functions.