Siemens LOGO! Async Pulse Generator Remaining Time Display

David Krause10 min read
HMI ProgrammingSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Siemens LOGO! Async Pulse Generator Remaining Time Display

A field-engineering guide to configuring the Siemens LOGO! 8 family (6ED1052 series) so that the remaining time before the next asynchronous pulse output is shown live on the integrated LOGO! display or LOGO! TDE. The pattern solves a recurring need: a periodic process (e.g., a motor triggered every 5 min by an asynchronous pulse generator) where the operator must know how many seconds remain until the next pulse, and where a hard-wired terminal switch (I1) is used to break the cycle.

Scope. This procedure targets LOGO! 8 (6ED1052-1MD08-0BA1 / 6ED1052-2MD08-0BA1 / 6ED1052-1HB08-0BA1) running firmware FS04 or later, programmed with LOGO! Soft Comfort V8.3 or V9.0. The asynchronous pulse generator block is part of the standard library from Soft Comfort V8.0 onward.

1. Problem Overview

The reference application contains four cooperating blocks on the LOGO! 8 base module:

  1. A weekly timer (block B001) closes its contact between 07:00 and 18:40 on selected days. The HIGH edge arms the latch.
  2. A RS-latch (block B002) sets on the timer's rising edge and resets when the operator closes terminal switch I1.
  3. An asynchronous pulse generator (block B003) is enabled by the latch output. It produces a 2 s HIGH pulse every 5 min (300 s) when the latch is set.
  4. An output block (block B004, Q1) drives the relay contactor for the motor when the pulse is HIGH, while a message text (block B005) on the LOGO! display shows the live remaining time before the next pulse.

The functional question is: which LOGO! parameter exposes the live remaining time of an enabled asynchronous pulse generator, and how do we route that parameter into a message text field? The asynchronous pulse generator (APG) is internally a cycle-time-independent timer pair; it does not expose a "remaining time" terminal in the same way as the On-Delay (TON) block does. The remaining time must be derived from the elapsed-time parameter of the upstream timer or computed with an Arithmetic block from a parallel counter, then pushed to a Variable Memory (VM) word that the message text can reference.

2. Prerequisites

Item Specification
LOGO! base module 6ED1052-1MD08-0BA1 (230 V, display) or 6ED1052-2MD08-0BA1 (24 V, no display)
LOGO! firmware FS04 minimum; FS05 recommended for full Soft Comfort V9.0 compatibility
LOGO! Soft Comfort V8.3 (6AV2100-0AA08-0AA0) or V9.0 (6AV2100-0AA09-0AA0)
Ethernet / micro-SD Required for VM mapping export and parameter logging
Inputs / Outputs I1 wired to a normally-closed terminal stop pushbutton; Q1 wired to the motor contactor coil through an interposing relay if the load exceeds 10 A
LOGO! TDE (optional) 6ED1055-4MH08-0BA1 for remote display
If your base module lacks an integrated display (the 6ED1052-2MD08-0BA1), you still implement the message text; it is only accessible from a connected LOGO! TDE, the LOGO! Web Editor (V8.3+), or the LOGO! Access Tool on a PC.

3. Asynchronous Pulse Generator Block Fundamentals

The asynchronous pulse generator in LOGO! Soft Comfort is found under Special Functions > Timers > Asynchronous Pulse Generator. It accepts three configuration parameters and exposes three terminals:

Parameter Meaning Range
TH Total period (HIGH + LOW) 00:00 s to 99:59 h
TL Low-time fraction inside TH 00:00 s to 99:59 h, TL ≤ TH
Cnt Initial / current count (auto-incremented when running) 0 .. 999,999
Terminals
Trg Trigger input; HIGH starts the pulse train
R Reset input; HIGH aborts the pulse train and clears Cnt
Q Output; HIGH during TL fraction of every period

The asynchronous pulse generator is the only LOGO! timing block that is not updated by the scan cycle; its state advances on the hardware timer interrupt inside the CPU. This means Cnt is incremented in real time even when the program scan is busy, which is what makes it suitable for producing precise 2 s pulses on a 5 min schedule.

Crucially, the APG does not present a remaining-time output. It only presents the Q terminal (boolean) and the running Cnt counter. To obtain a "time-to-next-pulse" value we therefore need one of two approaches:

  1. Approach A (recommended): Place a parallel On-Delay (TON) block whose time base equals the APG period. The TON block's TH output (remaining time) is naturally available for VM mapping.
  2. Approach B: Read the APG's Cnt value via VM, multiply by the base time resolution, and subtract from TH using an Arithmetic block.

