Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 822

Table of Contents

Advertisement

3. Instructions
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.
Example Programming
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
786
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
CS/CJ/NSJ Series Instructions Reference Manual (W474)
First digit to convert
5B)

Advertisement

Table of Contents
loading

Table of Contents