Bcdls (Bcd Left Shift) - IDEC FC4A-C10R2 User Manual

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

13: S
/ R
HIFT
OTATE

BCDLS (BCD Left Shift)

BCDLS
*****
When S2 = 1 (
digits to shift)
Applicable CPU Modules
FC4A-C10R2/C
FC4A-C16R2/C
Valid Operands
Operand
S1 (Source 1)
S2 (Source 2)
For the valid operand number range, see pages 6-1 and 6-2.
When T (timer) or C (counter) is used as S2, the timer/counter current value is read out.
The quantity of digits to shift designated as S2 can be 1 through 7.
Make sure that the source data determined by S1 and S1+1 is between 0 and 9999 for each data register. If either source
data is over 9999, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on
the CPU module. When S2 is over 7, a user program execution error will also result.
Example: BCDLS
MOV(W)
S1 –
123
M8120
MOV(W)
S1 –
4567
BCDLS
SOTU
I0
digits to shift)
When S2 = 1 (
13-4
I
NSTRUCTIONS
When input is on, the 32-bit binary data designated by S1 is converted into 8
S1
S2
BCD digits, shifted to the left by the quantity of digits designated by S2, and con-
*
verted back to 32-bit binary data.
Valid values for each of S1 and S1+1 are 0 through 9999.
The quantity of digits to shift can be 1 through 7.
Zeros are set to the lowest digits as many as the digits shifted.
Before shift:
After shift:
FC4A-C24R2/C
Function
Data for BCD shift
Quantity of digits to shift
D1 –
REP
D10
D1 –
REP
D11
S1
S2
D10
1
Before shift:
After first shift:
After second shift:
« FC4A M
S1
0
1
2 3
0
1
2
3 4
MSD
FC4A-D20K3/S3
I
— — — — — —
X
M8120 is the initialize pulse special internal relay.
When the CPU starts operation, the MOV (move) instructions set 123 and
4567 to data registers D10 and D11, respectively.
Each time input I0 is turned on, the 32-bit binary data of data registers
D10 and D11 designated by S1 is converted into 8 BCD digits, shifted to
the left by 1 digit as designated by operand S2, and converted back to 32-
bit binary data.
Zeros are set to the lowest digits as many as the digits shifted.
D10
0
1
2 3
0
1
2
3 4
1
2
3
4 5
MSD
S
U
'
M
ICRO
MART
SER
S
ANUAL
S1+1
4
5
6 7
Shift to the left
5
6
7 0
LSD
FC4A-D20RK1/RS1 & FC4A-D40K3/S3
X
Q
M
R
T
C
D
X
X
X
X
X
X
X
D11
4
5
6 7
Shift to the left
5
6
7 0
6
7
0 0
LSD
»
0
0
Constant
Repeat
1-7
0
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents