Omron CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 Reference Manual page 436

Programmable controllers
Hide thumbs Also See for CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009:
Table of Contents

Advertisement

Sample program
When CIO 0.00 is ON in the following example, HEX(162) converts the ASCII data in D100 and D101
according to the settings of the digit designator. (Di=#0121 specifies no parity, the starting byte (when
reading) = leftmost byte, the number of bytes to read = 3, and the starting digit (when writing) = digit 1.)
HEX(162) converts three bytes of ASCII data (3 characters) beginning with the leftmost byte of D100
into their hexadecimal equivalents and writes this data to D200 beginning with digit 1.
0.00
S
Di
D
S: D100
D101
Di: D200
Parity
It is possible to specify the parity of the ASCII data for use in error control during data transmissions.
The leftmost bit in each byte is the parity bit. With no parity the parity bit should always be zero, with
even parity the status of the parity bit should result in an even number of ON bits, and with odd parity
the status of the parity bit should result in an odd number of ON bits.
The following table shows the operation of HEX(162) for each parity setting.
Parity setting
(leftmost digit of Di)
No parity (0)
Even parity (1)
Odd parity (2)
CS/CJ/NSJ Series Instructions Reference Manual (W474)
D100
Di: #
D200
Starting byte
(leftmost byte)
Number of digits
Starting digit (digit 1)
3 digits
HEX(162) will be executed only when the parity bit in each byte is 0. An error will occur if a parity bit is non-zero.
HEX(162) will be executed only when there is an even number of ON bits in each byte. An error will occur if a byte has an
odd number of ON bits.
HEX(162) will be executed only when there is an odd number of ON bits in each byte. An error will occur if a byte has an
even number of ON bits.
Operation of HEX(162)
3. Instructions
3
399

Advertisement

Table of Contents
loading

Table of Contents