Enco (Encode) - IDEC FC4A-C10R2 User Manual

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

ENCO (Encode)

ENCO
Bits
*****
Applicable CPU Modules
FC4A-C10R2/C
FC4A-C16R2/C
Valid Operands
Operand
S1 (Source 1)
D1 (Destination 1)
Bits
For the valid operand number range, see pages 6-1 and 6-2.
Internal relays M0 through M1277 can be designated as D1. Special internal relays cannot be designated as D1.
Valid values for Bits to designate the quantity of bits searched are 1 through 256. Make sure that the search area designated
by S1 plus Bits is within the valid value range. If the source data is out of the valid range, a user program execution error
will result, turning on special internal relay M8004 and the ERR LED.
Since the ENCO instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction
should be used as required.
Examples: ENCO
ENCO
64
M4
I0
M17
M37
M57
M77
M97
M117
ENCO
64
D10
I1
Bit
15 14 13 12 11 10
D10
D11
D12
D13
D14
D15
When input is on, a bit which is on is sought. The search begins at S1 until the
S1
D1
first point which is set (on) is located. The quantity of points from S1 to the first
*****
set point (offset) is stored to the destination designated by operand D1.
If no point is on in the searched area, 65535 is stored to D1.
FC4A-C24R2/C
Function
First bit to start search
Destination to store search results
Quantity of bits searched
When input I0 is on, a bit which is on is sought in 64 bits starting at internal
S1
D1
relay M4 designated by operand S1.
D100
Since internal relay M30 is the first point that is on, the offset from the first
search point is 20, and 20 is stored to data register D100 designated by oper-
and D1.
When input I1 is on, a bit which is on is sought in 64 bits starting at bit 0 of data
S1
D1
register D10 designated by operand S1.
D100
Since bit 8 of data register D11 is the first point that is on, the offset from the
first search point is 24, and 24 is stored to data register D100 designated by
operand D1.
9
8
7
6
5
« FC4A M
FC4A-D20K3/S3
I
X
— — — — — — —
M0
M20
M40
M60
M80
M100
4
3
2
1
0
S
U
'
M
ICRO
MART
SER
S
ANUAL
14: D
C
ATA
ONVERSION
FC4A-D20RK1/RS1 & FC4A-D40K3/S3
X
Q
M
R
T
C
D
X
X
X
— —
X
X
X
— —
X
D100
24
D100
ON
Searched area
»
I
NSTRUCTIONS
Constant
Repeat
1-256
20
ON
Searched area
14-11

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents