IAND block

Short summary

Name

IAND

→POU type

→function

Category

IEC-block, BitstringEnh

Conform to →IEC-standard

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/add.svg not defined in IEC-standard

Graphical interface

images/download/thumbnails/414780747/IAND-version-1-modificationdate-1534860689274-api-v2.png

Available since

version 1.23.0 (for logi.CAD 3)

Functionality

The block returns the result of a bitwise AND operation of all values connected to the inputs of ANY_INT.

Compare: "AND block" for AND operation for values of ANY_BIT.

Inputs, return value


Identifier

→Data type

Description

Inputs:

IN1

USINT, UINT, UDINT, ULINT, SINT, INT, DINT or LINT(corresponds to →generic data type ANY_INT)

1st value

IN2

USINT, UINT, UDINT, ULINT, SINT, INT, DINT or LINT(corresponds to →generic data type ANY_INT)

2nd value

... (extensible until)

IN16

USINT, UINT, UDINT, ULINT, SINT, INT, DINT or LINT(corresponds to →generic data type ANY_INT)

16th value

Return value:

USINT, UINT, UDINT, ULINT, SINT, INT, DINT or LINT(corresponds to →generic data type ANY_INT)


Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Example for usage within ST-editor

PROGRAM Test
VAR
result1, result2, result3, result4 : INT;
END_VAR
result1 := IAND(IN1 := 2, IN2 := 2); (* The variable 'result1' evaluates to '2'. *)
result2 := IAND(IN1 := 2, IN2 := 5); (* The variable 'result2' evaluates to '0'. *)
result3 := IAND(IN1 := 3, IN2 := 9); (* The variable 'result3' evaluates to '1'. *)
result4 := IAND(IN1 := 5, IN2 := 5); (* The variable 'result4' evaluates to '5'. *)
END_PROGRAM

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.