8.2.1.7 Bit Pattern Base Conditions
The Bit Pattern conditions have the parameter Bit Pattern. The condition performs a bitwise comparison of the configured value against a single or multiple defined bit pattern value.
A bit pattern value is defined in two different ways, they are as follows:
- By a value with corresponding bit mask. The mask makes it possible to define exactly which bits that should be compared with the configured value.
- By a range of values.
The user can add, edit, and delete bit pattern values, see Figure 142. The value is defined by typing in the decimal value or by setting the bits manually.
By checking the Define a range check box, it is possible to define the bit pattern value as a range, see Figure 143.
- Note:
- The bit pattern values are always treated unsigned.
The following are examples of the use of the bit pattern condition.
- A single Short Bit pattern is defined as a value and a mask. The decimal value is written within the parenthesis:
Bit pattern value: 00000000.11000011 (195)
Bit pattern mask: 00000000.11111111 (255)
- Input value:
Binary: 00001100.11000011 (3267)
- The input value is masked with the Bit pattern mask.
Input value: 00001100.11000011 (3267)
Mask: 00000000.11111111 (255)
Masked result: 00000000.11000011 (195)
- The result is matched against the Bit pattern value:
Masked result: 00000000.11000011 (195)
Bit pattern value: 00000000.11000011 (195)
- Since the values match the condition returns TRUE.
In another example, a single Short range is defined with a start and an end value.
- Range values: Start value: 00000000.00001000 (8)
End value: 00000000.00001111 (15)
- Input value: Binary: 00000000.00011000 (24)
- The input value is matched against the defined range Start value <= Input value <= End value: 8 <= 24 <= 15
- Since the input value is greater than the defined end value, the condition returns FALSE.

