Publication 1766-RM001A-EN-P - October 2008
Number Systems
665
Hex Mask
This is a 4-character code, entered as a parameter in SQO, SQC, and other
instructions to exclude selected bits of a word from being operated on by
the instruction. The hexadecimal values are used in their binary
equivalent form, as indicated in the figure below. The figure also shows
an example of a hexadecimal code and the corresponding mask word.
Bits of the mask word that are set (1) will pass data from a source to a
destination. Reset bits (0) will not. In the example below, data in bits 0-7
of the source word is passed to the destination word. Data in bits 8-15 of
the source word is not passed to the destination word.
Source Word
1 1 1 0
1 0 0 1
1 1 0 0
1 0 1 0
Mask Word
0 0 0 0
0 0 0 0
1 1 1 1
1 1 1 1
Destination Word
0 0 0 0
0 0 0 0
1 1 0 0
1 0 1 0
(all bits 0 initially)
Hex Code
0 0 F F
0 0 0 0
0 0 0 0
1 1 1 1
1 1 1 1
Mask Word
Hex
Value
Binary
Value
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1400
1101
1110
1111
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive