Toshiba PROSEC T1-16S User Manual page 202

Programmable controller basic hardware and function
Hide thumbs Also See for PROSEC T1-16S:
Table of Contents

Advertisement

7. Instructions
FUN 120
ENC
Expression
Input
[ A ENC (n) B ]
Function
When the input is ON, this instruction finds the bit position of the most significant ON bit in the bit
n
table, size 2
bits starting with 0 bit (LSB) of A, and stores it in B.
Execution condition
Input
OFF
No execution
ON
Normal execution
There is no ON bit (no execution)
Operand
Name
X
A Start of table
n Table size
B Encode result
Example
5
2
(=32) bits starting with 0 bit of RW05 (R050 to R06F) are defined as the bit table.
When R010 is ON, the most significant ON (1) bit position in the bit table is searched, and the
position is stored in D0010.
The following figure shows an operation example.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 1 0 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 0
Note
If there is no ON bit in the bit table, the instruction error flag (ERF = S051) is set to ON.
200
T1-16S User's Manual
Encode
Output
Operation
Device
Y
R
S
T.
C. XW YW RW SW T
RW06
D0010
Output
ERF
OFF
ON
OFF
Set
Register
C
D
I
RW05
26
6F3B0253
Constant Index
J
K
1 - 8
3 2 1 0
0 0 1 0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents