beautypg.com

Applicable program areas operands, 2 instructions, Di: digit designator – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 241: S: first source word d: destination word

background image

2-205

2 Instructions

CP1E CPU Unit Instructions Reference Manual(W483)

Con

v

e

rs

ion I

n

stru

ctio

ns

2

HEX

HEX

Applicable Program Areas

Operands

DI: Digit Designator

The digit designator specifies various parameters for the conversion, as shown in the following dia-
gram.

Instruction

Mnemonic

Variations

Function

code

Function

ASCII TO HEX

HEX

@HEX

162

Converts up to 4 bytes of ASCII data in the source
word to their hexadecimal equivalents and writes
these digits in the specified destination word.

Symbol

HEX

Area

Step program areas

Subroutines

Interrupt tasks

Usage

OK

OK

OK

Operand

Description

Data type

Size

S

First source word

UINT

Variable

DI

Digit designator

UINT

1

D

Destination word

UINT

1

S: First Source Word

D: Destination Word

S: First source word

DI: Digit designator

D: Destination word

HEX(162)

S

DI

D

S

8

15

Leftmost byte

Rightmost byte

0

7

The conversion start byte and bytes to the left are
treated as ASCII code and converted to hex (returns
to the rightmost byte after the leftmost byte.

D

Digit 3

Digit 2

8

11

12

15

Digit 1

Digit 0

0

3

4

7

The results of conversion to hex are stored
from the starting digit going left (returns to
digit 0 after digit 3)

Digit number: 3 2 1 0

Specifies the first digit in D to receive converted data (0 to 3).

Number of bytes to be converted (0 to 3)

0: 1 digit
1: 2 digits
2: 3 digits
3: 4 digits

0: Rightmost byte
1: Leftmost byte

Parity

0: None
1: Even
2: Odd

First byte of S to be converted.

This manual is related to the following products: