GET_BIT: Reading bit
Original instructions
Function description
This function reads the bit selected with BitNumber for input InputRegister and writes the current state to output CurrentState.
The output is the current state of the selected input data bit.
The BitNumber parameter shows which input data bit to select.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD InputRegister
GET_BIT BitNumber
ST CurrentState
Representation in ST
Representation:
CurrentState := GET_BIT(InputRegister, BitNumber);
Parameter description
Description of input parameters:
Parameter
Data type
Description
InputRegister
Input word
BitNumber
Bit number to be read.
Description of output parameters:
Parameter
Data type
Description
CurrentState
BOOL
Current state of selected bit.
Runtime error
For a list of all block error codes and values, see Extension/Compatibility.