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 #413 background imageLoading...
Page #413 background image
2-365
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Shift Instructions
2
ROL and ROR
The following example is for when In is BYTE#16#89 and Num is USINT#2.
z ROR
The ROR instruction rotates bits from left to right (from most-significant to least-significant bits).
The following example shows the ROR instruction when In is BYTE#16#89 and Num is USINT#2.
The SHL and SHR instructions discard the bits that are shifted out of the register and insert zeros 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 bits will
be rotated by the number of bits specified in Num. For example, if In is WORD data, the value of Out
will be the same regardless of whether the value of Num is USINT#1 or USINT#17.
Additional Information
Precautions for Correct Use
abc:=ROL(BYTE#16#89, USINT#2);
LD ST
abc
USINT#2
BYTE#16#89
ROL
EN ENO
In
Num
Shifted 2 bits left.
Most-significant 2 bits of
In are inserted into least-significant 2 bits.
1 0 0 0 1 0 0 1
In
0 0 1 0 0 1 1 0
Out=abc
Bit 7
Bit 0
abc:=ROR(BYTE#16#89, USINT#2);
LD ST
abc
USINT#2
BYTE#16#89
ROR
EN ENO
In
Num
Shifted 2 bits right.
Least-significant 2 bits of In are inserted into most-significant 2 bits.
1 0 0 0 1 0 0 1
In
0 1 1 0 0 0 1 0
Out=abc
Bit 0Bit 7

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