Approach A is shown below; it is shorter and reuses well-documented VM mapping for the TON block.

4. Variable Memory Addressing Strategy

The LOGO! 8 CPU exposes 850 Variable Memory words (VM0..VM849) accessible from every function block and from the message text. The default assignment is:

Block parameter Default VM word Direction
B001 weekly timer - ON time VM0 Read/Write
B002 RS-latch - state VM2 Read/Write
B003 APG - Cnt (elapsed count) VM10 Read
B006 TON - current elapsed time VM20 Read
B007 TON - remaining time (TH) VM22 Read
Message text B005 - line 2 value VM30 Read
Important. The VM offset is set on each block's properties dialog. If you do not enable "Parameter write" or "Parameter protection" the VM address may not be visible from other blocks. Open the block's properties and confirm the Parameter / VM address field matches the table above.

5. Remaining Time Calculation

For the reference circuit (5 min = 300 s period, 2 s pulse), the formula we push into the message text is:

remaining_seconds = 300 - VM20 (elapsed time in seconds)

This is implemented with one Arithmetic block (B008) wired to the TON block's elapsed-time output:

B008 Arithmetic (Function: A - B, scaling off)
    A (Input 1)  = 300          // constant: period in seconds
    B (Input 2)  = VM20         // TON elapsed-time parameter
    Q (Output)   = VM30         // drives message text line 2
    Q ranges from 0 to 300, displayed as seconds remaining

If you want the display in minutes:seconds, replace the constant with a second Arithmetic block that does integer division (LOGO! Soft Comfort V8.3+ supports / with quotient and remainder):

B009 Arithmetic (A / B)
    A = VM30 (seconds remaining)
    B = 60
    Quotient (Q1) = minutes  -> VM40
    Remainder (Q2) = seconds -> VM42

Then in the message text, two VM placeholders display VM40:VM42 formatted as MM:SS.

6. Message Text Configuration

  1. Drag a Message Text block (B005) onto the diagram. The block is found under Special Functions > Message Text.
  2. Set the Enable input to the Q output of the RS latch (B002). The message is only visible while the latch is set.
  3. In the message text properties, enable Show actual values on the second line.
  4. Click into line 2, insert a VM placeholder, and choose VM30 as the source. Set the format to Decimal, 3 digits.
  5. Enter the static string Next pulse in on line 1 and add the VM placeholder + s on line 2.
  6. Open Properties > Acknowledge and choose No so the text updates automatically without operator ESC.
  7. Compile and download to the LOGO! base module.

The resulting on-display text reads, for example: "Next pulse in 287 s" and ticks down once per second.

7. Ladder / FBD Topology

B001 Weekly B002 RS B003 APG 300s / 2s B006 TON 300s B008 ARITH 300-VM20 B005 MSG TEXT (VM30) B004 Q1 motor I1 NC Rising edge sets latch; I1 (NC) resets

8. Latch Reset Behavior and Edge Cases

The terminal stop button I1 is wired normally-closed so that a broken wire also releases the latch. When the operator presses the stop button:

  1. RS-latch B002 resets. Its Q output goes LOW.
  2. APG B003 sees a LOW on its Trg input and immediately freezes; Q returns LOW.
  3. TON B006 (parallel timer) also freezes; its elapsed-time value is held.
  4. The Arithmetic block B008 stops updating because VM20 stops changing; VM30 stays at the last value. This is the correct behavior: the displayed time "freezes" at the value when the stop was pressed.
  5. Message text B005 hides because its enable input is the latch Q.
Edge case. If the operator releases I1 mid-cycle, the latch has been reset and the APG does not automatically restart; the weekly timer must re-arm the latch. If you want auto-restart, replace the RS-latch with a Set-Reset flip-flop whose set input is the OR of the weekly timer's rising edge and a "start" pushbutton, and whose reset is still I1.

