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:
- PLC variable: ; the counter value can be set from within the PLC application (output process data “Set counter value”)
- Gate input: a positive or negative edge at the “Latch extern” input (output process data “Set counter on latch extern on positive/negative edge”)
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.
![]() | 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.
|
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 using the process data “Set counter value” (0x70n0:11)
- Activation of the counter value setting via the PLC variable: “Set counter” (0x70n0:03)
- To confirm, the “Set counter done” bit (0x60n0:03) is set to TRUE.
- The counter value setting can only be reactivated once the bit in the process data “Set counter” (0x70n0:03) has been set to FALSE.
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.
- Setting the counter value via the output process data “Set counter value” (0x70n0:11)
- Activation of the counter value setting via
- the positive edge at the external gate/latch combination input:
output process data “Set counter on latch extern on positive edge” (0x70n0:0A) - the negative edge at the external gate/latch combination input:
output process data “Set counter on latch extern on negative edge” (0x70n0:0B) - If the bit (TRUE) is set in the output process data “Set counter on latch extern on positive/negative edge” (0x70n0:0A/0B), the next positive or negative edge at the gate input/latch combination input sets the counter value in the input process data “Counter value” to the specified counter value in the output process data “Set counter value”.
- To confirm, the bit in the input process data “Set counter done” (0x60n0:03) is set to TRUE.
- The counter value setting can only be reactivated once the bit in the output process data “Set counter on latch extern on positive/negative edge” (0x70n0:0A/0B) has been set to FALSE.
![]() | 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:04 “Gate 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). |
