# LGF_GetBitStates (FB / 1.0.0)

Overview

Author: Siemens Simatic Systems Support

## Short description

This function checks a DWord for falling as well as rising edges.
It returns the number of edges, a DWord with the edge bits, and a boolean value if edge(s) are present.

### Block Interface

| LGF_GetBitStates (FB) |
--- | --- | ---
DWord |  |  | value |  | hasChanged |  |  | Bool
|  |  |  |  | hasRisingEdges |  |  | Bool
|  |  |  |  | risingBits |  |  | DWord
|  |  |  |  | noOfRisingBits |  |  | USInt
|  |  |  |  | hasFallingEdges |  |  | Bool
|  |  |  |  | fallingBits |  |  | DWord
|  |  |  |  | noOfFallingBits |  |  | USInt

### Input parameter

Identifier | Data type | Default value | Description
--- | --- | --- | ---
value | DWord | 16#00000000 | Check input value for changes and edges

### Output parameter

Identifier | Data type | Description
--- | --- | ---
hasChanged | Bool | Input value has changed (compared to the previous cycle)
hasRisingEdges | Bool | Input value has rising edges
risingBits | DWord | Bitstream with the rising edges
noOfRisingBits | USInt | Number of rising edges in the input value
hasFallingEdges | Bool | Input value has falling edges
fallingBits | DWord | Bitstream with the falling edges
noOfFallingBits | USInt | Number of falling edges in the input value

## Change log

Version & Date | Change description
--- | ---
| 1.0.0 | Simatic Systems Support
| 2021.01.28 | First released version