10 l_tbgetbitofdword, Function library lenzeplctoolbox.lib, Functions/function blocks – Lenze DDS Function library PLCToolBox User Manual
Page 18
![background image](/manuals/566055/18/background.png)
Function library LenzePLCToolBox.lib
Functions/function blocks
2.10
L_TBGetBitOfDword
2−10
L
LenzePLCToolBox.lib EN 1.5
2.10
L_TBGetBitOfDword
BOOL L_TBGetBitOfDword (dwInput, byBitNr)
This function returns the state of a single bit within a "double word" value.
L_TBGetBitOfDword
0
31
dwInput
byBitNr
0...31
state?
FALSE/TRUE
Transfer parameters
Identifiers
Data type
Info/possible settings
dwInput
Double word
Value
byBitNr
Byte
No. (0 ... 31) of the bit of dwInput whose state is to be determined.
Return value: Bool
Value
Meaning
FALSE/TRUE
State of bit byBitNr of dwInput.
Example
Calling the function in ST:
dwValue := 105
(* dwValue = 105 dec = 00000000 00000000 00000000 01101001 bin *)
bBit0 := L_TBGetBitOfDword(dwValue, 0); (* bBit0 = TRUE *)
bBit1 := L_TBGetBitOfDword(dwValue, 1); (* bBit1 = FALSE *)
bBit2 := L_TBGetBitOfDword(dwValue, 2); (* bBit2 = FALSE *)