Encode 1 of 16 to 4 (enc), Entering parameters – Rockwell Automation 1761-HHP-B30 MicroLogix 1000 with Hand-Held Programmer (HHP) User Manual

Page 191

Advertising
background image

Chapter 11
Using Data Handling Instructions

11–8

P 0 0 0

D C D

S R C

N 1 1

0 0 0 0 H

P 0 0 0

D C D

D E S T

N 1 2

0 0 0 0 H

When the rung is true, this output instruction searches the source from the
lowest to the highest bit and looks for the first set bit. The corresponding bit
position is written to the destination as an integer, as shown in the table
below.

Source

Destination

Bit 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 15–04 03 02 01 00

x x x x x x x x x x x x x x x 1 x 0 0 0 0
x x x x x x x x x x x x x x 1 0 x 0 0 0 1
x x x x x x x x x x x x x 1 0 0 x 0 0 1 0
x x x x x x x x x x x x 1 0 0 0 x 0 0 1 1
x x x x x x x x x x x 1 0 0 0 0 x 0 1 0 0
x x x x x x x x x x 1 0 0 0 0 0 x 0 1 0 1
x x x x x x x x x 1 0 0 0 0 0 0 x 0 1 1 0
x x x x x x x x 1 0 0 0 0 0 0 0 x 0 1 1 1
x x x x x x x 1 0 0 0 0 0 0 0 0 x 1 0 0 0
x x x x x x 1 0 0 0 0 0 0 0 0 0 x 1 0 0 1
x x x x x 1 0 0 0 0 0 0 0 0 0 0 x 1 0 1 0
x x x x 1 0 0 0 0 0 0 0 0 0 0 0 x 1 0 1 1
x x x 1 0 0 0 0 0 0 0 0 0 0 0 0 x 1 1 0 0
x x 1 0 0 0 0 0 0 0 0 0 0 0 0 0 x 1 1 0 1
x 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 1 1 1 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 1 1 1 1

Entering Parameters

Source is the address of the word to be encoded. Only one bit of this
word should be on at any one time. If more than one bit in the source is
set, the destination bits are set based on the least significant bit that is set.
If a source of zero is used, all of the destination bits are reset and the zero
bit is set.

Destination is the address that contains the bit encode information. Bits
4–15 of the destination are reset by the ENC instruction.

2

L

ENT

ANB

0

1

FUN

To enter the function code, press:

ENC

ENCODE 1 of 16 to 4
Source

N7:11

0000000000000000

Dest

N7:23

0000

Execution Times (

µ

sec) when:

True

False

54.80

6.78

Ladder representation:

Encode 1 of 16 to 4 (ENC)

Advertising