Enco (Encode) - IDEC MICROSmart FC6A Series Ladder Programming Manual

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

ENCO (Encode)

ENCO
Bits
*****
Valid Devices
Device
S1 (Source 1)
D1 (Destination 1)
Bits
For valid device address ranges, see "Device Addresses" on page 2-1.
Special internal relays cannot be designated as D1.
Make sure that the search area designated by S1 plus Bits is within the valid value range. If the source data exceeds the valid range, a user program
execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MICROSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
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.
Examples: ENCO
ENCO
64
M4
I0
M17
M37
M57
M77
M97
M117
ENCO
64
D10
I1
Bit
15
14
13
12
11
D10
D11
D12
D13
D14
D15
When input is on, a search begins for the first bit that is set to on. The search begins at S1 until
S1
D1
the first set (on) point is located. The number of points from S1 to the first set point (offset) is
*****
stored to the destination assigned by device D1.
If no point is on in the searched area, 65,535 is stored to D1.
Function
First bit to start search
Destination to store search results
Quantity of bits searched
When input I0 is on, a search begins for a bit that is set on in an array of 64 bits starting at
S1
D1
internal relay M4 assigned by device 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 assigned by device D1.
When input I1 is on, a search begins for a bit that is set on in an array of 64 bits starting at bit
0 of data register D10 assigned by device S1.
S1
D1
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 assigned by device D1.
10
9
8
7
6
5
4
FC6A S
MICROS
ERIES
I
Q
X
X
X
M0
M20
M40
M60
M80
M100
3
2
1
0
L
P
MART
ADDER
ROGRAMMING
10: D
C
ATA
ONVERSION
M
R
T
C
D
P
X
X
X
X
X
D100
20
ON
Searched area
24
D100
ON
Searched area
M
FC9Y-B1726
ANUAL
I
NSTRUCTIONS
Constant
Repeat
1-256
10-15

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents