Standard RLL Instructions

Similar documents
This Errata Sheet contains corrections or changes made after the publication of this manual.

13 Entering Programs

Ladder logic (LAD) representation Statement list (STL) representation Available in these CPUs

Index A B C D. i-1

Monitoring. In This Chapter

Edit a Program. In This Chapter

This chapter describes the SIMATIC instruction set for the S7-200.

Chapter. Operation. In this Chapter

PLC Programming D R. T A R E K A. T U T U N J I

Appendix. Special Relays. In This Appendix... DL06 PLC Special Relays...D 2

Appendix. Auxiliary Functions. In This Appendix...

Simple Ladder Logic. Simple Ladder Logic. OR Operation. Chapter 2: Basic Ladder Logic Programming. Ladder Logic Learning objectives.

Appendix. Auxiliary Functions. In This Appendix...

Chapter. System design and. configuration. In This Chapter

PLC AUTOMATION SYSTEM LABORATORY. Manual

Chapter. F0-04AD-2, 4-Channel Analog Voltage Input. In This Chapter...

MECH 1500 DIGITAL FUNDAMENTALS AND PROGRAMMABLE LOGIC CONTROLLERS CLASSWORK MANUAL

Chapter. Maintenance and. Troubleshooting. In This Chapter...

CISC 662 Graduate Computer Architecture. Classifying ISA. Lecture 3 - ISA Michela Taufer. In a CPU. From Source to Assembly Code

Standard Instructions Special Instructions High-Speed Instructions SIMATIC S7-200 Programmable Controller System Manual

68HC11 PROGRAMMER'S MODEL

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

1 B A B C D

BASIC PLC PROGRAMMING

COSC 243. Instruction Sets And Addressing Modes. Lecture 7&8 Instruction Sets and Addressing Modes. COSC 243 (Computer Architecture)

Central Processing Unit

MECH 1500 Quiz 4 Review

Topics. PLC Fundamentals Ladder Logic Fundamentals

System Monitoring and Troubleshooting

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

Microcomputer Architecture and Programming

1 of 8. I. (13pts) TRUE OR FALSE

Chapter. Operation. In This Chapter

Accumulator and memory instructions 1. Loads, stores, and transfers 2. Arithmetic operations 3. Multiply and divide 4. Logical operations 5. Data test

MICROPROCESSOR & MICROCONTROLLER

Abstraction of State Elements. Sequential Logic Implementation. Forms of Sequential Logic. Finite State Machine Representations

Digital IP Cell 8-bit Microcontroller PE80

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

CDN180 CCO SPECIFICATIONS

Appendix. Numbering Systems. In This Appendix...

Appendix. Numbering Systems. In this Appendix

Chapter 3. Z80 Instructions & Assembly Language. Von Neumann Architecture. Memory. instructions. program. data

3.0 Instruction Set. 3.1 Overview

Chapter. Getting Started. In this Chapter

Chapter. F2-02DA-1, F2-02DA-1L 2-Channel Analog. Current Output. In This Chapter...

Computer Architecture Programming the Basic Computer

DL05 Error Codes. Appendix. In This Appendix... DL05 Error Codes...B 1

SECTION 5 PROGRAM CONTROL UNIT

Appendix. DL05 Error Codes. In This Appendix... Error Code Table...B 2

Chapter 7. Storage Components

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

Computer Architecture

CHAPTER SIX BASIC COMPUTER ORGANIZATION AND DESIGN

8051 Instruction Set

MICROPROGRAMMED CONTROL

Example of A Microprogrammed Computer

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples.

COMPUTER ORGANIZATION & ARCHITECTURE

Assembly Language Programming of 8085

Chapter 7 Central Processor Unit (S08CPUV2)

Computer Architecture Prof. Mainak Chaudhuri Department of Computer Science & Engineering Indian Institute of Technology, Kanpur

Instruction set of 8085

Chapter. Maintenance and. Troubleshooting. In this Chapter

ECE485/585: Programmable Logic Controllers Exam #2 (sample style questions)

Assembly Language Programming of 8085

Digital System Design Using Verilog. - Processing Unit Design

EC4205 Microprocessor and Microcontroller

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

2. Arithmetic Instructions addition, subtraction, multiplication, divison (HCS12 Core Users Guide, Sections 4.3.4, and ).

Chapter Introduction Chapter 1. a) Address translation b) Protection c) Program relocation. type's "««"** ***** ** various

The von Neumann Architecture. IT 3123 Hardware and Software Concepts. The Instruction Cycle. Registers. LMC Executes a Store.

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

EC2304-MICROPROCESSOR AND MICROCONROLLERS 2 marks questions and answers UNIT-I

5-1 Instruction Codes

CS401 - Computer Architecture and Assembly Language Programming Glossary By

(2) Explain the addressing mode of OR What do you mean by addressing mode? Explain diff. addressing mode for 8085 with examples.

8051 Microcontroller Interrupts

Any offsets needing less or more than 1 hr will need special programming (call our tech support). Entering Mode Programming. Exiting Programming

Mechanism of absolute rotary encoder. Rotary Encoders

csitnepal Unit 3 Basic Computer Organization and Design

Register Transfer and Micro-operations

A microcomputer system for mass spectrometer control and data acquisition

PROGRAM CONTROL UNIT (PCU)

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats

Chapter 6 Basic Function Instruction

Microcontroller & Interfacing

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller.

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 2

System Monitoring and Troubleshooting

8051 Overview and Instruction Set

Projects. In This Chapter

When an instruction is initially read from memory it goes to the Instruction register.


Practical Malware Analysis

PLC Programming. Ladder Diagrams

Chapter 3 : Control Unit

STRUCTURE OF DESKTOP COMPUTERS

