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

The text of a manual · part 61 of 70

SLC 500 Instruction Set Reference Manual, pages 601 to 610

Pages 601 to 610 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 601

Appendix

D

Programming Instruction References

This appendix lists all of the available programming instructions along with their parameters, valid addressing modes, and file types.

Valid Addressing Modes and File Types

The following addressing modes are available. Table D.1 Available Addressing Modes Addressing Mode

Example

Direct

N7:0

Indexed Direct

#N7:0

Indirect

N7:[N10:3]

Indexed Indirect

#N7:[N10:3]

The following file types are available. Table D.2 Available File Types

1

Abbreviation

File Type

O

Output

I

Input

S

Status

B

Binary

T

Timer

C

Counter

R

Control

N

Integer

F

Float(1)(2)

A

ASCII(1)(2)

ST

String(1)(2)

M

M0/M1(3)

Immediate indicates that a constant is a valid file type

(1)

Supported only by SLC 5/03 (OS301 and higher), SLC 5/04, and SLC 5/05 processors.

(2)

Not supported by Fixed SLC, SLC 5/01, and SLC 5/02 processors.

(3)

Not supported by Fixed SLC and SLC 5/01 processors.

Publication 1747-RM001G-EN-P - November 2008

Page 602

D-2

Programming Instruction References

Understanding the Different Addressing Modes The following descriptions will help you understand how to structure a specific type of address.

Direct Addressing The data stored in the specified address is used in the instruction. For example: N7:0 ST20:5 T4:8.ACC

Indexed Addressing You may specify an address as being indexed by placing the “#” character in front of the address. When an address of this form is encountered in the program, the processor takes the element number of the address and adds to it the value contained in the Index Register S:24, then uses the result as the actual address. For example: #N7:10 where S:24 = 15 The actual address used by the instruction is N7:25.

Indirect Addressing You may specify an address as being indirect by replacing the file number, element number, or sub-element number with a [Xf:e.s] symbol. The word address inside of the bracket is queried for a value. The queried value then becomes the file, element, or sub-element portion of the indirect address. For example: B3:[N10:2] states that the element address of Bit file 3 is contained in address N10:2. Therefore, if N10:2 contains the value 5, B3:[N10:2] indirectly refers to address B3:5. Other examples include: N7:[N7:0] N7:[T4:0.ACC] N[N7:0]:[N7:1] C5:[N7:0]

Indexed Indirect Addressing You may specify a combination of indirect and indexed addressing. The processor first resolves the indirect portion of the address and then adds the offset from the Index Register S:24 to come up with the final address. For example:

Publication 1747-RM001G-EN-P - November 2008

Page 603

Programming Instruction References

D-3

#N7:[N10:3] where N10:3 = 20 and S:24 = 15 The actual address used by the instruction is N7:35.

Table D.3 Available Addressing Modes Instruction

Description

Instruction Parameter

ABL(1)

ASCII Test Buffer for Line channel control

Valid Addressing Mode(s)

Valid File Types

0 direct

R characters ABS(2)

ACB(1)

Absolute Value

ASCII Number of Characters in Buffer

ACI

ACL(1)

ACN

(1)

ACS(2)

ADD

AEX(1)

ASCII String to Integer

ASCII Clear Buffer

ASCII String Concatenate

Arc Cosine

Add

ASCII String Extract none 0-1024 source direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none channel control

0 direct

R characters (1)

Immediate Values none 0 to 1024 source direct, indirect

ST none destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M none channel

0 transmit buffer

0=no or 1=yes receive buffer

0=no or 1=yes source A direct, indirect

ST none source B direct, indirect

ST none destination direct

ST none source direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST M

-32,768 to 32,767 f-min to f-max destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none source A direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max source B direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none source direct, indirect

ST none index direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

1 to 82 number direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

1 to 82 destination direct

ST none

Publication 1747-RM001G-EN-P - November 2008

Page 604

D-4

Programming Instruction References

Table D.3 Available Addressing Modes (Continued) Instruction

Description

Instruction Parameter

AHL(1)

ASCII Set/Reset Handshake Lines channel

