EasyManua.ls Logo

Omron CJ - INSTRUCTIONS

Omron CJ - INSTRUCTIONS
1308 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
Loading...
425
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Conversion Instructions
3
GRY
Function
GRY(474) converts the gray binary code in the word specified in S at the resolution specified in C using
one of the following conversion modes (binary, BCD, or 360
°), also specified in C, and places the results
in D and D+1.
Hint
GRY(474) is normally used when inputting, through a DC Input Unit, a parallel signal (2n) from an
absolute encoder that outputs a gray binary code.
Note If the word specified for S is allocated to an Input Unit, the input data converted by GRY(474) will be for the
gray binary code from the previous CPU Unit cycle, i.e., it will be one cycle time old.
Example Programming
Example 1:
Converting to Binary Data with an 8-bit Resolution and Zero Point Offset of 001A Hex
Conversion mode Function
Binary Mode Gray binary code is converted to binary data between 0000 0000 and 0000 7FFF hex. Zero point offset and
remainder compensation is applied and then the result is output to D and D+1.
BCD Mode Gray binary code is converted to BCD data. Zero point offset and remainder compensation is applied, the data is
converted to BCD between 0000 0000 and 0003 2767, and then the result is output to D and D+1.
360
° Mode
Gray binary code is converted to BCD data. Zero point offset and remainder compensation is applied, the data is
converted to an angle between 0000 0000 and 0000 3599 (0.0
° to 359.9° in 0.1° increments), and then the result is
output to D and D+1.
When CIO 0.00 is ON in the following
example, the gray binary code in CIO 10 is
converted according to the settings in the
control data in D0 to D2 and the result is
output to D200 and D201.
GRY
10
D0
D200
0.00
C
S
D
0 0
C: D0
0
80
4 3 7 8111215
001A
C+1: D1
S: 10 1001010000000000
0017
D: D200
0000
D+1: D201
000
C+2: D2
0
Operating mode: Gray binary code conversion
Conversion mode: Binary Mode
Resolution: 8-bit
Zero point offset: 001A hex
User-specified resolution: Not used.
Gray binary code
Converted and offset.
Result of binary conversion and offsetting stored.

Table of Contents

Related product manuals