M. Sc (CS) (II Semester) Examination, Subject: Computer System Architecture Paper Code: M.Sc-CS-203. Time: Three Hours] [Maximum Marks: 60

Entering RLL Programs

Transcription:

R Instructions InThishapter... oolean Instructions omparative oolean Immediate Instructions Timer, ounter and hift Register Instructions ccumulator / tack oad and Output ata Instructions ogical Instructions (ccumulator) Math Instructions it Operation Instructions (ccumulator) Number onversion Instructions (ccumulator) Table Instructions PU ontrol Instructions Program ontrol Instructions Interrupt Instructions Message Instructions

- Introduction Micro Ps offer a wide variety of instructions to perform many different types of operations. This chapter shows you how to use each standard Relay adder ogic (R) instruction. In addition to these instructions, you may also need to refer to the rum instruction in hapter, or the tage programming instructions in hapter. There are two ways to quickly find the instruction you need. If you know the instruction category (oolean, omparative oolean, etc.) just use the title at the top of the page to find the pages that discuss the instructions in that category. If you know the individual instruction name, use the following table to find the page(s) that discusses the instruction. Instruction Page Instruction Page Instruction Page ON -- IN -- PU -- -- IRT -- P -- -- N --, --, -- N -- N -- N --9 NI -- NN --, -- NN --9 NNI -- -- IN -- MP -- MP --9 NT -- -- O -- II -- I -- -- RUM --, -- NO --9 N -- NI -- UT -- IN -- INT -- IG -- JMP -- -- -- -- -- -- MR -- M -- MO -- MOM -- MU -- NON -- NOP -- OR --, --, -- OR -- OR I -- OR -- OR -- OR -- ORI -- ORN --, -- ORN -- ORNI -- --, --9 --9 -- POP -- RT -- RTI -- T -- TI -- G --9 GNT -- H -- HR -- R --9 TOP -- --9, -- -- I -- N --9, -- N -- NI -- U -- U -- TMR -- TMR -- TMR -- TMR -- U -- XOR -- XOR -- P User Manual, rd dition

oolean Instructions - Using oolean Instructions o you ever wonder why so many P manufacturers always quote the scan time for a K boolean program? imple. Most all programs utilize many boolean instructions. These are typically very simple instructions designed to join input and output contacts in various series and parallel combinations. Our irectot software is a similar program. It allows you to use graphic symbols to develop the program; therefore, you don t necessarily have to know the instruction mnemonics in order to develop a program. Many of the instructions in this chapter are not program instructions used in irectot, but are implied. In other words, they are not actually keyboard commands, however, they can be seen in a Mnemonic iew of the program once the irectot program has been developed and accepted (compiled). ach instruction listed in this chapter will have a small chart to indicate how the instruction is used with irectot and the HPP. HPP Implied Used N tatement The following paragraphs show how these instructions are used to build simple ladder programs. ll programs require an N statement as the last instruction. This tells the PU that this is the end of the program. Normally, any instructions placed after the N statement will not be executed. There are exceptions to this such as interrupt routines, etc. This chapter will discuss the instruction set in detail. X ll programs must have and N statement Y N imple Rungs You use a contact to start rungs that contain both contacts and coils. The boolean instruction that does this is called a tore or, instruction. The output point is represented by the Output or, instruction. The following example shows how to enter a single contact and a single output coil. irectot xample Handheld Mnemonics X Y N X Y N P User Manual, rd dition

- oolean Instructions Normally losed ontact Normally closed contacts are also very common. This is accomplished with the tore Not or, N instruction. The following example shows a simple rung with a normally closed contact. X irectot xample Y Handheld Mnemonics N X Y N N ontacts in eries Use the N instruction to join two or more contacts in series. The following example shows two contacts in series and a single output coil. The instructions used would be X, N X, followed by Y. X X irectot xample Y Handheld Mnemonics X N X Y N N Midline Outputs ometimes it is necessary to use midline outputs to get additional outputs that are conditional on other contacts. The following example shows how you can use the N instruction to continue a rung with more conditional outputs. X X irectot xample X X Y Y Y Handheld Mnemonics X N X Y N X Y N X Y N N P User Manual, rd dition

oolean Instructions - Parallel lements You also have to join contacts in parallel. The OR instruction allows you to do this. The following example shows two contacts in parallel and a single output coil. The instructions would be X, OR X, followed by Y. irectot xample Handheld Mnemonics X X Y X OR X Y N N Joining eries ranches in Parallel Quite often it is necessary to join several groups of series elements in parallel. The Or tore (OR) instruction allows this operation. The following example shows a simple network consisting of series elements joined in parallel. irectot xample Handheld Mnemonics X X X X Y N X N X X N X OR Y N Joining Parallel ranches in eries You can also join one or more parallel branches in series. The nd tore (N) instruction allows this operation. The following example shows a simple network with contact branches in series with parallel contacts. irectot xample Handheld Mnemonics X X X Y X X OR X N Y N N P User Manual, rd dition

- oolean Instructions ombination Networks You can combine the various types of series and parallel branches to solve most any application problem. The following example shows a simple combination network. X X X Y X X X X N omparative oolean ome P manufacturers make it really difficult to do a simple comparison of two numbers. ome of them require you to move the data all over the place before you can actually perform the comparison. The Micro Ps provide omparative oolean instructions that allow you to quickly and easily solve this problem. The omparative oolean provides evaluation of two -digit values using boolean contacts. The valid evaluations are: equal to, not equal to, equal to or greater than, and less than. In the following example when the value in -memory location is equal to the constant value, Y will energize. K Y P User Manual, rd dition

oolean Instructions - oolean tack There are limits to how many elements you can include in a rung. This is because the Ps use an -level boolean stack to evaluate the various logic elements. The boolean stack is a temporary storage area that solves the logic for the rung. ach time the program encounters a instruction, the instruction is placed on the top of the stack. ny other instructions already on the boolean stack are pushed down a level. The N, and OR instructions combine levels of the boolean stack when they are encountered. n error will occur during program compilation if the PU encounters a rung that uses more than the eight levels of the boolean stack. The following example shows how the boolean stack is used to solve boolean logic. X X OR N X Y Output X N X N X OR X X X X X X N X X N X X X X X X OR X OR (X N X) X N X X N [X OR (X N X)] X ORNOT X NOTXORXN[XOR(XNX)] X N XN(NOTXORX)N[XOR(XNX)] P User Manual, rd dition

- oolean Instructions Immediate oolean The Micro Ps usually can complete an operation cycle in a matter of milliseconds. However, in some applications you may not be able to wait a few milliseconds until the next I/O update occurs. The Ps offer Immediate input and outputs which are special boolean instructions that allow reading directly from inputs and writing directly to outputs during the program execution portion of the PU cycle. You may recall that this is normally done during the input or output update portion of the PU cycle. The immediate instructions take longer to execute because the program execution is interrupted while the PU reads or writes the I/O point. This function is not normally done until the read inputs or the write outputs portion of the PU cycle. NOT: ven though the immediate input instruction reads the most current status from the input point, it only uses the results to solve that one instruction. It does not use the new status to update the image register. Therefore, any regular instructions that follow will still use the image register values. ny immediate instructions that follow will access the I/O again to update the status. The immediate output instruction will write the status to the I/O and update the image register. PU can Read Inputs The PU reads the inputs from the local base and stores the status in an input image register. X... X X X O... ON O O Input Image Register O O X X Read Inputs from pecialty I/O olve the pplication Program X Y I Immediate instruction does not use the input image register, but instead reads the status from the module immediately. I/O Point X hanges Write Outputs Write Outputs to pecialty I/O iagnostics ON O X X P User Manual, rd dition

oolean Instructions -9 oolean Instructions tore () HPP Used Used The tore instruction begins a new rung or an additional branch in a rung with a normally open contact. tatus of the contact will be the same state as the associated image register point or memory location. tore Not (N) HPP Used Used The tore Not instruction begins a new rung or an additional branch in a rung with a normally closed contact. tatus of the contact will be opposite the state of the associated image register point or memory location. Operand ata Type Range Inputs X -- Outputs Y -- ontrol Relays -- tage -- Timer T -- ounter T -- pecial Relay P --, -- In the following tore example, when input X is on, output Y will energize. irectot X Y In the following tore Not example, when input X is off output Y will energize. irectot X Y P N P User Manual, rd dition

- oolean Instructions Or (OR) HPP Implied Used The Or instruction logically ors a normally open contact in parallel with another contact in a rung. The status of the contact will be the same state as the associated image register point or memory location. Or Not (ORN) HPP Implied Used The Or Not instruction logically ors a normally closed contact in parallel with another contact in a rung. The status of the contact will be opposite the state of the associated image register point or memory location. Operand ata Type Range Inputs X -- Outputs Y -- ontrol Relays -- tage -- Timer T -- ounter T -- pecial Relay P --, -- In the following Or example, when input X or X is on, output Y will energize. irectot X X Y Q OR In the following Or Not example, when input X is on or X is off, output Y will energize. irectot X X Y R ORN P User Manual, rd dition

oolean Instructions - nd (N) HPP nd Not (NN) HPP Implied Used Implied Used The nd instruction logically ands a normally open contact in series with another contact in a rung. The status of the contact will be the same state as the associated image register point or memory location. The nd Not instruction logically ands a normally closed contact in series with another contact in a rung. The status of the contact will be opposite the state of the associated image register point or memory location. Operand ata Type Range Inputs X -- Outputs Y -- ontrol Relays -- tage -- Timer T -- ounter T -- pecial Relay P --, -- In the following nd example, when input X and X are on output Y will energize. irectot X X Y N In the following nd Not example, when input X is on and X is off output Y will energize. irectot X X Y W NN P User Manual, rd dition

- oolean Instructions nd tore (N ) HPP Implied Used The nd tore instruction logically ands two branches of a rung in series. oth branches must begin with the tore instruction. Or tore (OR ) HPP Implied Used The Or tore instruction logically ors two branches of a rung in parallel. oth branches must begin with the tore instruction. In the following nd tore example, the branch consisting of contacts X, X, and X have been anded with the branch consisting of contact X. irectot X X X X Y N Q OR NT In the following Or tore example, the branch consisting of X and X have been ored with the branch consisting of X and X. irectot X X X X Y N N M ORT P User Manual, rd dition

oolean Instructions - There are limits to what you can enter with boolean instructions. This is because the internal PU uses an -level stack to evaluate the various logic elements. The stack is a temporary storage area that helps solve the logic for the rung. ach time you enter a instruction, the instruction is placed on the top of the stack. ny other instructions on the stack are pushed down a level. The nd tore and Or tore instructions combine levels of the stack when they are encountered. ince the stack is only eight levels, an error will occur if the PU encounters a rung that uses more than the eight levels of the stack. The following example shows how the stack is used to solve boolean logic. X X ORT N X Y Output X N X NT X OR X X X X X X N X X N X X X X X X ORT X OR (X N X) X N X X N [X OR (X N X)] X OR X X OR [X N [X OR (X N X)]] X NT X N [(X OR [X) N [X OR (X N X)]]] P User Manual, rd dition

- oolean Instructions Out () HPP Used Used The Out instruction reflects the status of the rung (on/off) and outputs the discrete (on/off) state to the specified image register point or memory location. Multiple Out instructions referencing the same discrete location should not be used since only the last Out instruction in the program will control the physical output point. Instead, use the next instruction, the Or Out. Operand ata Type Range Inputs X -- Outputs Y -- ontrol Relays -- In the following Out example, when input X is on, output Y and Y will energize. irectot X Y Y Or Out (OR ) HPP Used Used The Or Out instruction allows more than one rung of discrete logic to control a single output. Multiple Or Out instructions referencing the same output coil may be used, since all contacts controlling the output are logically ORed together. If the status of any rung is on, the output will also be on. OR Operand ata Type Range Inputs X -- Outputs Y -- ontrol Relays -- In the following example, when X or X is on, Y will energize. irectot X X Y OR Y OR O INT# O INT# P User Manual, rd dition

oolean Instructions - Positive ifferential (P) Used HPP Used The Positive ifferential instruction is typically known as a one shot. When the input logic produces an off to on transition, the output will energize for one PU scan. P Operand ata Type Range Inputs X -- Outputs Y -- ontrol Relays -- In the following example, every time X makes an off to on transition, will energize for one scan. irectot X P P et (T) HPP Used Used The et instruction sets or turns on an image register point/memory location or a consecutive range of image register points/memory locations. Once the point/location is set it will remain on until it is reset using the Reset instruction. It is not necessary for the input controlling the et instruction to remain on. Optional memory range T Reset (RT) HPP Used Used The Reset instruction resets or turns off an image register point/memory location or a range of image registers points/memory locations. Once the point/location is reset it is not necessary for the input to remain on. Optional memory range RT Operand ata Type Range Inputs X -- Outputs Y -- ontrol Relays -- tage -- Timer T -- ounter T -- P User Manual, rd dition

- oolean Instructions et, Reset Instr. ontinued In the following example when X is on, Y through Y will energize. irectot X Y T Y X T In the following example when X is on, Y through Y will be reset or de--energized. irectot X Y RT Y RT Pause (PU) HPP Used Used O INT# J 9 G The Pause instruction disables the output update on a range of outputs. The ladder program will continue to run and update the image register. However, the outputs in the range specified in the Pause instruction will be turned off at the output points. H Y PU Operand ata Type Range Outputs Y -- In the following example, when X is ON, Y--Y will be turned O. The execution of the ladder program will not be affected. irectot X Y Y PU ince the --HPP Handheld Programmer does not have a specific Pause key, you can use the corresponding instruction number for entry (#9), or type each letter of the command. O INT# J 9 G H In some cases, you may want certain output points in the specified pause range to operate normally. In that case, use ux to over-ride the Pause instruction. P User Manual, rd dition

omparative oolean Instructions - omparative oolean tore If qual () The tore If qual instruction begins a new rung or additional branch in a rung with a normally open comparative contact. The contact will be on when = bbb. bbb tore If Not qual (N) The tore If Not qual instruction begins a new rung or additional branch in a rung with a normally closed comparative contact. The contact will be on when bbb. bbb Operand ata Type Range bbb --memory ll (ee page --9) ll (ee page --9) onstant K -- -- -- In the following example, when the value in --memory location = 9, Y will energize. irectot K9 Y J 9 In the following example, when the value in --memory location, Y will energize. irectot K Y P N G P User Manual, rd dition

- omparative oolean Instructions Or If qual (OR) The Or If qual instruction connects a normally open comparative contact in parallel with another contact. The contact will be on when = bbb. bbb Or If Not qual (ORN) The Or If Not qual instruction connects a normally closed comparative contact in parallel with another contact. The contact will be on when bbb. bbb Operand ata Type Range bbb --memory ll (ee page --9) ll (ee page --9) onstant K -- -- -- In the following example, when the value in --memory location = or =, Y will energize. irectot K Y K Q OR In the following example, when the value in --memory location = 9 or, Y will energize. irectot K9 Y J 9 G K R ORN P User Manual, rd dition

omparative oolean Instructions -9 nd If qual (N) The nd If qual instruction connects a normally open comparative contact in series with another contact. The contact will be on when = bbb. bbb nd If Not qual (NN) The nd If Not qual instruction connects a normally closed comparative contact in series with another contact. The contact will be on when bbb bbb Operand ata Type Range / bbb --memory ll (ee page --9) ll (ee page --9) onstant K -- -- -- In the following example, when the value in --memory location = and =, Y will energize. irectot K K Y N In the following example, when the value in --memory location = and, Y will energize. irectot K K Y W NN P User Manual, rd dition

- omparative oolean Instructions tore () The omparative tore instruction begins a new rung or additional branch in a rung with a normally open comparative contact. The contact will be on when ² bbb. bbb tore Not (N) The omparative tore Not instruction begins a new rung or additional branch in a rung with a normally closed comparative contact. The contact will be on when < bbb. bbb Operand ata Type Range / bbb --memory ll (ee page --9) ll (ee page --9) onstant K -- -- -- Timer T -- ounter T -- In the following example, when the value in --memory location ², Y will energize. irectot K Y N In the following example, when the value in --memory location <, Y will energize. irectot K Y P N N P User Manual, rd dition

omparative oolean Instructions - Or (OR) The omparative Or instruction connects a normally open comparative contact in parallel with another contact. The contact will be on when ² bbb. bbb Or Not (ORN) The omparative Or Not instruction connects a normally open comparative contact in parallel with another contact. The contact will be on when < bbb. bbb Operand ata Type Range / bbb --memory ll (ee page --9) ll (ee page --9) onstant K -- -- -- Timer T -- ounter T -- In the following example, when the value in --memory location = or ², Y will energize. irectot K Y G K Q OR N In the following example when the value in --memory location = or <, Y will energize. irectot K Y K R ORN N P User Manual, rd dition

- omparative oolean Instructions nd (N) The omparative nd instruction connects a normally open comparative contact in series with another contact. The contact will be on when ² bbb. bbb nd Not (NN) The omparative nd Not instruction connects a normally open comparative contact in parallel with another contact. The contact will be on when < bbb. bbb Operand ata Type Range / bbb --memory ll (ee page --9) ll (ee page --9) onstant K -- -- -- Timer T -- ounter T -- In the following example, when the value in --memory location =, and ², Y will energize. irectot K K Y N N In the following example, when the value in --memory location = and <, Y will energize. irectot K K Y H W NN N Y N P User Manual, rd dition

Immediate Instructions - Immediate Instructions tore Immediate (I) The tore Immediate instruction begins a new rung or additional branch in a rung. The status of the contact will be the same as the status of the associated input point at the time the instruction is executed. The image register is not updated. X tore Not Immediate (NI) The tore Not Immediate instruction begins a new rung or additional branch in a rung. The status of the contact will be opposite the status of the associated input point at the time the instruction is executed. The image register is not updated. X Operand ata Type Range Inputs X -- In the following example, when X is on, Y will energize. irectot X Y I In the following example when X is off, Y will energize. irectot X Y P N I Or Immediate (ORI) Or Not Immediate (ORNI) The Or Immediate connects two contacts in parallel. The status of the contact will be the same as the status of the associated input point at the time the instruction is executed. The image register is not updated. The Or Not Immediate connects two contacts in parallel. The status of the contact will be opposite the status of the associated input point at the time the instruction is executed. The image register is not updated. X X P User Manual, rd dition

- Immediate Instructions OR Immediate Instructions ont d Operand ata Type Range Inputs X -- In the following example, when X or X is on, Y will energize. irectot X X Y Q OR I In the following example, when X is on or X is off, Y will energize. irectot X X Y R ORN I nd Immediate (NI) nd Not Immediate (NNI) The nd Immediate connects two contacts in series. The status of the contact will be the same as the status of the associated input point at the time the instruction is executed. The image register is not updated. The nd Not Immediate connects two contacts in series. The status of the contact will be opposite the status of the associated input point at the time the instruction is executed. The image register is not updated. X X Operand ata Type Range Inputs X -- In the following example, when X and X are on, Y will energize. irectot X X Y N In the following example, when X is on and X are off, Y will energize. irectot X X Y I W NN I P User Manual, rd dition

Immediate Instructions - Or Out Immediate (ORI) The Or Out Immediate instruction has been designed to use more than rung of discrete logic to control a single output. Multiple Or Out Immediate instructions referencing the same output coil may be used, since all contacts controlling the output are ored together. If the status of any rung is on at the time the instruction is executed, the output will also be on. Y ORI Operand ata Type Range Outputs Y -- In the following example, when X is on, output point Y on the output module will turn on. or instruction entry on the Handheld Programmer, you can use the instruction number (#) as shown, or type each letter of the command. irectot X Y I O INT# In the following example, when X or X is on, Y will energize. irectot X Y OR I O INT# X Y OR I O INT# P User Manual, rd dition

- Immediate Instructions et Immediate (TI) The et Immediate instruction immediately sets, or turns on an output or a range of outputs in the image register and the corresponding output point(s) at the time the instruction is executed.once the outputs are set it is not necessary for the input to remain on. The Reset Immediate instruction can be used to reset the outputs. Y TI Reset Immediate (RTI) The Reset Immediate instruction immediately resets, or turns off an output or a range of outputs in the image register and the output point(s) at the time the instruction is executed. Once the outputs are reset it is not necessary for the input to remain on. Y RTI Operand ata Type Range Outputs Y -- In the following example, when X is on, Y through Y will be set on in the image register and on the corresponding output points. irectot X Y Y TI X T I In the following example, when X is on, Y through Y will be reset (off) in the image register and on the corresponding output module(s). irectot X Y RTI Y RT I P User Manual, rd dition

Timer, ounter, and hift Register Instructions - Timer, ounter and hift Register Instructions Using Timers X Timers are used to time an event for a desired length of time. The single input timer will time as long as the input is on. When the input changes from on to off the timer current value is reset to. There is a tenth of a second and a hundredth of a second timer available with a maximum time of 999.9 and 99.99 seconds respectively. There is a discrete bit associated with each timer to indicate that the current value is equal to or greater than the preset value. The timing diagram below shows the relationship between the timer input, associated discrete bit, current value, and timer preset. econds X TMR K T T urrent alue / econds T Timer preset Y There are those applications that need an accumulating timer, meaning it has the ability to time, stop, and then resume from where it previously stopped. The accumulating timer works similarly to the regular timer, but two inputs are required. The start/stop input starts and stops the timer. When the timer stops, the elapsed time is maintained. When the timer starts again, the timing continues from the elapsed time. When the reset input is turned on, the elapsed time is cleared and the timer will start at when it is restarted. There is a tenth of a second and a hundredth of a second timer available with a maximum time of 9999999.9 and 999999.99 seconds respectively. The timing diagram below shows the relationship between the timer input, timer reset, associated discrete bit, current value, and timer preset. X econds X tart/top TMR K T X X Reset Input T urrent alue / econds P User Manual, rd dition

- Timer, ounter, and hift Register Instructions Timer (TMR) and Timer ast (TMR) The Timer instruction is a. second single input timer that times to a maximum of 999.9 seconds. The Timer ast instruction is a. second single input timer that times up to a maximum of 99.99 seconds. These timers will be enabled if the input logic is true (on) and will be reset to if the input logic is false (off). Instruction pecifications Timer Reference (T): pecifies the timer number. Preset alue (bbb): onstant value (K) or a memory location. urrent alue: Timer current values are accessed by referencing the associated or T memory location*. or example, the timer current value for T physically resides in -memory location. iscrete tatus it: The discrete status bit is referenced by the associated T memory location. Operating as a timer done bit, it will be on if the current value is equal to or greater than the preset value. or example, the discrete status bit for Timer is T. TMR T bbb Preset Timer # TMR bbb T Preset Timer # The timer discrete status bit and the current value are not specified in the timer instruction. NOT: Timer preset constants (K) may be changed by using a handheld programmer, even when the PU is in Run Mode. Therefore, a -memory preset is required only if the ladder program must change the preset. Operand ata Type Range / bbb Timers T -- -- -- --memory for preset values -- -- -- -- onstants (preset only) K -- -- --9999 Timer discrete status bits T/ -- or -- Timer current values /T* -- NOT: * With the HPP, both the Timer discrete status bits and current value are accessed with the same data reference. irectot uses separate references, such as T for discrete status bit for Timer T, and T for the current value of Timer T. You can perform functions when the timer reaches the specified preset using the discrete status bit. Or, use comparative contacts to perform functions at different time intervals, based on one timer. The examples on the following page show these two methods of programming timers. P User Manual, rd dition

Timer, ounter, and hift Register Instructions -9 Timer xample Using iscrete tatus its irectot X In the following example, a single input timer is used with a preset of seconds. The timer discrete status bit (T) will turn on when the timer has timed for seconds. The timer is reset when X turns off, turning the discrete status bit off and resetting the timer current value to. TMR K T Timing iagram econds T Y X T Y N TMR urrent alue / econds T MR Timer xample Using omparative ontacts irectot X In the following example, a single input timer is used with a preset of. seconds. omparative contacts are used to energize Y, Y, and Y at one second intervals respectively. When X is turned off the timer will be reset to and the comparative contacts will turn off Y, Y, and Y. TMR T K Timing iagram econds T K Y X Y T K Y Y Y T K Y T urrent alue / econds N TMR T MR T MR T MR P User Manual, rd dition

- Timer, ounter, and hift Register Instructions ccumulating Timer (TMR) ccumulating ast Timer (TMR) The ccumulating Timer is a. second two input timer that will time to a maximum of 9999999.9. The ccumulating ast Timer is a. second two-input timer that will time to a maximum of 999999.99. ach one uses two timer registers in -memory. These timers have two inputs, an enable and a reset. The timer starts timing when the enable is on and stops when the enable is off (without resetting the count). The reset will reset the timer when on and allow the timer to time when off. Instruction pecifications Timer Reference (T): pecifies the timer number. Preset alue (bbb): onstant value (K) or a --memory location. urrent alue: Timer current values are accessed by referencing the associated or T memory location*. or example, the timer current value for T resides in -memory location. iscrete tatus it: The discrete status bit is accessed by referencing the associated T memory location. Operating as a timer done bit, it will be on if the current value is equal to or greater than the preset value. or example the discrete status bit for timer would be T. nable Reset TMR bbb T Preset Timer # nable Reset TMR bbb T Preset Timer # The timer discrete status bit and the current value are not specified in the timer instruction. NOT: The accumulating type timer uses two consecutive -memory locations for the -digit value, and therefore two consecutive timer locations. or example, if TMR is used, the next available timer number is TMR. Operand ata Type Range / bbb Timers T -- -- -- --memory for preset values -- -- -- -- onstants (preset only) K -- -- --99999999 Timer discrete status bits T/ -- or -- Timer current values /T* -- NOT: * With the HPP, both the Timer discrete status bits and current value are accessed with the same data reference. irectot uses separate references, such as T for discrete status bit for Timer T, and T for the current value of Timer T. The following examples show two methods of programming timers. One performs functions when the timer reaches the preset value using the discrete status bit, or use comparative contacts to perform functions at different time intervals. P User Manual, rd dition

Timer, ounter, and hift Register Instructions - ccumulating Timer xample using iscrete tatus its irectot X In the following example, a two input timer (accumulating timer) is used with a preset of seconds. The timer discrete status bit (T) will turn on when the timer has timed for seconds. Notice in this example that the timer times for second, stops for one second, then resumes timing. The timer will reset when turns on, turning the discrete status bit off and resetting the timer current value to. TMR K T X Timing iagram econds T Y T urrent alue / econds (cont) T MR G N TMR G ccumulator Timer xample Using omparative ontacts In the following example, a single input timer is used with a preset of. seconds. omparative contacts are used to energized Y, Y, and Y at one second intervals respectively. The comparative contacts will turn off when the timer is reset. irectot X TMR T Timing iagram econds K X T K Y Y Y T K Y Y T T K Y urrent alue / econds (cont) N TMR T MR T MR T MR P User Manual, rd dition

- Timer, ounter, and hift Register Instructions Using ounters ounters are used to count events. The counters available are up counters, up/down counters, and stage counters (used with R PU programming). The up counter has two inputs, a count input and a reset input. The maximum count value is 9999. The timing diagram below shows the relationship between the counter input, counter reset, associated discrete bit, current value, and counter preset. X X T X X Up Reset NT K T urrent alue ounts ounter preset The up down counter has three inputs, a count up input, count down input and reset input. The maximum count value is 99999999. The timing diagram below shows the relationship between the counter input, counter reset, associated discrete bit, current value, and counter preset. X X X X Up U K T X X own T urrent alue ounts Reset ounter preset The stage counter has a count input and is reset by the RT instruction. This instruction is useful when programming using the R PU structured programming. The maximum count value is 9999. The timing diagram below shows the relationship between the counter input, associated discrete bit, current value, counter preset and reset instruction. X T X Up GNT K T urrent alue RT T ounts ounter preset P User Manual, rd dition

Timer, ounter, and hift Register Instructions - ounter (NT) The ounter is a two input counter that increments when the count input logic transitions from off to on. When the counter reset input is on the counter resets to. When the current value equals the preset value, the counter status bit comes on and the counter continues to count up to a maximum count of 9999. The maximum value will be held until the counter is reset. Instruction pecifications ounter Reference (T): pecifies the counter number. Preset alue (bbb): onstant value (K) or a --memory location. urrent alues: ounter current values are accessed by referencing the associated or T memory locations*. The --memory location is the counter location +. or example, the counter current value for T resides in --memory location. ount Reset ounter # NT T bbb Preset The counter discrete status bit and the current value are not specified in the counter instruction. iscrete tatus it: The discrete status bit is accessed by referencing the associated T memory location. It will be on if the value is equal to or greater than the preset value. or example the discrete status bit for counter would be T. NOT: ounter preset constants (K) may be changed by using a programming device, even when the PU is in Run Mode. Therefore, a -memory preset is required only if the ladder program must change the preset. Operand ata Type Range / bbb ounters T -- -- -- --memory (preset only) -- -- -- -- onstants (preset only) K -- -- --9999 ounter discrete status bits T/ -- or -- ounter current values /T* -- NOT: * With the HPP, both the ounter discrete status bits and current value are accessed with the same data reference. irectot uses separate references, such as T for discrete status bit for ounter T, and T for the current value of ounter T. P User Manual, rd dition

- Timer, ounter, and hift Register Instructions ounter xample Using iscrete tatus its irectot X In the following example, when X makes an off to on transition, counter T will increment by one. When the current value reaches the preset value of, the counter status bit T will turn on and energize Y. When the reset turns on, the counter status bit will turn off and the current value will be. The current value for counter T will be held in --memory location. NT K T X ounting diagram T Y Y urrent alue (cont) T MR GY NT ounter xample Using omparative ontacts irectot X In the following example, when X makes an off to on transition, counter T will increment by one. omparative contacts are used to energize Y, Y, and Y at different counts. When the reset turns on, the counter status bit will turn off and the counter current value will be, and the comparative contacts will turn off. NT K T X ounting diagram T K Y Y Y T T K K Y Y Y urrent alue (cont) T MR GY NT T MR T MR P User Manual, rd dition

Timer, ounter, and hift Register Instructions - tage ounter (GNT) The tage ounter is a single input counter that increments when the input logic transitions from off to on. This counter differs from other counters since it will hold its current value until reset using the RT instruction. The tage ounter is designed for use in R PU programs but can be used in relay ladder logic programs. When the current value equals the preset value, the counter status bit turns on and the counter continues to count up to a maximum count of 9999. The maximum value will be held until the counter is reset. Instruction pecifications ounter Reference (T): pecifies the counter number. Preset alue (bbb): onstant value (K) or a --memory location. urrent alues: ounter current values are accessed by referencing the associated or T memory locations*. The -memory location is the counter location +. or example, the counter current value for T resides in --memory location. iscrete tatus it: The discrete status bit is accessed by referencing the associated T memory location. It will be on if the value is equal to or greater than the preset value. or example the discrete status bit for counter would be T. GNT T bbb Preset ounter # The counter discrete status bit and the current value are not specified in the counter instruction. Operand ata Type Range / bbb ounters T -- -- -- --memory (preset only) onstants (preset only) -- -- -- K -- -- --9999 ounter discrete status bits T/ -- or -- ounter current values /T* -- NOT: * With the HPP, both the ounter discrete status bits and current value are accessed with the same data reference. irectot uses separate references, such as T for discrete status bit for ounter T, and T for the current value of ounter T. P User Manual, rd dition

- Timer, ounter, and hift Register Instructions tage ounter xample Using iscrete tatus its irectot X In the following example, when X makes an off to on transition, stage counter T will increment by one. When the current value reaches, the counter status bit T will turn on and energize Y. The counter status bit T will remain on until the counter is reset using the RT instruction. When the counter is reset, the counter status bit will turn off and the counter current value will be. The current value for counter T will be held in --memory location. GNT T K X ounting diagram T Y T RT Y urrent alue RT T (cont) RT G GY NT H RT T MR H T MR H tage ounter xample Using omparative ontacts irectot X In the following example, when X makes an off to on transition, counter T will increment by one. omparative contacts are used to energize Y, Y, and Y at different counts. lthough this is not shown in the example, when the counter is reset using the Reset instruction, the counter status bit will turn off and the current value will be. The current value for counter T will be held in --memory location. GNT T K X ounting diagram T K Y Y T K Y Y Y T K Y urrent alue (cont) T MR RT G GY NT T MR T MR P User Manual, rd dition

Timer, ounter, and hift Register Instructions - Up own ounter (U) This Up/own ounter counts up on each off to on transition of the Up input and counts down on each off to on transition of the own input. The counter is reset to when the Reset input is on. The count range is --99999999. The count input not being used must be off in order for the active count input to function. Up own Reset U T bbb ounter # Preset Instruction pecification ounter Reference (T): pecifies the counter number. Preset alue (bbb): onstant value (K) or two consecutive --memory locations. urrent alues: urrent count is a double word value accessed by referencing the associated or T memory locations*. The -memory location is the counter location +. or example, the counter current value for T resides in --memory location and. iscrete tatus it: The discrete status bit is accessed by referencing the associated T memory location. Operating as a counter done bit it will be on if the value is equal to or greater than the preset value. or example the discrete status bit for counter would be T. aution: The U uses two memory locations for the digit current value. This means that the U uses two consecutive counter locations. If U T is used in the program, the next available counter is T. The counter discrete status bit and the current value are not specified in the counter instruction. Operand ata Type Range / bbb ounters T -- -- -- --memory (preset only) -- -- -- -- onstants (preset only) K -- -- --99999999 ounter discrete status bits T/ -- or -- ounter current values /T* -- NOT: * With the HPP, both the ounter discrete status bits and current value are accessed with the same data reference. irectot uses separate references, such as T for discrete status bit for ounter T, and T for the current value of ounter T. P User Manual, rd dition

- Timer, ounter, and hift Register Instructions Up / own ounter xample Using iscrete tatus its In the following example if X and X are off,when X toggles from off to on the counter will increment by one. If X and X are off the counter will decrement by one when X toggles from off to on. When the count value reaches the preset value of, the counter status bit will turn on. When the reset X turns on, the counter status bit will turn off and the current value will be. irectot X X U K T X ounting iagram X X X T Y T urrent alue (cont) T MR U IG Up / own ounter xample Using omparative ontacts In the following example, when X makes an off to on transition, counter T will increment by one. omparative contacts are used to energize Y and Y at different counts. When the reset (X) turns on, the counter status bit will turn off, the current value will be, and the comparative contacts will turn off. irectot X X U T X ounting iagram X X X T K Y T K Y Y Y urrent alue (cont) U IG N T MR T MR P User Manual, rd dition

Timer, ounter, and hift Register Instructions -9 hift Register (R) The hift Register instruction shifts data through a predefined number of control relays. The control ranges in the shift register block must start at the beginning of an bit boundary use -bit blocks. The hift Register has three contacts. T R ata determines the value ( or ) that will enter the register OK rom lock shifts the bits one position on each low to high transition RT To bbb Reset resets the hift Register to all zeros. With each off to on transition of the clock input, the bits which make up the shift register block are shifted by one bit position and the status of the data input is placed into the starting bit position in the shift register. The direction of the shift depends on the entry in the rom and To fields. rom to would define a block of sixteen bits to be shifted from left to right. rom to would define a block of sixteen bits, to be shifted from right to left. The maximum size of the shift register block depends on the number of available control relays. The minimum block size is control relays. Operand ata Type Range / bbb ontrol Relay -- -- irectot X ata Input R X lock Input rom X Reset Input To RT H R ORN Inputs on uccessive cans hift Register its ata lock Reset -- -- -- -- -- - indicates on - indicates off P User Manual, rd dition

- ccumulator / tack oad and Output ata Instructions ccumulator / tack oad and Output ata Instructions Using the ccumulator opying ata to the ccumulator The accumulator in the internal PUs is a bit register which is used as a temporary storage location for data that is being copied or manipulated in some manor. or example, you have to use the accumulator to perform math operations such as add, subtract, multiply, etc. ince there are bits, you can use up to an -digit number. The accumulator is reset to at the end of every PU scan. The oad and Out instructions and their variations are used to copy data from a -memory location to the accumulator, or, to copy data from the accumulator to --memory. The following example copies data from -memory location to -memory location. X opy data from to the lower bits of the accumulator Unused accumulator bits are set to zero cc. 9 9 9 opy data from the lower bits of the accumulator to ince the accumulator is bits and memory locations are bits the oad ouble and Out ouble (or variations thereof) use two consecutive -memory locations or digit constants to copy data either to the accumulator from a -memory address or from a -memory address to the accumulator. or example if you wanted to copy data from and to and the most efficient way to perform this function would be as follows: X 9 opy data from and to the accumulator cc. 9 opy data from the accumulator to and 9 hanging the ccumulator ata Instructions that manipulate data also use the accumulator. The result of the manipulated data resides in the accumulator. The data that was being manipulated is cleared from the accumulator. The following example loads the constant value 9 into the accumulator, shifts the data right bits, and outputs the result to. P User Manual, rd dition

ccumulator / tack oad and Output ata Instructions - X onstant 9 K9 oad the value 9 into the accumulator 9 9 9 cc. The upper bits of the accumulator will be set to hifted out of accumulator HR 9 9 9 K cc. hift the data in the accumulator bits (K) to the right Output the lower bits of the accumulator to 9 ome of the data manipulation instructions use bits. They use two consecutive memory locations or an digit constant to manipulate data in the accumulator. In the following example, when X is on, the value in and will be loaded into the accumulator using the oad ouble instruction. The value in the accumulator is added with the value in and using the dd ouble instruction. The value in the accumulator is copied to and using the Out ouble instruction. X 9 oad the value in and into the accumulator ddthevalueinthe accumulator with the value in and 9 + cc. 9 9 (ccumulator) ( and ) opy the value in the accumulator to and 9 9 P User Manual, rd dition

- ccumulator / tack oad and Output ata Instructions Using the ccumulator tack The accumulator stack is used for instructions that require more than one parameter to execute a function or for user defined functionality. The accumulator stack is used when more than one oad instruction is executed without the use of an Out instruction. The first load instruction in the scan places a value into the accumulator. very oad instruction thereafter without the use of an Out instruction places a value into the accumulator and the value that was in the accumulator is placed onto the accumulator stack. The Out instruction nullifies the previous load instruction and does not place the value that was in the accumulator onto the accumulator stack when the next load instruction is executed. very time a value is placed onto the accumulator stack the other values in the stack are pushed down one location. The accumulator is eight levels deep (eight bit registers). If there is a value in the eighth location when a new value is placed onto the stack, the value in the eighth location is pushed off the stack and cannot be recovered. X K oad the value into the accumulator onstant urrent cc. value cc. Previous cc. value cc. evel evel evel ccumulator tack evel evel evel K onstant urrent cc. value evel evel oad the value into the accumulator, pushing the value onto the stack cc. Previous cc. value cc. evel evel ccumulator tack ucket evel evel evel evel K onstant urrent cc. value evel evel oad the value into the accumulator, pushing the value to the st stack location and the value to the nd stack location cc. Previous cc. value cc. evel evel ccumulator tack ucket evel evel evel evel evel evel The POP instruction rotates values upward through the stack into the accumulator. When a POP is executed the value which was in the accumulator is cleared and the value that was on top of the stack is in the accumulator. The values in the stack are shifted up one position in the stack. ucket P User Manual, rd dition

ccumulator / tack oad and Output ata Instructions - X POP Previous cc. value cc. POP the st value on the stack into the accumulator and move stack values up one location urrent cc. value cc. evel evel ccumulator tack 9 9 evel evel opy data from the accumulator to evel evel evel evel POP Previous cc. value cc. POP the st value on the stack into the accumulator and move stack values up one location urrent cc. value cc. 9 evel evel ccumulator tack 9 evel evel opy data from the accumulator to. 9 evel evel evel evel POP Previous cc. value cc. 9 POP the st value on the stack into the accumulator and move stack values up one location urrent cc. value cc. X X X X 9 evel evel ccumulator tack evel evel opy data from the accumulator to 9 evel evel evel evel Using Pointers Many of the series instructions will allow -memory pointers as a operand (commonly known as indirect addressing). Pointers allow instructions to obtain data from -memory locations referenced by the pointer value. NOT: -memory addressing is in octal. However, the pointers reference a -memory location with values viewed as HX. Use the oad ddress () instruction to move an address into the pointer location. This instruction performs the Octal to Hexadecimal conversion automatically. In the following simple example we are using a pointer operand in a oad instruction. -memory location is being used as the pointer location. contains the value which the PU views as the Hex equivalent of the Octal address -memory location. The PU will copy the data from which in this example contains the value into the lower word of the accumulator. P User Manual, rd dition