Comparison and Data-handling Instructions

Slides:



Advertisements
Similar presentations
Copyright © 2005 Rockwell Automation, Inc. All rights reserved. 1 Micro Logix 1100 RSLogix 500 LAB#2 Timing, Counting & Comparing.
Advertisements

02/24/97 1 Rockwell Automation Hands-On Seminar Series.
PLC Timer Instructions
Copyright © 2002 Delmar Thomson Learning Chapter 11 Processor Data Organization.
Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP
Copyright © 2002 Delmar Thomson Learning Chapter 12 Basic Relay Instructions.
Chapter 6 Introduction to Logic.
Creating Relay Logic Diagrams
Chapter 10.
Programming Logic Controllers
Chapter 19 Fundamental PLC Programming
Introduction to ControlLogix Function Block
Lecture 18 Last Lecture Today’s Topic Instruction formats
Programmable Logic Controllers
Advanced Instructions Most PLCs now support more advanced functions such as Floating point math, Boolean operations, Shifting, Sequencing, Program control.
Programmable Logic Controllers
MOV,MOVM,COP,FLL,BSL,BSR, FRD,TOD
Introduction to PLC Operation
Chapter 10 PLC Processors.
Slide Number1Date 19 feb 2001 PLC 5 Software Guide and Manual01 Drawn – D J Ray03 Any Station - Generic02 Original is A4 – Landscape.04 GCS Support. MERIDIAN.
Copyright © 2002 Delmar Thomson Learning Chapter 17 Sequencer Instructions.
Machine Instruction Characteristics
Chapter 1 A Beginning Library of Elementary Functions
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.
Processor Data Organization
Logical controllers' programming 4- Treatment of Data 4.1- Comparison of Data Programming.
Storing and Organizing Data. Why Do I Need to Understand How Data Is Represented? In order to install, program,maintain, and troubleshoot today’s PLCs,
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Arrays.
Chapter 10 Advanced Programming, PLC Interfacing, and Troubleshooting
Copyright © 2002 Delmar Thomson Learning Chapter 4 Number Systems.
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.
DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an.
Copyright © 2002 Delmar Thomson Learning Chapter 14 Documenting Your PLC System.
MECH1500 Chapter 3.
Introduction to PLC Operation
Sequencers SQO,SQC,SQL.
Why Repetition? Read 8 real numbers and compute their average REAL X1, X2, X3, X4, X5, X6, X7, X8 REAL SUM, AVG READ *, X1, X2, X3, X4, X5, X6, X7, X8.
MECH 1500 Chapter 4. MECH 1500 The Binary Concept 4.1.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Think Automation and beyond… FT1A Script Programming.
Chapter 5.
Chapter 11 & 13 PLC Math Instructions Permission granted to reproduce for educational use only. 11 PLC Compare, Jump, and MCR Instructions.
Programmable Logic Controllers Third Edition Frank D. Petruzella McGraw-Hill.
7 - Programming 7J, K, L, M, N, O – Handling Data.
Chapter 5.
Assembly Language Programming of 8085
Chapter 10 © 2011, The McGraw-Hill Companies, Inc.
The Selection Structure
Chapter 12 © 2011, The McGraw-Hill Companies, Inc.
MicroEconomix 1500 RSLogix 500 LAB#2
Chapter 11 © 2011, The McGraw-Hill Companies, Inc.
Comparison and Data-Handling Instructions
Chapter 4 Number Systems.
1) C program development 2) Selection structure
Documenting Your PLC System
Basic Relay Instructions
PLC 5 and ControlLogix Subroutine Parameters
CS 206D Computer Organization
Data Representation and Organization
Evaluating Logarithms
Data manipulation Instructions
Instruction Set Principles
Ladder programming Counter Instruction S7 300
REPETITION Why Repetition?
Presentation transcript:

Comparison and Data-handling Instructions Chapter 17 Comparison and Data-handling Instructions