Valid Addressing Mode(s)

Valid File Types

0

AND mask direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

0 to FFFF

OR mask direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

0 to FFFF control direct

R none channel status AIC(1)

AND

ARD(1)

ARL(1)

ASC(1)

ASN(2)

ASR(1)

ASCII Integer to String

Logical AND

ASCII Read Characters

ASCII Read Line

ASCII String Search

Arc Sine

ASCII String Compare

Publication 1747-RM001G-EN-P - November 2008

Immediate Values

0 to 001F source direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

-32,768 to 32,767 destination direct

ST none source A direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

-32,768 to 32,767 source B direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

-32,768 to 32,767 destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M none channel

0 destination direct

ST none control direct

R none string length

0 to 82 characters read

0 to 82 channel

0 destination direct

ST none control direct

R none string length

0 to 82 characters read

0 to 82 source direct, indirect

ST none index direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

1 to 82 search direct, indirect

ST none result direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M none source direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none source A direct, indirect

ST none source B direct, indirect

ST none

Page 605

Programming Instruction References

D-5

Table D.3 Available Addressing Modes (Continued) Instruction

Description

Instruction Parameter

Valid Addressing Mode(s)

Valid File Types

Immediate Values

ATN(2)

Arc Tangent source direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none

AWA(1)

AWT

BSL

(1)

ASCII Write with Append channel

ASCII Write

Bit Shift Left

0 source direct

ST none control direct

R none string length

0 to 82 characters sent

0 to 82 channel

0 source direct

ST none control direct

R none string length

0 to 82 characters sent

0 to 82 file indexed direct indexed indirect

O, I, S, B, N, A, ST none control direct

R none bit address direct, indirect

O, I, S, B, T, C, R, N, A, ST, M none length BSR

Bit Shift Right

0 to 2048 file indexed direct indexed indirect

O, I, S, B, N, A, ST none control direct

R none bit address direct, indirect

O, I, S, B, T, C, R, N, A, ST, M none length BTR

BTW

Block Transfer Read

Block Transfer Write

0 to 2048 control direct

N source “Data” direct

I, O, S, B, N, A, F buffer direct M1 file address

M control direct

N source “Data” direct

I, O, S, B, N, A, F buffer direct M0 file address

M

Publication 1747-RM001G-EN-P - November 2008

Page 606

D-6

Programming Instruction References

Table D.3 Available Addressing Modes (Continued) Instruction

Description

Instruction Parameter

Valid Addressing Mode(s)

Valid File Types

Immediate Values

CEM

ControlNet Explicit Message control block direct

N none control block length

67

1747-SCNR slot

1 to 30 size in words (receive data)

0 to 248 size in words (send data)

0 to 248 data table address (receive data)

direct

N none data table address (send data)

direct

N none message timeout (x1 ms)

2 to 32767

ControlNet address

1 to 99 service service code (hex)

1 to 7F class (hex)

0 to FF instance (hex)

0 to FFFF attribute (hex)

0 to FFFF member (hex)

0 to FFFF

CLR

Clear destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none

COP

Copy File source indexed direct indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none destination indexed direct indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none length COS(2)

CPT(2)

Cosine

Compute source direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none expression

Publication 1747-RM001G-EN-P - November 2008

1 to 128

<expression>

Page 607

Programming Instruction References

D-7

Table D.3 Available Addressing Modes (Continued) Instruction

Description

Instruction Parameter

Valid Addressing Mode(s)

Valid File Types

Immediate Values

CTD

Count Down counter direct

C none

CTU

DCD

DDV

DDT

DEG(2)

DEM

Count Up

Decode 4 to 1 of 16

Double Divide

Diagnostic Detect

Radians to Degrees

DeviceNet Explicit Message preset

-32,768 to 32,767 accum

-32,768 to 32,767 counter direct

C none preset

-32,768 to 32,767 accum

-32,768 to 32,767 source direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M none destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M none source direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

-32,768 to 32,767 destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M none control direct

R source “file” index direct

I, O, S, B, N, A reference “file” index direct

I, O, S, B, N, A result “file” index direct

