Ladder rung, Instruction list – Rockwell Automation 1761-HHP-B30 MicroLogix 1000 with Hand-Held Programmer (HHP) User Manual

Page 173

Advertising
background image

Chapter 10
Using Math Instructions

10–7

Ladder Rung

(U)

S:5

0

] [

B3

0

[OSR]

B3

1

When the rung goes true for
a single scan, B1 is added
to B2. The result is placed
in B2.

SUB

SUBTRACT
Source A

B3:3

0000000000000011

Source B

1

Dest

B3:3

0000000000000011

ADD

ADD
Source A

B3:1

0101010110101000

Source B

B3:2

0001100101000000

Dest

B3:2

0001100101000000

ADD

ADD
Source A

1

Source B

B3:3

0000000000000011

Dest

B3:3

0000000000000011

] [

S:0

0

] [

B3

31

If a carry is generated (S0/0
set), 1 is added to B3.

If B1 is negative (B/31 set),
1 is subtracted from B3.

Overflow trap bit S5/0 is
unlatched to prevent a major
error from occurring at the
end of the scan.

Instruction List

FUN GRAPHIC PARAMETER
CODE SYMBOL MNEMONIC NAME ADDRESS VALUE FORCES
–––– ––––––– –––––––– –––– ––––––– ––––– ––––––

20 |–] [– LD B/0 0

29 –OSR– AND–OSR B/1 0

80 ADD SRCA B1 0101010110101000
SRCB B2 1940H
DEST B2 1940H

10 MPS

22 –] [– AND S0/0 0

80 ADD SRCA 1
SRCB B3 0003H
DEST B3 0003H

11 MRD

22 –] [– AND B/31 0

81 SUB SRCA B3 0003H
SRCB 1
DEST B3 0003H

12 MPP

42 –(U)– RST S5/0 0

Advertising