Lenze DDS Function library PLCToolBox Uživatelský manuál Strana 17

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 26
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 16
Function library LenzePLCToolBox.lib
Functions/function blocks
2.9 L_TBGetBitOfByte
2−9
L LenzePLCToolBox.lib EN 1.5
2.9 L_TBGetBitOfByte
BOOL L_TBGetBitOfByte (byInput, byBitNr)
This function returns the state of a single bit within a "byte" value.
L_TBGetBitOfByte
0
7
byInput
byBitNr
0...7
state?
FALSE/TRUE
Transfer parameters
Identifiers Data type Info/possible settings
byInput Byte Value
byBitNr Byte No. (0 ... 7) of the bit of byInput whose state is to be determined.
Return value: Bool
Value Meaning
FALSE/TRUE State of bit byBitNr of byInput.
Example
Calling the function in ST:
byValue := 105 (* byValue = 105 dec = 01101001 bin *)
bBit0 := L_TBGetBitOfByte(byValue, 0); (* bBit0 = TRUE *)
bBit1 := L_TBGetBitOfByte(byValue, 1); (* bBit1 = FALSE *)
bBit2 := L_TBGetBitOfByte(byValue, 2); (* bBit2 = FALSE *)
Zobrazit stránku 16
1 2 ... 12 13 14 15 16 17 18 19 20 21 22 ... 25 26

Komentáře k této Příručce

Žádné komentáře