EasyManuals Logo

Omron NJ501-1500 User Manual

Omron NJ501-1500
990 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 #409 background imageLoading...
Page #409 background image
2-361
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Shift Instructions
2
SHL and SHR
The following example if for when In is BYTE#16#89 and Num is USINT#2.
z SHR
The SHR instruction shifts bits from left to right (from most-significant to least-significant bits).
The following example shows the SHR instruction when In is BYTE#16#89 and Num is USINT#2.
The ROL and ROR instructions insert the bits that are shifted out of the register into the other end of the
register.
• The data types of In and Out must be the same.
• If Num is 0, an error will not occur and the value of In will be assigned directly to Out.
• If the value of Num exceeds the number of bits specified in In, an error will not occur and the value of
Out will be 16#0.
Additional Information
Precautions for Correct Use
abc:=SHL(BYTE#16#89, USINT#2);
LD ST
BYTE#16#89
abc
USINT#2
SHL
EN ENO
In
Num
Shifted 2 bits left.
Zeros inserted to lower 2 bits.
1 0 0 0 1 0 0 1
In
0 0 1 0 0 1 0 0
Out=abc
Bit 7
Bit 0
abc:=SHR(BYTE#16#89, USINT#2);
LD ST
BYTE#16#89
abc
USINT#2
SHR
EN ENO
In
Num
Shifted 2 bits right.
Zeros inserted to upper 2 bits.
1 0 0 0 1 0 0 1
In
0 0 1 0 0 0 1 0
Out=abc
Bit 7
Bit 0

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NJ501-1500 and is the answer not in the manual?

Omron NJ501-1500 Specifications

General IconGeneral
BrandOmron
ModelNJ501-1500
CategoryController
LanguageEnglish

Related product manuals