Advanced Instructions Most PLCs now support more advanced functions such as Floating point math, Boolean operations, Shifting, Sequencing, Program control.

Slides:



Advertisements
Similar presentations
Unit 7 Discrete Controllers
Advertisements

Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
8085 processor. Bus system in microprocessor.
Data Types in Java Data is the information that a program has to work with. Data is of different types. The type of a piece of data tells Java what can.
Switchgears Control Using SCADA System Based on PLC
Arithmetic Operations and Circuits
Chapter 4 Operations on Bits
Assembly Language and Computer Architecture Using C++ and Java
DIGITAL SYSTEMS TCE OTHER COMBINATIONAL LOGIC CIRCUITS WEEK 7 AND WEEK 8 (LECTURE 1 OF 3) COMPARATORS CODE CONVERTERS.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Fourth Edition.
Chapter 19 Fundamental PLC Programming
Operations on data CHAPTER 4.
4 Operations On Data Foundations of Computer Science ã Cengage Learning.
CS 105 Digital Logic Design
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Programmable Logic Controllers
Programmable Logic Controllers
MOV,MOVM,COP,FLL,BSL,BSR, FRD,TOD
Introduction to PLC Operation
The 8051 Microcontroller and Embedded Systems
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
ECE 2372 Modern Digital System Design
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
Machine Instruction Characteristics
Introduction to Chapter 6  Digital circuits are frequently used for arithmetic operations  Fundamental arithmetic operations on binary numbers and digital.
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
Memory Layout and SLC500 System Addresses. Processor Memory Division An SLC 500 processor's memory is divided into two storage areas. Like two drawers.
S2008Final_part1.ppt CS11 Introduction to Programming Final Exam Part 1 S A computer is a mechanical or electrical device which stores, retrieves,
16. Binary Numbers Programming in C++ Computer Science Dept Va Tech August, 1999 © Barnette ND, McQuain WD, Keenan MA 1 Binary Number System Base.
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,
Chapter 10 Advanced Programming, PLC Interfacing, and Troubleshooting
Data Representation – Chapter 3 Section 3-1. Terminology “Digital” –Discrete, well defined values/steps –Opposite of analog –Analogy: digital is to analog.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
PLC PROGRAMMING.
 Lecture 2 Processor Organization  Control needs to have the  Ability to fetch instructions from memory  Logic and means to control instruction sequencing.
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.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
MECH1500 Chapter 3.
Introduction to PLC Operation
Digital System Design using VHDL
PLC ARCHITECTURE – Memory 2 by Dr. Amin Danial Asham.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
What is a program? A sequence of steps
Group # 3 Jorge Chavez Henry Diaz Janty Ghazi German Montenegro.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
ECE 2110: Introduction to Digital Systems
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Microprocessor & Assembly Language
09/06/ Data Representation ASCII, Binary Denary Conversion, Integer & Boolean data types.
Binary numbers. Primary memory Memory = where programs and data are stored – Unit = bit “BIT” is a contraction for what two words? Either a 1 or a 0 (because.
Actuators and Control, Part 4 Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning.
Chapter 5.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
Unit 1 Introduction Number Systems and Conversion.
Topic: Binary Encoding – Part 1
Programming in Machine Language
Chapter 10 © 2011, The McGraw-Hill Companies, Inc.
Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables, logic gates,
Advanced Math Functions
Ladder programming Counter Instruction S7 300
靜夜思 床前明月光, 疑是地上霜。 舉頭望明月, 低頭思故鄉。 ~ 李白 李商隱.
Presentation transcript:

Advanced Instructions Most PLCs now support more advanced functions such as Floating point math, Boolean operations, Shifting, Sequencing, Program control and Communications.

Scan time Many processes, especially in machine control, function better when the scan time is small. As the program gets larger the scan time increases. Usually, in larger programs, not all of the logic needs to be executed every scan. If this is the case, sections of ladder logic can be skipped during periods where no activity is occurring in that part of the process.

Jump/Label Used to skip over a section of logic to reduce scan time 99% of the time you want to jump forward

Jump example

Moving data Many times we want to be able to either change a preset value under program control or turn on/off several outputs with one instruction. The MOVE instruction allows 16 bit chunks of data to be moved around.

Move example

16 bit numbers Remember that with 16 bits the number of combinations that can be represented is 2 16 or 65,536 possible combinations. We can represent these combinations as any range of numbers, but more typically the following two ranges are used depending on the context they are in. 0 through 65,535 or to +32,767. Another example would be in representing BCD (Binary Coded Decimal) numbers. In BCD, each decimal digit if represented with 4 bits. 0000=0, while 1001=9. With 16 bits, 4 BCD digits can be represented.

BCD numbers Most operator I/O devices such as thumbwheel entry, numeric displays, etc use the BCD representation. Example, 2305 in decimal converts to 4 groups of 4 bit numbers Note: It is customary to show the MSB (Most Significant Bit) on the left side of a binary number. In this course, that will hold true Care must be exercised when performing math on numbers. Make sure that BCD numbers have been converted to binary first.

BCD conversions Many times, BCD (Binary Coded Decimal) devices are connect to outputs The BCD instructions convert to/from binary/BCD

BCD exercise Convert 42 BCD to binary Convert to BCD What are the valid 4 bit binary values that can be converted to BCD?

Math Programming languages like Java, C and Pascal are considered “Strongly Typed”. This means that the programmer must specify which type of information a variable will hold. For example, information can be true/false (1 bit), numeric (integer and real numbers), string, array or custom types. In most PLCs the numeric data is either single precision (16 bit) or double precision (32bit). In PLCs, the math operations usually are different for 16 bit, 32 bit and floating point functions. In this course we will limit the scope of the math functions used.

Add

Subtract

Multiply

Divide

Math example #1

Math example #1 con’t

Math example #2

Masking Some instructions like the Masked Move (MVM) allow the source to be ANDed with a mask so that only the part of the source you want gets through Remember back in grade school when the teacher gave you a quiz that used a multiple choice answer form. When s/he graded the quiz they would overlay a template with holes cut out so that only areas where the correct answers would show through. This is an example of masking. We use masking in order to look at or control a portion of a 16 bit number. The binary mask value is ANDed with the number of interest.

AND

OR

XOR

NOT

Clear

Inequalities Greater than Less than Equal Not equal

Inequalities Are very useful to compare timer/counter accumulated values, etc Always be careful with the Equal/Not equal In the BASIC programming example below, is the test ever true? The real danger with using inequalities is not so much with counting when things are always incremented by one, but rather with analog inputs and other situations where the increment can be a number other than one.

Greater than

Less than

Equal

Not Equal

Sequencers With a sequencer, an entire block of outputs to be controlled together. Many processes are sequential in nature and can be described in discrete steps. On step #1 the outputs will be set in a certain pattern, in step #2 the pattern will be different. A truth table, as shown below, can be constructed. There are two types of sequencers, bit shift and drum. Below is an example of a when a drum sequencer, where multiple outputs are controlled at the same time, would be used. Each time the sequencer is activated it moves to the next step and will set the outputs to the following pattern

Drum sequencers Show picture of mechanical drum sequencer with explain

Sequencers

Sequencer example

Sequencer example (con’t)

Bit shift Bit shifting instructions teach a group of binary digits as one large value. And in the same way that a digital circuit shift register operates, the PLC has instructions to operate on these values. Shift left and Shift right instructions will be used. Bit shift sequencers are used to track parts on a conveyor or sequence a process through different steps. The shift operation can also be looked at as a math function. When values are shifted left it has the same effect as multiplying by 2. Conversely, when shifting right, the number is divided by 2. Point of interest: Most 8 bit microprocessors (8085, Z80, 6502) do not have multiply instructions. Multiplication is accomplished by an algorithm of shifting and adding.

Bit shift left

Bit shift left example

Bit shift right

Shifting example

Shifting example (con’t) What does this do? It is started by input #3

Control structures As discussed before, the PLC needs both memory and scan time to perform housekeeping tasks. When using a simple one-shot instruction, an additional 1 bit of memory was required to retain the status of was the one-shot fired during the last scan. With timers and counters we had the T4 and C5 files which has the control structures for those devices. With some of the more advanced instructions such as shift registers the CPU requires the use of a block of memory which is referred to as a Control structure. In AB land, this is found in a the control file (R6) and again there are 255 structures available. You cannot use the Binary file (B3) or the timer/counter files T4/C5.

Control structures