Masked equal MASKED EQU
Passes power while the masked bits of Source and Compare match.
MASKED_EQUAL
SourceGlobal.Inputs13MaskGlobal.Mask15CmpGlobal.Pattern13
| Tag | After two scans |
|---|---|
| Inputs | 13 |
| Mask | 15 |
| Pattern | 13 |
How it works
Passes power while the bits picked by Mask are the same in Source and Compare. Bits outside Mask are ignored.
How it's used
Use it to check several bits of a word at once, such as a set of door switches.
MASKED_EQUAL
SourceGlobal.Doors15MaskGlobal.Mask7CmpGlobal.AllShut7
Global.DoorsOKOTE
| Tag | Value |
|---|---|
| Doors | 15 |
| Mask | 7 |
| AllShut | 7 |
| DoorsOK | 1 |
The three bits in Mask are all on, so DoorsOK is on. Other bits are ignored.
Operands
| Operand | Data type | Read or write |
|---|---|---|
| Source | DINT or a number | Reads |
| Mask | DINT or a number | Reads |
| Compare | DINT or a number | Reads |
Common mistakes
- Using a Mask of 0A Mask of 0 checks no bits, so it always passes.