GETBIT32

GETBIT32 1:

The function returns the status of the bit specified by a bit number in the 32 bit value that is passed to it as a boolean resulting value. The input value is not altered.

FUNCTION GETBIT32 : BOOL

GETBIT32 2: Inputs

VAR_INPUT
    inVal32 : DWORD;
    bitNo   : SINT;
END_VAR

Name

Type

Description

inVal32

DWORD

32-bit value

bitNo

SINT

Number of the bit to be read (0-31). This number is internally converted to a modulo 32 value prior to execution.

Sample of calling the function in FBD:

GETBIT32 3:

Here bit 2 in the input value "16#04" is queried and assigned to the boolean variable aGetBitResultVar. The query returns TRUE in this example.

Requirements

Development environment

Target system type

PLC libraries to include (Category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_System (System)