Omron CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 Reference Manual page 816

Programmable controllers
Hide thumbs Also See for CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009:
Table of Contents

Advertisement

Function
SDEC(078) regards the data specified by S as
4-digit hexadecimal data, converts the digits
specified in S by Di (first digit and number of
digits) to 7-segment data and outputs the
results to D in the bits specified in Di.
Precaution
• If more than one digit is specified for conversion in Di, digits are converted in order toward the most-
significant digit. Digit 0 is the next digit after digit 3.
• Results are stored in D in order from the specified portion toward higher-address words. If just one of
the bytes in a destination word receives converted data, the other byte is left unchanged.
Sample program
When CIO 0.00 turns ON in the following example, the contents of the 3 digits beginning with digit 1 in
D100 will be converted from hexadecimal data to 7-segment data, and the results will be output to the
upper byte of D200 and both bytes of D201. The specifications of the bytes to be converted and the
location of the output bytes are made in CIO 100.
0.00
Di
CS/CJ/NSJ Series Instructions Reference Manual (W474)
D100
100
Di: 100
D200
S: D100
D: D200
D201
Di
Number of digits
Rightmost 8 bits (0)
7-segment
3
Hexadecimal to 7-segment data conversion
(F
71, 1
06, and 2
3. Instructions
First digit to convert
5B)
779
3

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 and is the answer not in the manual?

Questions and answers

Table of Contents