Set counter value via gate/latch combination input

The counter value in the input process data “Counter value” can be set to a predefined value at runtime and thus be used for synchronization with other processes. The preset can be activated in the following ways:

The “Latch” and “Gate” inputs each combine gate and latch functions in a single input and are therefore referred to below as gate/latch combination inputs.

Set counter value via gate/latch combination input 1:

Multiple activation of “Set counter on ...”

If several commands are activated to accept the preset counter value, only the command that is set first is accepted by the terminal. All other commands are ignored but remain activated, depending on the system.

  • The counter value is set to the preset counter value at the first activated event and confirmed by the bit in process data “Set counter done” (0x60n0:03).
  • The counter value specification cannot be reactivated until all activated commands for the transfer of the counter value have been deactivated. This is confirmed by setting the bit in process data “Set counter done” (0x60n0:03) to FALSE.

Set counter value via a PLC variable (Set counter value)

The counter value can be set to a predefined value during runtime via the process data “Set counter” (0x70n0:03). In the PLC this bit can be linked to a digital input, for example, or used directly as a variable.

Setting the counter value via the gate/latch combination input (Set counter on latch extern on positive/negative edge)

The counter value can be set to a preset value during runtime via the process data by the positive or negative edge at the gate/latch combination input.

Set counter value via gate/latch combination input 2:

Activation of gate and latch functions via the same edge at the gate/latch combination input in 2-channel mode 2xAB

When the gate function and a latch function is activated via the same edge at the gate/latch combination input, the latch function is always executed first, after which the counter value is locked via the gate function.

Example:

Index 0x80n0:04Gate polarity” (1 = “Enable pos. gate”) and

Output process data “Set counter on latch extern on positive edge” (0x70n0:0A) = 1

When a positive edge is detected at the gate/latch combination input, the current counter value is first set to the value specified in the output process data “Set counter value” (0x70n0:11). After that, the counter value is locked.

The same applies to the use of index 0x80n0:04 “Gate polarity” (2 = “Enable neg. gate”) and the simultaneous activation of the output process data “Set counter on latch extern on negative edge” (0x70n0:0B).