Instruction 108- encode, Since n=5, the size of the bit table is 2 – Maple Systems MAPware-7000 User Manual

Page 180

Advertising
background image

MAPware-7000 Ladder Logic Guide

172

1010-1041 rev. 00

Instruction 108-

Encode

Expression:

Space Requirement: 1 line x 5 column Location Requirement: Middle, Right rail

Function:

When the input is ON, this instruction finds the bit position of the most significant ON bit in a bit
table. The bit table is defined as starting with bit 0 (Least Significant Bit) of Register A, and of
size 2

n

(where n can be 1-8). The value is stored in Register B.

Execution Condition:

Input

Operation

Output

ERF

OFF

No execution

OFF

---

ON

Normal Execution

ON

---

There is no ON bit (no execution)

OFF

Set

Operand:

Coil or Bit

Register

Constant

Index

Name

X

Y B

S

T.

C.

M

X
W

Y
W

B
W

S
W

T C

D

I

J

K

M
W

A

Start of table

√ √

N

Table Size

1-8

B

Encode

Result

√ √

Example:

Since n=5, the size of the bit table is 2

5

(32) bits. The bit table starts with bit 0 of BW05

(since BW05 is a 16 bit register, then BW06 is also part of the bit table). When B010 is
ON, the most significant ON (1) bit position in the bit table is searched, and the position
is stored in D0010.

Advertising