Table of Contents

Advertisement

HEX

Instruction
ASCII TO HEX
Symbol
Applicable Program Areas
Function block
Area
definitions
Usage
OK
Operands
Operand
S
First source word
DI
Digit designator
D
Destination word
S: First Source Word
15
8
S
Leftmost byte
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.
DI: Digit Designator
The digit designator specifies various parameters for the conversion, as shown in the following dia-
gram.
Digit number:
3 2 1 0
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Mnemonic
Variations
HEX
@HEX
Block program areas
Step program areas
OK
OK
Description
7
0
Rightmost byte
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
First byte of S to be converted.
0: Rightmost byte
1: Leftmost byte
Parity
0: None
1: Even
2: Odd
Function
code
Converts up to 4 bytes of ASCII data in the source
162
word to their hexadecimal equivalents and writes
these digits in the specified destination word.
HEX
HEX(162)
S: First source word
S
DI: Digit designator
DI
D: Destination word
D
Subroutines
Interrupt tasks
OK
Data type
UINT
UINT
UINT
D: Destination Word
15
12
11
8
D
Digit 3
Digit 2
The results of conversion to hex are stored
from the starting digit going left (returns to
digit 0 after digit 3)
3. Instructions
Function
SFC action or
transition programs
OK
OK
Size
Variable
1
1
7
4
3
0
Digit 1
Digit 0
405
3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents