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 #487 background imageLoading...
Page #487 background image
2-439
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Conversion Instructions
2
GrayToBin_** and BinToGray_**
The following example for the GrayToBin_BYTE instruction is for when In is BYTE#16#A5.
z BinToGray_**
The BinToGray_** instructions convert the bit string in data to convert In to a gray code. The conversion
procedure is as follows for when In and Out are BYTE data.
1
The most-significant bit (bit 7) of In is used as is as the most-significant bit (bit 7) of Out.
2
An exclusive logical OR is taken of the value of bit 7 in In and the value of bit 6 in In. The result
is used as bit 6 of Out.
3
This process is repeated through the least-significant bit (bit 0) of Out.
The following example for the BinToGray_BYTE instruction is for when In is BYTE#16#C6.
The name of the instruction is determined by the data types of In and Out. For example, if In and Out
are the WORD data type, the instruction is GrayToBin_WORD or BinToGray_WORD.
abc:=GrayToBin_BYTE(BYTE#16#A5);
LD ST
abc
BYTE#16#A5
GrayToBin_BYTE
EN ENO
In
XOR XOR XOR XOR XOR XOR
Bit 0
Most-significant
bit
In
1 0 1 0 0 1 0 1
1 1 0 0 0 1 1 0
Out = abc
XOR
abc:=BinToGray_BYTE(BYTE#16#C6);
LD ST
abc
BYTE#16#C6
BinToGray_BYTE
EN ENO
In
In
1 1 0 0 0 1 1 0
Out = abc
XOR
1 0 1 0 0 1 0 1
XOR XOR XOR XOR XOR XOR
Bit 0
Most-significant
bit

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