and_mask

PLCopen motion icon

 Function - Performs a bit-to-bit Boolean AND between two integer values.

Inputs

Input

Data Type

Range

Unit

Default

Description

IN

ANY

 

 

 

First input.

MSK

ANY

 

 

 

Second input. (AND mask)

Outputs

Output

Data Type

Range

Unit

Description

Q

ANY

 

 

AND mask between IN and MSK inputs.

Remarks

  • Arguments can be signed or unsigned integers from 8- to 32-bits.

FBD Language Example

FFLD Language Example

  • In the FFLD Language, the input rung (EN) enables the operation.
    • The output rung (ENO) keeps the same value as the input rung.
    • The function is executed only if EN is TRUE.
    • ENO is equal to EN.

IL Language Example

  • In the IL Language, the first parameter (IN) must be loaded in the current result before calling the function.
    • The other input is the operands of the function.
Op1: LD       IN
     AND_MASK MSK
     ST       Q

ST Language Example

Q := AND_MASK (IN, MSK);

See Also