Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 4 of 70

SLC 500 Instruction Set Reference Manual, pages 31 to 40

Pages 31 to 40 of 694

The original document is the PDF (7.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Allen-Bradley 1747-L514

Page 31

Processor Files

1-7

Entering Parameters There are several parameters associated with Counter instructions. The following parameters detail the operations of the counter.

Accumulator Value (ACC) This is the number of false-to-true transitions that have occurred since the counter was last reset.

Preset Value (PRE) Specifies the value which the counter must reach before the controller sets the done bit (DN). When the accumulator value becomes equal to or greater than the preset value, the done status bit is set. You can use the done bit (DN) to control an output device. Preset and accumulated values for counters range from -32,768 to +32,767, and are stored as signed integers. Negative values are stored in two’s complement form.

Addressing Structure Assign counter addresses using the format Cf:e.s/b.

Table 1.9 Counter File Addressing Format Explanation C

Counter f

File number. For SLC 500 processors the default is 5. A file number between 9 to 255 can be used for additional storage.

:

Element delimiter e

Element number

.

Word Delimiter s

Word Element

/

Bit delimiter b

Bit Number

These are 3-word elements. The range is 0 to 255. 0 to 2 0 to 15

Examples C5:0/15 or C5:0/CU

Count up enable bit

C5:0/14 or C5:0/CD

Count down enable bit

C5:0/13 or C5:0/DN

Done bit

C5:0/12 or C5:0/OV

Overflow bit

Publication 1747-RM001G-EN-P - November 2008

Page 32

1-8

Processor Files

Table 1.9 Counter File Addressing Format Explanation C5:0/11 or C5:0/UN

Underflow bit

C5:0/10 or C5:0/UA

Update accum. bit (use with HSC in fixed controller only)

C5:0.1 or C5:0.PRE

Preset value of the counter

C5:0.2 or C5:0.ACC

Accumulated value of the counter

C5:0.1/0 or C5:0.PRE/0

Bit 0 of the preset value

C5:0.2/0 or C5:0.ACC/0

Bit 0 of the accumulated value

Control Data File (R6:) These instructions use various control bits. These are 3-word elements, used with bit shift, FIFO, LIFO, sequencer instructions, and ASCII instructions ABL, ACB, AHL, ARD, ARL, AWA, and AWT. Word 0 is the status word, word 1 indicates the length of stored data, and word 2 indicates position. This is shown in Table 1.10. In the control element, there are eight status bits and an error code byte. A fixed controller and an SLC 5/01 control element has six bits. Bits EU and EM are not used by the processor.

Table 1.10 Three Word Element Structure 15

14

13

12

11

10

09

08

07

06

EN

EU(1)

DN

EM(1) ER

UL

IN

FD

Error Code

05

04

03

02

01

00

Word 0

Length of Bit Array or File (LEN)

1

Bit Pointer or Position (POS)

2

(1)

Not used in Fixed or SLC 5/01.

Table 1.11 Control Elements

Publication 1747-RM001G-EN-P - November 2008

Addressable Bits

Addressable Words

EN = Enable

LEN = Length

EU = Update Enable

POS = Position

Page 33

Processor Files

1-9

Table 1.11 Control Elements DN = Done EM = Stack Empty ER = Error UL = Unload IN = Inhibit FD = Found

Assign control addresses as follows.

Table 1.12 Control File Addressing Format Format Rf:e

Rf:e.s/b

Explanation R

Control file f

File number. Number 6 is the default file. A file number between 9 and 255 can be used if additional storage is required.

:

Element delimiter e

Element number

Rf:e

Explained above.

.

Word delimiter s

Indicates word

/

Bit delimiter b

Bit

Ranges from 0 to 255. These are 3-word elements. See figure above.

Examples: R6:2

Element 2, control file 6 Address bits and words by using the format Rf:e.s/b

R6:2/15 or R6:2/EN R6:2/14 or R6:2/EU R6:2/13 or R6:2/DN R6:2/12 or R6:2/EM R6:2/11 or R6:2/ER R6:2/10 or R6:2/UL R6:2/9 or R6:2/IN R6:2/8 or R6:2/FD

Enable bit Unload Enable bit Done bit Stack Empty bit Error bit Unload bit Inhibit bit Found bit

R6:2.1 or R6:2.LEN R6:2.2 or R6:2.POS

Length value Position value

R6:2.1/0 R6:2.2/0

Bit 0 of length value Bit 0 of position value

Publication 1747-RM001G-EN-P - November 2008

Page 34

1-10

Processor Files

Integer Data File (N7:) Use these addresses as your program requires. These are 1-word elements, addressable at the element and bit level. Assign integer addresses as follows.

Table 1.13 Integer File Addressing Format Format Nf:e/b

Explanation N

Integer file f

File number. Number 7 is the default file. A file number between 9 to255 can be used if additional storage is required.

:

Element delimiter e

Element number

/

Bit delimiter b

Bit number

Ranges from 0 to 255. These are 1-word elements. 16 bits per element. Bit location within the element. Ranges from 0 to 15.

Examples: N7:2 N7:2/8 N10:36

Publication 1747-RM001G-EN-P - November 2008

Element 2, integer file 7 Bit 8 in element 2, integer file 7 Element 36, integer file 10 (file 10 designated as an integer file by the user)

Page 35

Processor Files

1-11

Float Data File (F8:) Use these addresses as your program requires. These are 2-word elements, addressable at the element and bit level. Assign float addresses as follows.

Table 1.14 Float File Addressing Format Format Ff:e

Explanation F

Integer file f

File number. Number 8 is the default file. A file number between 9 to 255 can be used if additional storage is required.

:

Element delimiter e

Element number

Ranges from 0 to 255. These are 2-word elements. 32 bits per element.

Examples: F8:2

Element 2, float file 8

TIP

Float data type cannot be accessed at the bit level.

Publication 1747-RM001G-EN-P - November 2008

Page 36

1-12

Processor Files

Notes:

Publication 1747-RM001G-EN-P - November 2008

Page 37

Chapter

2

Basic Instructions

This chapter contains general information about the basic instructions and explains how they function in your application program. Each of the basic instructions includes information on: • the instruction symbol. • the instruction format. • the instruction usage. The Basic Instructions detailed in this chapter are listed in Table 2.1.

Table 2.1 Basic Instructions Instruction Mnemonic

Instruction Name

Purpose

Page

XIC

Examine if Closed

Examines a bit for an On condition.

2-3

XIO

Examine if Open

Examines a bit for an Off condition.

2-3

OTE

Output Energize

Turns a bit On or Off.

2-4

OTL and OTU

Output Latch and

OTL turns a bit on when the rung is executed, and this bit retains its state when the rung is not executed or a power cycle occurs. OTU turns a bit off when the rung is executed, and this bit retains its state when the rung is not executed or when power cycle occurs.

2-4

Output Unlatch

1

OSR

One-shot Rising

Triggers a one-time event.

2-5

TON

Timer On-delay

Counts timebase intervals when the instruction is true.

2-9

TOF

Timer Off-delay

Counts timebase intervals when the instruction is false.

2-10

RTO

Retentive Timer

Counts timebase intervals when the instruction is true and retains the accumulated value when the instruction goes false or when power cycle occurs.

2-11

CTU

Count Up

Increments the accumulated value at each false-to-true transition and retains the accumulated value when the instruction goes false or when power cycle occurs.

2-13

CTD

Count Down

Decrements the accumulated value at each false-to-true transition and retains the accumulated value when the instruction goes false or when power cycle occurs.

2-14

HSC

High-speed Counter

Counts high-speed pulses from a fixed controller high-speed input.

2-15

RES

Reset

Resets the accumulated value and status bits of a timer or counter. Do not use with TOF timers.

2-20

Publication 1747-RM001G-EN-P - November 2008

Page 38

2-2

Basic Instructions

About the Basic Instructions

Basic instructions, when used in ladder programs, represent hardwired logic circuits used for the control of a machine or equipment. The basic instructions are separated into three groups: bit, timer, and counter. Before you learn about the instructions in each of these groups, we suggest that you read the overviews that follow: • Bit Instructions Overview. • Timer Instructions Overview. • Counter Instructions Overview.

Bit Instructions Overview

Bit instructions operate on a single bit of data. During operation, the processor may set or reset the bit, based on logical continuity of ladder rungs. You can address a bit as many times as your program requires.

TIP

Using the same address with multiple output instructions is not recommended.

Bit instructions are used with the following data files. • Output/Input Files • Status File • Bit File • Timer File

Publication 1747-RM001G-EN-P - November 2008

Page 39

Basic Instructions

2-3

Use the XIC instruction in your ladder program to determine if a bit is On. When the instruction is executed, if the bit addressed is on (1), then the instruction is evaluated as true. When the instruction is executed, if the bit addressed is off (0), then the instruction is evaluated as false.

Examine if Closed (XIC)

Table 2.2 XIC Bit State ] [

Fixed SLC SLC SLC SLC SLC 5/01 5/02 5/03 5/04 5/05 •

•

•

•

•

Bit Address State

XIC Instruction

0

False

1

True

•

Input Instruction

Examples of devices that turn on or off include: • a push button wired to an input (addressed as I:0/4). • an output wired to a pilot light (addressed as O:0/2). • a timer controlling a light (addressed as T4:3/DN).

Use the XIO instruction in your ladder program to determine if a bit is Off. When the instruction is executed, if the bit addressed is off (0), then the instruction is evaluated as true. When the instruction is executed, if the bit addressed is on (1), then the instruction is evaluated as false.

Examine if Open (XIO)

Table 2.3 XIO Bit State

]/[

Fixed SLC SLC SLC SLC SLC 5/01 5/02 5/03 5/04 5/05 •

•

•

•

Input Instruction

•

Bit Address State

XIO Instruction

0

True

1

False

•

Examples of devices that turn on or off include: • motor overload normally closed (N.C.) wired to an input (I:0/10). • an output wired to a pilot light (addressed as O:0/4). • a timer controlling a light (addressed as T4:3/DN).

Publication 1747-RM001G-EN-P - November 2008

Page 40

2-4

Basic Instructions

Use the OTE instruction in your ladder program to turn on a bit when rung conditions are evaluated as true.

Output Energize (OTE)

An example of a device that turns on or off is an output wired to a pilot light (addressed as O:0/4).

( )

OTE instructions are reset when: Fixed SLC SLC SLC SLC SLC 5/01 5/02 5/03 5/04 5/05 •

•

•

•

•

•

Output Instruction

• the SLC enters or returns to the REM Run or REM Test mode or power is restored. • the OTE is programmed within an inactive or false Master Control Reset (MCR) zone.

TIP

A bit that is set within a subroutine using an OTE instruction remains set until the subroutine is scanned again.

Output Latch (OTL) and Output Unlatch (OTU)

OTL and OTU are retentive output instructions. OTL can only turn on a bit, while OTU can only turn off a bit. These instructions are usually used in pairs, with both instructions addressing the same bit.

(L)

Your program can examine a bit controlled by OTL and OTU instructions as often as necessary.

(U)

Fixed SLC SLC SLC SLC SLC 5/01 5/02 5/03 5/04 5/05 •

•

•

•

•

ATTENTION

•

Output Instructions

Under fatal error conditions, physical outputs are turned off. Once the error conditions are cleared, the controller resumes operation using the data table value of the operand.

Using OTL When you assign an address to the OTL instruction that corresponds to the address of a physical output, the output device wired to this screw terminal is energized when the bit is set (turned on or enabled). When rung conditions become false (after being true), the bit remains set and the corresponding output device remains energized.

Publication 1747-RM001G-EN-P - November 2008