Omron SYSMAC CP Series Instruction & Reference Manual page 243

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
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
HEX
S
D100
Di
#0121
D
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)
CP1E CPU Unit Instructions Reference Manual(W483)
Starting byte
(leftmost byte)
15
8
S:D100
33
D101
35
Number of digits
3 digits
3
2
15
12 11
8
Di:D200
5
4
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.
15
12 11
8
7
Di:#
0
1
2
7
0
34
Starting digit (digit 1)
1
0
7
4
3
0
3
Operation of HEX(162)
2 Instructions
4
3
0
1
2-207
2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents