RESETBIT
Resets a specific bit in a data field.
Ladder Representation
Block Structure
| Variable Type | Name | Data Type | Description |
|---|---|---|---|
| VAR_IN_OUT | Data | BYTE USINT SINT WORD UINT INT DWORD UDINT DINT | Variable whose bit is changed. |
| VAR_INPUT | EN | BOOL | Block enable. |
| VAR_INPUT | Position | BYTE USINT | Position of the bit to be changed. |
| VAR_OUTPUT | Done | BOOL | Operation success. |
Operation
When EN is TRUE, the block resets the bit indicated by Position in Data and returns Data with the updated value.
When EN is FALSE, Data remains unchanged.
DONE receives the EN value, except when a bit reset error occurs. In that case, DONE receives FALSE.
Make sure Position is within the valid bit range for the Data type. For example, BYTE has 8 bits, so Position must be between 0 and 7.
Execution Flowchart

Examples
- Ladder Example
- Structured Text Example
Example 1 resets bit position 0 of AUX, whose initial value is 200, or 1100 1000 in binary. Because this bit is already FALSE, the value is not changed.
Example 2 resets bit position 3 of AUX, changing its binary value and decimal representation.
Example 3 resets bit position 9 of AUX. Because AUX is a BYTE variable with only 8 bits, the block generates an execution error and the output is not enabled.
The following Structured Text code applies the same logic shown in the Ladder example.
VAR
AUX : BYTE := 2#1101_0000;
POS : BYTE := 3;
END_VAR
DO1 := FB_RESETBIT(
EN:=DI1,
Data:=AUX,
Position:=POS);