LGF_GetBitStates (FB / V1.0.0)


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

IdentifierData typeDefault valueDescription
valueDWord16#00000000Check input value for changes and edges

Output parameter

IdentifierData typeDescription
hasChangedBoolInput value has changed (compared to the previous cycle)
hasRisingEdgesBoolInput value has rising edges
risingBitsDWordBitstream with the rising edges
noOfRisingBitsUSIntNumber of rising edges in the input value
hasFallingEdgesBoolInput value has falling edges
fallingBitsDWordBitstream with the falling edges
noOfFallingBitsUSIntNumber of falling edges in the input value

Change log

Version & DateChange description
01.00.00Simatic Systems Support
2021.01.28First released version