Bit masking
This library provides various functions for bit masking.
- TB_A_BOOL_TO_DWORD
- TB_A_BOOL_TO_DWORD
- TB_BITS_OF_BYTE
- TB_BITS_OF_BYTE
- TB_BITS_OF_DWORD
- TB_BITS_OF_DWORD
- TB_BITS_OF_WORD
- TB_BITS_OF_WORD
- TB_BITS_TO_BYTE
- TB_BITS_TO_BYTE
- TB_BITS_TO_DWORD
- TB_BITS_TO_DWORD
- TB_BITS_TO_WORD
- TB_BITS_TO_WORD
- TB_DWORD_TO_A_BOOL
- TB_DWORD_TO_A_BOOL
- TB_FIRST_S_BIT_OF_DWORD
- TB_FIRST_S_BIT_OF_DWORD
- TB_LAST_S_BIT_OF_DWORD
- TB_LAST_S_BIT_OF_DWORD
TB_A_BOOL_TO_DWORD
With this function block, a DWORD is composed of 32 individual BOOLs
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: BM_TYPES_40bd04 or higher
Eingänge
| none |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| dw_OUT | DWORD | Compound data word |
Ein-/Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| a_BOOL32 | ARRAY_32_BOOL | Array with 32 elements of the type Bool |

TB_A_BOOL_TO_DWORD
With this function block, a DWORD is composed of 32 individual BOOLs
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: BM_TYPES_40bd04 or higher
Eingänge
| none |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| dw_OUT | DWORD | Compound data word |
Ein-/Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| a_BOOL32 | ARRAY_32_BOOL | Array with 32 elements of the type Bool |

TB_BITS_OF_BYTE
This function block extracts a Bit from a Byte. The individual bits are provided at the output.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| b_IN | BYTE | Input Byte |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_00 .. 07 | BOOL | Output Bit 0 .. 7 |
Ein-/Ausgänge
| none |

TB_BITS_OF_BYTE
This function block extracts a Bit from a Byte. The individual bits are provided at the output.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| b_IN | BYTE | Input Byte |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_00 .. 07 | BOOL | Output Bit 0 .. 7 |
Ein-/Ausgänge
| none |

TB_BITS_OF_DWORD
This function block extracts a Bit from a DWord. The individual bits are provided at the output.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| dw_IN | DWORD | Input DWord |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_00 .. 31 | BOOL | Output Bit 0 .. 31 |
Ein-/Ausgänge
| none |

TB_BITS_OF_DWORD
This function block extracts a Bit from a DWord. The individual bits are provided at the output.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| dw_IN | DWORD | Input DWord |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_00 .. 31 | BOOL | Output Bit 0 .. 31 |
Ein-/Ausgänge
| none |

TB_BITS_OF_WORD
This function block extracts a Bit from a Word. The individual bits are provided at the output.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| w_IN | WORD | Input Word |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_00 .. 15 | BOOL | Output Bit 0 .. 15 |
Ein-/Ausgänge
| none |

TB_BITS_OF_WORD
This function block extracts a Bit from a Word. The individual bits are provided at the output.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| w_IN | WORD | Input Word |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_00 .. 15 | BOOL | Output Bit 0 .. 15 |
Ein-/Ausgänge
| none |

TB_BITS_TO_BYTE
This function composes a Byte from 8 individual bits.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_0 .. 7 | BOOL | Input bits 0 .. 7 |
Ausgänge
| none |
Ein-/Ausgänge
| none |

TB_BITS_TO_BYTE
This function composes a Byte from 8 individual bits.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_0 .. 7 | BOOL | Input bits 0 .. 7 |
Ausgänge
| none |
Ein-/Ausgänge
| none |

TB_BITS_TO_DWORD
This function composes a DWord from 32 individual bits.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_00 .. 31 | BOOL | Input bits 0 .. 31 |
Ausgänge
| none |
Ein-/Ausgänge
| none |

TB_BITS_TO_DWORD
This function composes a DWord from 32 individual bits.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_00 .. 31 | BOOL | Input bits 0 .. 31 |
Ausgänge
| none |
Ein-/Ausgänge
| none |

TB_BITS_TO_WORD
This function composes a Word from 16 individual bits.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_00 .. 15 | BOOL | Input bits 0 .. 15 |
Ausgänge
| none |
Ein-/Ausgänge
| none |

TB_BITS_TO_WORD
This function composes a Word from 16 individual bits.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: none
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| x_BIT_00 .. 15 | BOOL | Input bits 0 .. 15 |
Ausgänge
| none |
Ein-/Ausgänge
| none |

TB_DWORD_TO_A_BOOL
This function block extracts a bit from a DWORD. The bits are output in an array.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: BM_TYPES_40bd04 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| dw_IN | DWORD | Input DWord |
Ausgänge
| none |
Ein-/Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| a_BOOL32 | ARRAY_32_BOOL | Array with 32 elements of the type Bool |

TB_DWORD_TO_A_BOOL
This function block extracts a bit from a DWORD. The bits are output in an array.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: BM_TYPES_40bd04 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| dw_IN | DWORD | Input DWord |
Ausgänge
| none |
Ein-/Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| a_BOOL32 | ARRAY_32_BOOL | Array with 32 elements of the type Bool |

TB_FIRST_S_BIT_OF_DWORD
This function block extracts the furthest right set bit from a DWord.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: BM_TYPES_40bd04 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| dw_IN | DWORD | Input DWord |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| si_FSBit | SINT | Displays the bit no. of the set bit furthest to the right. |
| dw_Out | DWORD | Output DWord in which only the furthest right bit is set, all other bits are masked out. |
Ein-/Ausgänge
| none |

TB_FIRST_S_BIT_OF_DWORD
This function block extracts the furthest right set bit from a DWord.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: BM_TYPES_40bd04 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| dw_IN | DWORD | Input DWord |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| si_FSBit | SINT | Displays the bit no. of the set bit furthest to the right. |
| dw_Out | DWORD | Output DWord in which only the furthest right bit is set, all other bits are masked out. |
Ein-/Ausgänge
| none |

TB_LAST_S_BIT_OF_DWORD
This function block extracts the furthest left set bit from a DWord.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: BM_TYPES_40bd04 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| dw_IN | DWORD | Input DWord |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| si_LSBit | SINT | Displays the bit no. of the set bit furthest to the left. |
| dw_Out | DWORD | Output DWord in which only the furthest left bit is set, all other bits are masked out. |
Ein-/Ausgänge
| none |

TB_LAST_S_BIT_OF_DWORD
This function block extracts the furthest left set bit from a DWord.
Empfohlene Task: Cyclic / Event
Verwendete Bibliotheken: BM_TYPES_40bd04 or higher
Eingänge
| Marking: | Data type: | Description: |
|---|---|---|
| dw_IN | DWORD | Input DWord |
Ausgänge
| Marking: | Data type: | Description: |
|---|---|---|
| si_LSBit | SINT | Displays the bit no. of the set bit furthest to the left. |
| dw_Out | DWORD | Output DWord in which only the furthest left bit is set, all other bits are masked out. |
Ein-/Ausgänge
| none |
