Bit Manipulation FUs/FBs

The blocks contained in the <Bit_Util> library can be used to edit bit stream data types on bit level.

NOTE:

Term definition: Standard = non-safety-related

The term "standard" always refers to non-safety-related items. Examples: a standard process data item is only read/written by a non-safety-related I/O device (i.e., a standard device). Standard variables/functions/FBs are non-safety-related data. The term "standard controller" designates the non-safety-related controller.

NOTE:

The Bit Utility library provides safety-related and standard blocks. Note that standard functions/function blocks are only allowed for programming standard program parts. When programming a safety-related application, a strict separation between safety-related and standard logic (networks) is required.

Available bit manipulation functions

Function

Description

Reads the value of a particular bit in a bit string

Reads the value of the LSB of a bit string

Reads the value of the MSB of a bit string

Inverts a particular bit in a bit string

Resets a particular bit in a bit string to FALSE

Sets a particular bit in a bit string to TRUE

Writes a given value to the LSB of a bit string

Writes a given value to the MSB of a bit string

Interchanges LSB and MSB of a bit string

Available bit manipulation function blocks

Function block

Description

Assembling / splitting FBs for BOOL/BYTE/WORD/DWORD data types