RESET_BF: Reset bit field (S7-1200, S7-1500) - STEP 7

FBD (S7-1200, S7-1500)

ft:publication_title
FBD (S7-1200, S7-1500)
Product
STEP 7
Version
V20
Publication date
11/2024
Language
en-US
RESET_BF: Reset bit field

Description

You use the "Reset bit field" instruction to reset several bits starting from a certain address.

You specify the number of bits to be reset with the value of the constant at the N input. The address of the first bit to be reset is defined by <Operand>. If the value of the constant may not be greater than the number of bits in a selected byte. If this value is greater, the instruction is not executed and the error message "Range violation for index <Operand 1>" is displayed. The bits remain set until they are explicitly reset by another instruction.

The instruction is only executed if the enable input EN has the signal state "1".

Bit fields of the type PLC data type, STRUCT or ARRAY

With structures of the type PLC data type, STRUCT or ARRAY, the number of bits contained in the structure represents the maximum number of bits that can be set:

  • If you specify the value "20" at the N input, for example, and the structure only contains 10 bits, then only these 10 bits are reset.

  • If you specify the value "5" at the N input, for example and the structure contains 10 bits, then exactly 5 bits are reset.

Parameters

The following table shows the parameters of the "Reset bit field" instruction:

Parameters

Declaration

Data type

Memory area

Description

S7-1200

S7-1500

EN

Input

BOOL

I, Q, M, D, L or constant

I, Q, M, D, L, T, C or constant

Enable input

N

Input

UINT

Constant

Constant

Number of bits to be reset

<Operand>

Output

BOOL

I, Q, M

With a DB or an IDB, an element of an ARRAY[..] of BOOL

I, Q, M

With a DB or an IDB, an element of an ARRAY[..] of BOOL

Pointer to the first bit to be reset.

Example

The following example shows how the instruction works:

If the operands "TagIn_1" and "TagIn_2" have the signal state "1", 5 bits are reset starting at the address of the operand "MyDB".MyBoolArray[4].