EasyManuals Logo

IDEC OpenNet series User Manual

IDEC OpenNet series
427 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #196 background imageLoading...
Page #196 background image
13: BIT SHIFT / ROTATE INSTRUCTIONS
OPENNET CONTROLLER USERS MANUAL 13-13
BCDLS (BCD Left Shift)
Valid Operands
For the valid operand number range, see page 6-2.
The quantity of digits to shift can be 1 through 7 for the double-word data type.
Make sure that the source data determined by S1 and S1+1 is between 0 and 9999 for each data register or link register. If
either source data is over 9999, a user program execution error will result, turning on special internal relay M8004 and the
ERROR LED.
Valid Data Types
When a word operand such as D (data register) or L (link register) is designated as the source, 2 points (double-word type)
are used.
Example: BCDLS
Operand Function I Q M R T C D L Constant Repeat
S1 (Source 1) Data for BCD shift —————— XX ——
digits Quantity of digits to shift ———————— 1-7
W (word) I (integer) D (double word) L (long)
—— X
When input is on, the 32-bit binary data designated by S1 is converted into 8
BCD digits, shifted to the left by the quantity of digits designated by operand
digits, and converted 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.
BCDLS(D) S1
*****
Before shift:
After shift:
0 2 31
MSD
S1 S1+1
Shift to the left
LSD
digits
*
4 6 75 0
1 3 42 5 7 060
• Data Type: Double Word (digits to shift = 1)
0
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 digits, and converted back to
32-bit binary data.
Zeros are set to the lowest digits as many as the digits shifted.
Before shift:
After first shift:
0 2 31
D10 D11
Shift to the left
4 6 75 0
1 3 42 5 7 060
REP
SOTU
I0
S1
4567
D1
D11
S1
D10
digits
1
BCDLS(D)
MOV(W)
M8120
REPS1
123
D1
D10
MOV(W)
After second shift:
MSD LSD
2 4 53 6 0 071
0
• Data Type: Double Word (digits to shift = 1)
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: info@clrwtr.com

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IDEC OpenNet series and is the answer not in the manual?

IDEC OpenNet series Specifications

General IconGeneral
BrandIDEC
ModelOpenNet series
CategoryController
LanguageEnglish

Related product manuals