I, O, S, B, N, A source direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none control block direct

N none control block length

70

1747-SDN slot

0 to 30 size of send data (bytes)

0 to 52 message timeout (x1 sec)

0 to 255

DeviceNet address

0 to 63 service service code (hex)

1 to 7F class (hex)

0 to FF instance (hex)

0 to FFFF attribute (hex)

0 to FF

Publication 1747-RM001G-EN-P - November 2008

Page 608

D-8

Programming Instruction References

Table D.3 Available Addressing Modes (Continued) Instruction

Description

Instruction Parameter

Valid Addressing Mode(s)

Valid File Types

Immediate Values

DIV

Divide source A direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max source B direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none control block direct

N none

EEM

EtherNet/IP Explicit Message control block length

58 size in words (receive data)

0 to 124 size in words (send data)

0 to 124 data table address (receive data)

direct

N none data table address (send data)

direct

N none service

ENC

EQU

FBC

Encode 1 of 16 to 4

Equal

File Bit Comparison

Publication 1747-RM001G-EN-P - November 2008 service code (hex)

1 to 7F class (hex)

0 to FFFF instance (hex)

0 to FFFF attribute (hex)

0 to FF source direct, indirect, index, indirect index

I, O, S, B, N, A, T destination direct, indirect, index, indirect index

I, O, S, B, N, A, C, R source A direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none source B direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max control direct

R source “file” index direct

I, O, S, B, N, A reference “file” index direct

I, O, S, B, N, A result “file” index direct

I, O, S, B, N, A

Page 609

Programming Instruction References

D-9

Table D.3 Available Addressing Modes (Continued) Instruction

Description

Instruction Parameter

Valid Addressing Mode(s)

Valid File Types

Immediate Values

FFL(3)

FIFO Load source direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M(4)

-32,768 to 32,767

FIFO array indexed direct indexed indirect

O, I, S, B, N, A none

FIFO control direct

R none

FFU(3)

FLL

FIFO Unload

Fill File length

1 to 128 position

0 to 127

FIFO array indexed direct indexed indirect

O, I, S, B, N, A none destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M(4)

none

FIFO control direct

R none length

1 to 128 position

0 to 127 source direct, indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max destination indexed direct indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none length FRD

GEQ

GRT

From BCD to Binary

Greater Than or Equal

Greater Than

1 to 128 source (SLC 5/01)

direct

O, I, S, B, T, C, R, N, A, ST, M none source (SLC 5/02, 5/03, 5/04, 5/05)

direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N none destination direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M none source A direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none source B direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max source A direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none source B direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max

Publication 1747-RM001G-EN-P - November 2008

Page 610

D-10

Programming Instruction References

Table D.3 Available Addressing Modes (Continued) Instruction

Description

Instruction Parameter

HSC(5)

High-speed Counter (SLC counter 5/01) preset counter

Valid Addressing Mode(s)

Valid File Types

Immediate Values none 1 to 32,767 direct

C none preset

-32,768 to 32,767 accum

-32,768 to 32,767 source direct

B and N none length always 5

IID(6)

I/O Interrupt Disable slots double hex word (list of slots)

IIE(6)

I/O Interrupt Enable slots double hex word (list of slots)

IIM

Immediate Input with Mask slot direct

I none mask direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

-32,768 to 32,767 length (SLC 5/03, 5/04, and 5/05) INT(3)

I/O Interrupt

IOM

Immediate Output with Mask

1 to 32 none slot direct

O none mask direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, A, ST, M

-32,768 to 32,767 length (SLC 5/03, 5/04, and 5/05)

1 to 32

JMP

Jump label number

0 to 999

JSR

Jump to Subroutine subroutine file number

3 to 255

LBL

Label Declaration label number

0 to 999

LEQ

Less Than or Equal To source A direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none source B direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max source A direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M none source B direct, indexed direct indirect, indexed indirect

O, I, S, B, T, C, R, N, F, A, ST, M

-32,768 to 32,767 f-min to f-max

LES

Less Than

Publication 1747-RM001G-EN-P - November 2008