AND_MASK (AND mask)
The AND_MASK instruction performs a bit to bit AND between two integer values.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
AND_MASK

Parameter | Parameter Type | Data Type | Description |
---|---|---|---|
EN | Input | BOOL | When set to true, the instruction is enabled.
|
IN | Input | DINT | Must have an integer format. |
MSK | Input | DINT | Must have an integer format. |
AND_MASK | Output | DINT | Bit-to-bit logical AND between IN and MSK. |
ENO | Output | BOOL | Enables output. Applies to ladder diagram programs. |
AND_MASK examples
AND_MASK function block diagram example

AND_MASK ladder diagram example

AND_MASK structured text example

(* ST Equivalence: *) parity := AND_MASK (xvalue, 1); (* 1 if xvalue is odd *) result := AND_MASK (16#abc, 16#f0f); (* equals 16#a0c *)
Results

Provide Feedback