3. Instructions
406
CS/CJ/NSJ Series Instructions Reference Manual (W474)
z Operand Specifications
Flags
Function
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.
Area
Word addresses
Indirect DM/EM
addresses
Con-
stants
Registers Flags
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
TK CF
S
OK OK OK OK OK OK OK OK OK OK
--- ---
--- OK --- --- --- ---DI OK OK
D --- ---
Name Label Operation
Error Flag 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.
HEX(162) treats the contents of the source
word(s) as ASCII data representing
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 according to the parity
specification.
ASCII data (2 hexadecimal digits) Hexadecimal digits
30 to 39 0 to 9
41 to 46 A to F
Number of digits (n+1)
Right (0)Left (1)
Di
First digit to write
First byte to convert