2 l_tbconvbitstobyte, L_tbconvbitstobyte, Function library lenzeplctoolbox.lib – Lenze DDS Function library PLCToolBox User Manual

Page 10: Functions/function blocks

Advertising
background image

Function library LenzePLCToolBox.lib

Functions/function blocks

2.2

L_TBConvBitsToByte

2−2

L

LenzePLCToolBox.lib EN 1.5

2.2

L_TBConvBitsToByte

BYTE L_TBConvBitsToByte (bBit0, bBit1, bBit2, bBit3,
bBit4, bBit5, bBit6, bBit7)

This function converts 8 single bit values into a value of type "byte".

L_TBConvBitsToByte

bBit0
bBit1
bBit2

bBit7

Byte (8 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

)

...

...

...

bBit7

Bool

Bit 7 (valency: 2

7

)

Return value: Byte

Value

Meaning

0 ... 255

Value of type byte" corresponding to the transmitted bit values.

Example

Calling the function in ST:

byResult := L_TBConvBitsToByte(0, 1, 1, 0, 1, 0, 0, 1);

(* byResult = 150 *)

Advertising