Objectives Describe the function of the common comparison instructions. Explain the difference between a move instruction and a copy instruction. Determine the data resulting after execution of a masked move instruction. Explain how a copy instruction can be used to copy recipe data from one source to another. Explain which instruction to use to have the PLC convert from an integer to a BCD value or from a BCD value to an integer.

Comparison Instructions Input instructions that test the relationship between two values, source A and source B Source A is an address. Source B can be an address or a constant value.

Equal Instruction (EQU) Test when two values are equal. Instruction is true when source A is equal to source B.

An Equal Instruction Controlling OTE Instruction

Not Equal Instruction (NEQ) Test when two values for inequality. Use this instruction to determine if two specified sources are not equal. Instruction is true when source A is not equal to source B.

Not Equal Instruction

Less Than Instruction (LES) (1 of 2) Test when one value is less than another. Instruction is true when the data stored in source A is less than either the data stored in the address specified as source B or a constant entered in source B.

The Less Than Instruction (2 of 2)

Less Than or Equal (LEQ) Determine if one source of data is less than or equal to another. Instruction is true when the data stored in source A is less than or equal to either the data stored in the address specified as source B or a constant entered in source B.

Less Than or Equal Instruction

Greater Than Instruction (GEQ) Determine if one source of data is greater than another. Instruction is true when the data stored in source A is greater than either the data stored in the address specified as source B or a constant entered in source B.

The Greater Than Instruction

Greater Than or Equal (GEQ) Determine if one source of data is greater than or equal to another. Instruction is true when the data stored in source A is greater than or equal to either the data stored in the address specified as source B or a constant entered in source B.

Greater Than or Equal Instruction

Data-handling Instructions Used when data needs to be moved or copied from one data file source to another When data needs to be converted to a different radix

Move Instruction (MOV) (1 of 2) This is an output instruction that moves a copy of one data file element to a specified destination. The source can be an address or constant. When instruction is true, a copy of the source data will be moved to the specified destination address.

Move Instruction (2 of 2)

Masked Move Instruction (MVM) (1 of 2) This is an output instruction that moves a copy of one data file element through a mask to a specified destination. When true, a copy of the data specified in the source is moved through a hexadecimal mask to the specified destination.

Masked Move Instruction (2 of 2)

Hexadecimal Masking Source data is passed through the mask bit by bit. Mask bit in same position as source bit determines if data is to pass or not. To pass data through mask, set appropriate mask bit. To mask data from passing, reset the appropriate mask bit.

Source Data Moved through the Mask to the Destination

Mask Rules Mask is either a hexadecimal value or the address where the mask will be found. Data is evaluated on a bit by bit basis. Mask 1 bits allow data to pass. Mask 0 bits hold data from passing. Destination bits that correspond to zeros in the mask are not changed.

FRD Instruction Converting BCD Input Data to Integer

TOD Instruction Converting Integer Output Data to BCD

Copy File Instruction (COP) Output instruction that copies a user-defined group of 16-bit data file words Must copy consecutive dat file elements Copy up to 128 one-word elements Source and destination can be different file types

Copy File Programming Parameters (1 of 2) Source is the address of the file to be copied. The # symbol in front of the source address specifies this address as the beginning of a user-defined source file. Destination is the starting address from which the number of source elements specified in the length parameter will be copied. # specifies copying a user-defined file.

Copy File Programming Parameters (2 of 2) Length parameter is the number of consecutive elements to be copied. Because different file types can be copied, the destination file type and length specify how many elements will be transferred.

Example of Copy File Instruction Operation

Ladder Containing Copy Instruction

AND Instruction The AND instruction performs a logical AND operation on two 16-bit words.

OR Instruction on a Ladder Rung

Exclusive-OR Instruction on a Ladder Rung

Not Logic As an Output Instruction on a PLC Ladder Rung

The Limit Test Instruction Testing for Values between 0 and 1750

The Limit Test Instruction Testing for Values outside the Range of 0 to 100

Data Flow from a VFD into the PLC

Scale with Parameters