4 l_tbconvbitstoword, L_tbconvbitstoword, Function library lenzeplctoolbox.lib – Lenze DDS Function library PLCToolBox User Manual
Page 12: Functions/function blocks
![background image](/manuals/566055/12/background.png)
Function library LenzePLCToolBox.lib
Functions/function blocks
2.4
L_TBConvBitsToWord
2−4
L
LenzePLCToolBox.lib EN 1.5
2.4
L_TBConvBitsToWord
WORD L_TBConvBitsToWord (bBit0, bBit1, bBit2, bBit3,
bBit4, bBit5, bBit6, bBit7,
bBit8, bBit9, bBit10, bBit11,
bBit12, bBit13, bBit14, bBit15)
This function converts 16 single bit values into a value of type "word".
L_TBConvBitsToWord
bBit0
bBit1
bBit2
bBit15
Word (16 bits)
Transfer parameters
Identifiers
Data type
Info/possible settings
bBit0
Bool
Bit 0 (valency: 2
0
)
bBit1
Bool
Bit 1 (valency: 2
1
)
bBit2
Bool
Bit 2 (valency: 2
2
)
...
...
...
bBit15
Bool
Bit 15 (valency: 2
15
)
Return value: Word
Value
Meaning
0 ... 65535
Value of type word" corresponding to the transmitted bit values.
Example
Calling the function in ST:
wResult := L_TBConvBitsToWord(0, 1, 1, 0, 1, 0, 0, 1,
1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0);
(* dwResult = 406 *)