Download Lucent Technologies Release 7 Security Camera User Manual
Transcript
Chapter 5 Instruction Specifications
Name
Application instructions-21
Ladder format
Encode
Condition code
Processing time (µs)
R7F4
R7F3
R7F2
R7F1
R7F0
DER
ERR
SD
V
C
↕
z
z
z
↕
ENCO (d, s, n)
Instruction format
Number of steps
Condition
As per the table
below.
Steps
4
Usable I/O
X
d
Decode destination head I/O
s
Word I/O to be encoded
n
Number of bits to be
encoded
Y
Bit
R,
TD, SS,
M
CU, CT
Word
WR,
Double word
DR,
WX WY WM TC DX DY DM
{
Other
{
{
{
1 to 8 (decimal)
Function
•
•
•
•
Encodes the bit location 2n in the range between s and s + 2n – 1 where the bit is “1,” and outputs the result to d (n = 1 to 8).
Upper bits (16-n) of d are set to “0.”
If n is “0,” the instruction will not be executed and the contents of d retain the original values.
If there are more than one bits that are set to “1” between s and s + 2n – 1, the upper bit location will be encoded.
If all the bits from s to s + 2n – 1 are '0', '0' is output to d, and C (R7F0) is equal to '1.' In other cases, C (R7F0) is set to '0.'
n
s+2 -1
s+B
0
1
s
0
0
b15
b7
b0
0BH
d
n
n bits (1 to 8)
2
Notes
•
•
Use this instruction so that s + 2n− 1 does not exceed the I/O range (R7BF and M3FFF). If it exceeds the I/O range, DER is
set to '1' and the encoding is performed at the maximum range starting from s.
Use 1 to 8 for n.
Program example
X00001 DIF1
ENCO (WR0000, R000, 4)
LD
X00001
AND DIF1
[
ENCO (WR0000, R000, 4)
]
Program description
•
Upon the leading of X00001, the most significant bit that is set to “1” is detected within the row of bits R000 to R00F (24 –1
= 15 bits), and a four-bit binary number is set in the word I/O of d.
Example) If “1” is set in the 7th and 6th bits of R000 to R00F, H0007 is set in WR0000.
n
1
2
3
4
5
6
7
8
Processing time (µs)
Average
Maximum
128
–
128
–
128
–
187
–
126
–
126
–
126
–
126
–
5-93
ENCO (d, s, n)
ENCO (d, s, n)
Remark
Average Maximum
Constant
Item number