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

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
ASC(086) treats the contents of S as 4
hexadecimal digits, converts the designated
digit(s) of S into their 8-bit ASCII equivalents,
and writes this data into the destination word(s)
beginning with the specified byte in D.
A parity specification (bits 12 to 15 of K) is
possible in the leftmost bit of the ASCII code
data, and this can be converted to an odd or
even parity bit (the number of bits that are 1 of
the eight bits is adjusted to odd or even).
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 4, 8, and 16 digits of numeric data to ASCII (STR4(524), STR8(527), and STR16(528)).
Precaution
• When multiple digits are specified in the number of digits to be converted (K), the digits are converted
in order from the starting conversion digit going left (returns to digit 0 after digit 3), and the conversion
results are stored in order from the output position of D going to the left word side (in units of 8 bits).
• Among the data in the conversion result output word, data in positions that are not to be output are
held.
• When converting multiple digits, take care that D+2 and D+2CH do not exceed the area.
400
Indirect DM/EM
@DM
AR
T
C
DM
EM
@EM
OK
OK
OK
OK
OK
OK
Label
ER
• ON if the content of Di is not within the specified ranges.
• OFF in all other cases.
Registers
addresses
Con-
stants
*DM
DR
*EM
---
OK
OK
OK
---
---
Operation
First digit to convert
Number of
digits (n+1)
Left (1)
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
---
Di
Right (0)
TR
bits
---

Advertisement

Table of Contents
loading

Table of Contents