Save counter value
The latch function enables the current counter value to be stored in separate process data, independent of the cycle time. The latch function can be triggered as follows:
- Gate/latch combination input positive/negative edge at the latch input (output process data “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 external edge at the 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 (0x60n0:12), only the command that is set first is accepted by the terminal.
|
Save the counter value via a positive/negative edge at the latch input (Enable latch extern on positive/negative edge)
- The counter value at the “Latch extern” input can be saved via:
- Process data “Enable latch extern on positive edge” (0x70n0:02) = TRUE
At the first external latch pulse with positive edge, the current counter value is stored in the process data “Latch value” (0x60n0:12). - Process data “Enable latch extern on negative edge” (0x70n0:04) = TRUE
At the first external latch pulse with negative edge the current counter value is stored in the process data “Latch value” (0x60n0:12). - Simultaneous activation of the bits in the process data “Enable latch extern on positive edge” (0x70n0:02) and “Enable latch extern on negative edge” (0x70n0:04)
The current counter value is stored in the process data “Latch value” (0x60n0:12), at the first external latch pulse, 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 “Latch extern” input have no effect on the latch value in the process data “Enable latch extern on positive edge” (0x70n0:02) and “Enable latch extern on negative edge” (0x70n0:04) when the bit in the process data “Latch value” (0x60n0:12) is set.
Only when the bit in the process data “Latch extern valid” (0x60n0:02) is set to FALSE can a new counter value be written to the latch input in the process data “Latch value” (0x60n0:12) - “Enable continuous latch extern” Index 0x80n0:22 = TRUE
The counter value is written to the process data “Latch value” (0x60n0:12) each time a configured edge occurs at the “Latch extern” input.
There is no need to reactivate the process data “Enable latch extern on positive edge” (0x70n0:02) and “Enable latch extern on negative edge” (0x70n0:04). - Saving of the count value in the process data “Latch value” (0x60n0:12) is confirmed by the bit in the process data “Latch extern valid” (0x60n0:02).
- The status of the “Latch extern” input can be monitored using the process data “Status of extern latch” (0x60n2:14).
![]() | 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 “Enable latch extern on positive edge” (0x70n0:02) = 1 When a positive edge is detected at the gate/latch combination input, the current counter value is first stored in the input process data “Latch value” (0x60n0:12). After that, the counter value is locked. The same applies to the use of the index 0x80n0:04 “Gate polarity” (2 = “Enable neg. gate”) and the simultaneous activation of the output process data “Enable latch extern on negative edge” (0x70n0:04). |
