Type
| Function |
Description
| Reads the bit of the IN input value that is selected with the BIT_NO input and returns the value of the selected bit. The function can operate on various input data types. |
Notes |
- The output must have the same length or must be larger than the input.
- The value applied to the BIT input must be greater than or equal to 0 or less than the length of the IN bit string.
- If the BIT_NO value is greater or equal than the length of the IN bit string, the function returns the value FALSE (there is no error generated in the MESSAGES window).
- The function does not support execution control with EN/ENO.
|
Parameters
| Inputs
IN
Data type: | ANY_BIT |
Description: | Input value from which the bit selected with BIT is to be read. |
BIT_NO
Data type: | BYTE |
Description: | Number of the bit to be read. The bit number starts at position zero, i.e., the first bit is bit 0. |
Output
OUT
Data type: | BOOL |
Description: | Value of the selected bit. |
|
Error behavior
| Error behavior
The following table shows the errors which may occur while executing the function and the value returned by the function in the corresponding error case.
Error case | Output value |
BIT_NO < 0 | Last valid value is kept |
BIT_NO >= bitlength(IN)(bitlength(IN) = length of the IN bit string) | Last valid value is kept |
|