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

Table of Contents

Advertisement

3. Instructions
Operand Specifications
Word addresses
Area
CIO
WR
HR
S
DI
OK
OK
OK
D
Flags
Name
Error Flag
Function
HEX(162) treats the contents of the source
word(s)
as
hexadecimal digits (0 to 9 and A to F), converts
the specified number of bytes to hexadecimal,
and writes the hexadecimal data to the
destination word beginning at the specified digit.
When converting data, the leftmost bit of the
ASCII code data can be treated as an odd or
even
parity
bit
specification.
Hint
• The parity bit is appended to the data to enable detection of errors when the data is transmitted. By
adding this bit, the number of bits that are 1 in the data can be indicated as odd or even, and if the
number of 1s in the received data is not similarly odd or even, it is assumed that an error has
occurred.
• With CS1-H/CJ1-H CPU Units with unit version 4.0 or later and CJ2 CPU Units, there are instructions
to convert ASCII to 4, 8, and 16 digits of numeric data (NUM4(517), NUM8(520), and NUM16(522)).
Precaution
• When multiple digits are specified in the number of digits to be converted (C), the digits are converted
in order from the starting conversion position (C) of S going to the left word side, and the conversion
results are stored in order from the output starting bit (C) of D going to the left (returns to digit 0 after
digit 3).
• Among the data in the conversion result output word, data of bits that are not to be output are held
(kept the same as before).
• The following table shows ASCII data which can be contained in the source word(s) (excluding parity
bits) and corresponding hexadecimal digits.
ASCII data (2 hexadecimal digits)
30 to 39
41 to 46
404
Indirect DM/EM
@DM
AR
T
C
DM
EM
@EM
OK
OK
OK
OK
OK
OK
Label
ER
• ON if there is a parity error in the ASCII data.
• ON if the ASCII data in the source words is not equivalent to hexadecimal digits
• ON if the content of Di is not within the specified ranges.
• OFF in all other cases.
ASCII
data
representing
according
to
the
Hexadecimal digits
0 to 9
A to F
Registers
addresses
Con-
stants
*DM
DR
*EM
---
---
OK
OK
OK
---
---
Operation
First byte to convert
Left (1)
Number of digits (n+1)
parity
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
---
Di
Right (0)
First digit to write
TR
bits
---

Advertisement

Table of Contents
loading

Table of Contents