SET_BIT: Set bit
Original instructions
Function description
This function sets the bit of the OutputRegister output word selected with BitNumber to the value of InputData.
The BitNumber parameter provides the bit number in the output data.
WARNING
FORCED VALUES NOT TAKEN INTO ACCOUNT
This procedure overwrites the values in State memory WITHOUT regard to possible forced values in the reference data editor. This can produce serious process conditions.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD InputData
SET_BIT BitNumber
ST OutputRegister
Representation in ST
Representation:
OutputRegister := SET_BIT (InputData, BitNumber);
Parameter description
Description of input parameters:
Parameter
Data type
Description
InputData
Input data
BitNumber
Bit number to be written.
Description of output parameters:
Parameter
Data type
Description
OutputRegister
Output
Runtime error
For a list of all block error codes and values, see Extension/Compatibility.