Save counter value
The latch function enables the current counter value to be stored in separate process data, independent of the cycle time. The Gate/Latch input can be parameterized as an external latch input with a separate process datum. The latch function can be triggered as follows:
- Gate/Latch input: positive/negative edge at the Gate/Latch input (Enable latch extern on positive/negative edge)
Index 0x80n0:22 "Enable continuous latch extern" can be used to parameterize whether the function is executed at every parameterized edge at the external latch input or only once after every activation.
![]() | Multiple activation of the latch function If several commands are activated simultaneously to save the counter value in the "Latch value" process data (index 0x60n0:12), only the command that is set first is accepted by the terminal.
|
Save counter value via a positive/negative edge at the Gate/Latch input (Enable latch extern on positive/negative edge)
The terminal offers the option of using the Gate/Latch input as a latch input (external latch). To do this, the gate should be deactivated.
![]() | Deactivation of the gate Set the "Gate polarity" bit (index 0x80n0:04) to "0 - Disable gate" in order to be able to use the Latch extern input without locking the counter value after the latch event. |
- The counter value at the Latch extern input can be saved via:
- Index 0x70n0:02 "Enable latch extern on positive edge" = TRUE
The current counter value is stored in index 0x60n0:12 "Latch value" at the first external pulse with positive edge at the Gate/Latch input. - Index 0x70n0:04 "Enable latch extern on negative edge" = TRUE
The current counter value is stored in index 0x60n0:12 "Latch value" at the first external pulse with negative edge at the Gate/Latch input. - Simultaneous activation of 0x70n0:02 and 0x70n0:04
The current counter value is stored in index 0x60n0:12 "Latch value" at the first pulse at the Gate/Latch input, independent of the edge polarity. - Specification whether it is necessary to reactivate the command to save the counter value via:
- "Enable continuous latch extern" Index 0x80n0:22 = FALSE
The following pulses at the Gate/Latch input have no influence on the latch value in index 0x60n0:12 "Latch value" when the bit in index 0x70n0:02 or 0x70n0:04 is set.
A new counter value can only be written to the Gate/Latch input in index 0x60n0:12 "Latch value" if index 0x60n0:02 "Latch extern valid" is FALSE. - Enable continuous latch extern" Index 0x80n0:22 = TRUE
The counter value is written to index 0x60n0:12 "Latch value" at every parameterized edge at the Gate/Latch input.
There is no need to reactivate index 0x70n0:02 or 0x70n0:04. - The status of the Gate/Latch input can be recorded via index 0x60n0:0C "Status of input gate".
- Saving of the counter value in index 0x60n0:12 "Latch value" is confirmed via bit 0x60n0:02 "Latch extern valid".
![]() | Activation of gate and latch functions via the same edge at the gate/latch input When the gate function and a latch function is activated via the same edge at the gate/latch input, the latch function is always executed first, after which the counter value is disabled via the gate function. Example: Index 0x80n0:04 "Gate polarity" (1 = "Enable pos. gate") and index 0x80n0:02 "Enable extern reset" = 1 with 0x80n0:10 "Extern reset polarity" = 1 (reset on positive edge at the gate/latch input) With a positive edge at the gate/latch input the current counter value is first set to zero (reset). The counter value is then blocked. The same applies to the use of index 0x80n0:04 "Gate polarity" (2 = "Enable neg. gate") and simultaneous activation of index 0x80n0:02 "Enable extern reset" with 0x80n0:10 "Extern reset polarity" = 0 (reset on negative edge at the gate/latch input). |