SC: Set counter value (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
SC: Set counter value

Description

You can use the "Set counter value" instruction to set the value of a counter. The instruction is executed when the result of logic operation (RLO) at the start input of the instruction changes from "0" to "1". When the instruction is executed, the counter is set to the specified counter value.

The "Set counter value" instruction needs a preceding logic operation for the edge evaluation and can only be placed on the right edge of the network.

Parameters

The following table lists the parameters of the "Set counter value" instruction:

Parameters

Declaration

Data type

Memory area

Description

<operand>

Input

BOOL

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

Start input

PV

Input

WORD

I, Q, M, D, L or constant

Value with which the counter is preset in the BCD format.

(C#0 to C#999)

<counter>

InOut/Input

COUNTER

C

Counter that is preset.

For additional information on valid data types, refer to "See also".

Example

The following example shows how the instruction works:

the counter "Counter_1" starts with the value "100" when the signal state of the "TagIn" operand changes from "0" to "1".