9. Verification Procedure

  1. Download the program with LOGO! Soft Comfort in Online > PC ↔ LOGO! mode.
  2. Switch the LOGO! to RUN; observe the message text. The line 2 value should count down from 300 (or 4:60 / 04:60) to 0 within one period, then jump back to 300 when the pulse fires.
  3. Press I1 (terminal stop). Confirm the message text disappears within one scan and the motor Q1 stops.
  4. Release I1. Confirm the system remains stopped until the next weekly timer edge.
  5. In Soft Comfort, open Tools > VM Mapping. Verify VM30 matches the displayed value on line 2. Any mismatch indicates an incorrect VM address assignment.
  6. Force a one-hour test by changing the APG period to 60 s and verifying the countdown behaviour and pulse duration.

10. Troubleshooting Matrix

Symptom Likely Cause Corrective Action
Message text shows 0 s and never updates B006 TON time base set to 0, or TON not enabled Set TON time = APG period (300 s); confirm TON enable wired to latch Q
Display shows 300 s continuously Arithmetic block wired with A=VM20, B=300 Swap to A=300, B=VM20
Message text never appears Message text enable wired to APG Q instead of latch Q Rewire enable input to RS-latch output
Value updates only when message text is active VM mapping not enabled on TON block Open TON properties, enable Parameter / VM address and assign VM20
Display counts down too fast Time base of TON set to milliseconds Set TON time base to seconds (s)
Reset via I1 has no effect I1 wired to latch S instead of R Swap S and R inputs of the RS-latch
Pulse fires but Q1 motor contactor does not engage Interposing relay coil suppressed by 24 V logic; Q1 sourcing 24 V only Use a relay module (e.g. 6ED1057-4CA00-0AA0) or external interposing relay
Soft Comfort reports "Block is not supported in this firmware" LOGO! firmware older than FS04 Update firmware via micro-SD card or LOGO! Access Tool

11. Notes on the Asynchronous Pulse Generator vs. Standard Pulse Generator

The standard Pulse Generator (PG) block in LOGO! Soft Comfort is a cycle-time-dependent block; its accuracy is bounded by the LOGO! scan time (typically 10-20 ms on a LOGO! 8). The APG block uses a hardware timer interrupt, giving accuracy < 1 ms. For a 2 s pulse on a 5 min period the PG block is technically sufficient, but the APG is preferred when:

  • Multiple APG blocks are running and one is gating a high-speed counter.
  • The pulse must remain phase-accurate even when the LOGO! scan is momentarily extended by Ethernet traffic or S7 communication.
  • The pulse is wired to a hardware interrupt input (I3-I6 on LOGO! 8) for fast capture.

Both blocks expose a Cnt value in VM; both require the parallel-TON pattern described above to derive a remaining-time display.

12. Commissioning Checklist

Step Pass criterion
Power-on test LOGO! shows clock, message text visible after 07:00
Latch set / reset Rising edge of weekly timer sets latch; I1 resets within 100 ms
APG pulse width 2 s ± 50 ms measured at Q1
APG period 300 s ± 1 s
Display countdown Counts down 300 → 0 then jumps to 300 after each pulse
Stop behaviour I1 press: motor stops, message text hides, VM30 freezes
Restart behaviour After I1 release, system stays stopped until next weekly edge
Power loss recovery LOGO! retains VM values; APG restarts from Cnt = 0 if persistent flag set

Does the asynchronous pulse generator block in LOGO! 8 expose a remaining-time output directly?

No. The APG block exposes only the boolean output Q and the Cnt (running count) parameter. A parallel On-Delay (TON) timer with the same period must be used, and its TH (remaining time) parameter routed to a VM word for display.

How do I display a countdown in minutes and seconds on the LOGO! display?

Compute remaining seconds with an Arithmetic block (period − elapsed), divide by 60 using a second Arithmetic block, and place the quotient and remainder in two VM words. Reference both VM words in the message text formatted as MM:SS.

Why does the message text disappear when I press the terminal stop button?

The message text enable input is wired to the RS-latch output. Pressing the normally-closed stop button resets the latch, drops the enable signal, and the LOGO! hides the message text. This is the intended safe-stop behaviour.

Can I keep the message text visible after I1 is pressed?

Yes. Move the message text enable from the RS-latch output to the OR of the latch output and a flip-flop that is set when I1 is pressed and cleared by an operator ACK key on the LOGO! display.

What VM addresses does the message text support in LOGO! Soft Comfort V9.0?

VM0 through VM849 are read-only from the message text on the LOGO! 8 base module and the LOGO! TDE. Use the block's properties dialog to bind any of these words to the message text line.

Back to blog