Overview
This reference builds a Siemens LOGO! Soft Comfort program that counts pieces on a sensor, drives a service-mode indication on the LOGO! 8 on-board LCD after 10 seconds of inactivity, escalates to a washing-mode indication after 15 seconds, and resets the piece counter every time the program is interrupted. The article targets the LOGO! 8 generation base modules (6ED1052-*08-0BAx family) and expansion modules (6ED1055-*08-0BAx family) programmed with LOGO! Soft Comfort V8.3 or V8.4 in FBD (function block diagram).
The logic uses three primitive function blocks: an up/down counter advanced by the piece sensor, an on-delay timer for the 10 s service threshold, and a second on-delay timer for the 15 s washing threshold. Two message-text function blocks write the current state to the on-board 6-line LCD. The counter is configured non-retentive so that any power cycle, program stop, or cold restart zeros the count, which matches the requirement that the counter resets on every program interruption.
All parameters, block names, and signal conventions used in this article are consistent with the LOGO! 8 system manual set available from the Siemens Industry Online Support portal and with the product family description on the Siemens LOGO! product page.
Prerequisites and Software Setup
Install the following before starting the program:
- LOGO! 8 base module. The exact article number depends on the supply voltage and I/O count. The 12/24 RCE, 24 RCE, and 230 RCE variants are all supported by the program in this article. Use a current-generation device (0BA2 suffix or later) so the firmware behavior matches the LOGO! Soft Comfort V8.4 library.
- LOGO! Soft Comfort V8.3 or V8.4 installed on a Windows 10 or Windows 11 PC. The installer is available from the Siemens Industry Online Support portal.
- Ethernet cable for the LOGO! 8 programming port. The LOGO! 8 base module exposes an RJ45 socket labeled Ethernet that supports 10/100 Mbit/s. The default IP address is 192.168.0.1 with subnet mask 255.255.255.0.
- Piece sensor wired to a digital input of the LOGO! base module. The sensor must provide clean 24 V (12/24 RCE and 24 RCE variants) or 230 V (230 RCE variant) switching edges.
- 24 V DC control supply, miniature circuit breaker, and ferruled conductors sized per local electrical code.
- LOGOTDE external text display (optional). The LOGO! 8 supports the LOGO! TDE as a remote display with the same 6-line by 16-character layout as the on-board display. The TDE is useful when the LOGO! is mounted inside a cabinet and the operator needs a panel-mount display.
Configure the PC on the same subnet as the LOGO! (for example, 192.168.0.10) and verify the connection by opening a browser to http://192.168.0.1. The LOGO! web server should respond with the LOGO! welcome page. From the LOGO! Soft Comfort menu, select Tools -> Transfer -> PC <-> LOGO!, choose Ethernet, enter the LOGO! IP address, and click Test. A successful test confirms the PC and the LOGO! are on the same broadcast domain.
Program Architecture
The full program uses five FBD blocks plus the required logic gates. The signal flow is:
- Digital input I1 is the piece sensor. Each rising edge increments the counter.
- Digital input I2 is the run/enable signal. When I2 is high, the on-delay timers are armed; when I2 is low, both timers are reset and the counter is held at zero.
- Counter block
CNTtallies pieces while I1 pulses. - On-delay block
TON_1triggers 10.000 s after the last piece while I2 remains high. - On-delay block
TON_2triggers 15.000 s after the last piece while I2 remains high. - Message-text block
MT_SVCdisplays "Service Mode" when TON_1.QV is high. - Message-text block
MT_WSHdisplays "Entering Washing Mode" when TON_2.QV is high and overrides the service message via the priority field.
| Block name | Function | Key parameters |
|---|---|---|
| CNT | Up/down counter | Threshold = 9999, Direction = up, Retentive = off, Reset = I2 inverted |
| TON_1 | On-delay (service) | Time base = seconds, Time value = 10.000, Reset = I1 OR I2 inverted |
| TON_2 | On-delay (washing) | Time base = seconds, Time value = 15.000, Reset = I1 OR I2 inverted |
| MT_SVC | Message text | Trigger = TON_1.QV, Priority = 1, Acknowledge = none, Retentive = off |
| MT_WSH | Message text | Trigger = TON_2.QV, Priority = 2, Acknowledge = none, Retentive = off |
The expected state behavior is summarized in the table below. All times are measured from the last rising edge at I1, assuming I2 is held high throughout.
| Elapsed time | Counter (CV) | TON_1 (10 s) | TON_2 (15 s) | LCD message |
|---|---|---|---|---|
| 0 s (on I1 edge) | Increments by 1 | Reset to 0 | Reset to 0 | None |
| 0-9.999 s | Steady | Accumulating | Accumulating | None |
| 10.000 s | Steady | QV = 1 | Accumulating | Service Mode (priority 1) |
| 15.000 s | Steady | QV = 1 | QV = 1 | Entering Washing Mode (priority 2) |
| Any (on next I1 edge) | Increments by 1 | Reset to 0 | Reset to 0 | None until next 10 s |
Configure the Piece Counter
Open a new FBD program in LOGO! Soft Comfort. Drag the Counter block from the Special Functions toolbar onto the diagram. The counter function block has the following connector pins:
- Cnt -- count input. Each rising edge at Cnt increments or decrements the counter value (CV) depending on the Direction parameter.
- R -- reset input. A high level at R clears CV to zero and forces the QV output low.
- Dir -- direction control. With Dir = 0, the counter counts up. With Dir = 1, the counter counts down.
- QV -- boolean output. QV is high when CV is greater than or equal to the configured threshold.
Connect I1 (piece sensor) to the Cnt input. The sensor must be wired so that a clean 24 V (or 230 V) edge appears at I1 for each counted piece. Add an RC debounce filter (100 nF in parallel with 10 kOhm) at the LOGO! input terminal if the sensor contact can bounce on the conveyor or on part impact. For a PNP three-wire sensor on a 24 RCE LOGO!, the brown wire goes to +24 V, the blue wire to 0 V, and the black signal wire to the I1 terminal.
Set the threshold to a value appropriate for the application; 9999 is the maximum for the LOGO! counter. The output QV can drive a downstream "target count reached" indicator, but for the program described in this article, the counter value is read into the message text via a separate analog or numeric tag. If the application only needs the LCD state indication, leave the threshold at a high value (e.g., 9999) so QV is not asserted during normal operation.
Click the Retention checkbox on the counter block and leave it off. With retention disabled, the counter value is held in volatile memory and is cleared on every power cycle, program stop, and cold restart -- exactly the behavior required by the original requirement that the counter resets on program interruption.
The Direction input is optional. If you want the counter to count up only, leave Dir tied to a constant 0. If you want the counter to subtract (for example, for a count-down to a target), connect Dir to a constant 1 or to a digital input wired to a direction-selector switch.
Configure the Service-Mode On-Delay Timer (10 s)
Drag the On-Delay block from the Timer toolbar. The on-delay function block has the following pins:
- Trg -- trigger input. A rising edge starts the timing; a sustained high level holds the time accumulator at zero until the input falls.
- R -- reset input. A high level clears the accumulator and forces the QV output low.
- QV -- boolean output. QV goes high after the time value T has elapsed with Trg continuously high, and falls as soon as Trg goes low or R is asserted.
Configure the on-delay time value. Open the block properties and set:
- Time base = seconds (s)
- Time value = 10.000
Wire the Trg input to I2 (run/enable). The timer accumulates while the machine is running. The on-delay must be reset every time a new piece is detected. Wire an OR gate with inputs (I1 inverted, I2 inverted) into the R input. This produces the desired behavior: the timer accumulates only while I2 is high (machine running) and no piece has been seen at I1. The moment I1 pulses, the inverted I1 input goes low, R is de-asserted, and the next rising edge of I2 (or the first rising edge after I1 falls) restarts the 10 s window.
For simpler wiring, route I1 directly into the R input via a non-inverting input. The timer then resets on every I1 pulse. In most applications this is acceptable because the piece sensor pulses much more frequently than once per 10 s during normal operation, so the timer never reaches 10 s while parts are moving.
With retention off, the timer accumulator is held in volatile memory and is reset on every power cycle. This matches the required "resets on interruption" behavior for the timers as well as the counter. If the operator must adjust the time value from the LOGO! front panel, open the block properties and change Parameter protection from "Locked" to "Display + adjust". The time value then becomes a settable parameter at runtime and is highlighted on the LOGO! display under the "Program -> Parameter" menu.
Configure the Washing-Mode On-Delay Timer (15 s)
Add a second on-delay block with the same topology as the 10 s timer but with a time value of 15.000. Wire the R input to the same source as the 10 s timer (I1 OR I2 inverted). The 15 s timer is independent of the 10 s timer in the FBD diagram; the LOGO! scheduler evaluates both blocks in each scan cycle and either block can assert its QV output as soon as its time value elapses.
If the application requires that the 15 s timer only starts after the 10 s service message has been displayed (cascaded behavior), insert the 10 s timer's QV output into the Trg input of the 15 s timer instead of using I2 directly. This converts the program from a parallel timing architecture to a sequential one. The original requirement is ambiguous on this point; both interpretations are valid and are covered in the troubleshooting matrix at the end of this article.
For service intervals longer than 60 s, change the Time base on both timers from seconds to minutes and enter the value in minutes (for example, 0:10 m for 10 minutes and 0:15 m for 15 minutes). The LOGO! on-delay timer supports time bases from 10 ms to 100 h, with the maximum time value being 99,990 time-base units.
Configure the Message Texts on the LOGO! Display
The message text function block is the only standard LOGO! block that writes directly to the on-board 6-line LCD. It supports plain text, I/O status, bar graphs, and date/time stamps. The display supports 16 characters per line and up to six lines of text per message. The visible region on the LOGO! 8 base module is 6 lines tall; lines beyond the sixth scroll on demand.
Drag two Message Text blocks from the Special Functions toolbar. For each block, open the block properties and configure the following fields:
| Field | MT_SVC value | MT_WSH value | Notes |
|---|---|---|---|
| En (Enable input) | Always high (constant 1) | Always high (constant 1) | En is used to mask the entire message; tie to 1 to make the message depend only on the trigger. |
| Trigger input | TON_1.QV | TON_2.QV | The message is shown while the trigger is high. |
| Text line 1 | Service Mode | Entering Washing | 16 characters max per line. |
| Text line 2 | Press RUN to clear | Auto cycle in 30 s | Optional second line. |
| Bar graph | Off | Off | Enable only if a process variable (for example, CV scaled) is to be visualized. |
| Priority | 1 | 2 | Higher priority replaces lower priority on the display. |
| Acknowledge | None | None | Set to "ESC required" if the operator must dismiss the message. |
| Retention | Off | Off | Off means the message state resets on power cycle. |
| Character set | Latin-1 | Latin-1 | Use Latin-1 for English, German, French, Spanish, and most Western European languages. |
The priority field is critical. When two message text blocks are asserted simultaneously, the LOGO! display shows the block with the higher priority. With MT_SVC at priority 1 and MT_WSH at priority 2, the washing-mode text takes precedence from t = 15 s onward. If both priorities are equal, the LOGO! cycles between the two messages; if both are zero, the LOGO! suppresses the display.
For text content beyond the visible region, enable the Tick (scrolling text) option. This is useful for long operator instructions that do not fit in 16 characters per line. The LOGO! 8 base module scrolls long message texts automatically at a fixed rate of approximately 1 character every 250 ms.
To display the live counter value inside the message text, click Insert in the message text editor and select Tag / I/O status. Pick the counter block by name and choose Current value (CV) from the dropdown. The counter value appears on the LOGO! display in decimal, updating in each LOGO! scan cycle (typically 10 ms to 100 ms depending on the program size and number of function blocks).
To add a bar graph tied to the counter value, enable the Bar graph field, set the upper limit to the counter threshold (for example, 1000), and pick the counter CV as the source. The bar graph appears on the right side of the message text and renders 16 segments from empty to full. The bar graph updates in the same scan cycle as the text content.
Counter Reset on Program Interruption
LOGO! 8 separates persistent (retentive) memory from volatile memory. The retention flag is set per function block in the block properties dialog. When retention is off:
- Counter value (CV) is zeroed on every power cycle.
- On-delay timer accumulator (T) is zeroed on every power cycle.
- Message text state is cleared on every power cycle.
- RS flip-flop state is cleared on every power cycle.
For the program in this article, all four of those blocks have retention disabled. The result is that any cold start of the LOGO! (power cycle, program stop, RUN -> STOP transition, STOP -> RUN transition) places the program in the same initial state: counter at zero, timers at zero, and no message text on the display.
If the application also requires an operator-initiated reset, wire a digital input (for example, I3) to the R input of the counter and to the R input of both on-delay timers via an OR gate. Pressing the reset pushbutton zeros the counter and the timer accumulators immediately. This is the same input that would be wired to the LOGO! to acknowledge an alarm, and it does not require any retention change.
To verify the retention behavior, perform the following field test:
- Power on the LOGO!, run the program, and let the counter accumulate at least ten pieces.
- Open LOGO! Soft Comfort and connect to the LOGO! via Ethernet.
- Click RUN -> STOP in the toolbar, then click RUN again. The counter should return to zero in the message text display.
- Cycle the supply power (turn off the circuit breaker, wait 5 s, turn it on). The counter should return to zero on the next LCD update.
If the counter does not reset on power cycle, open the counter block properties and verify that the Retention checkbox is cleared. A common mistake is to enable retention on the counter "so the value survives" while the requirement is the opposite. Retention must be off for this program.
Wire the Program into I/O
Map the LOGO! FBD signals to physical I/O as follows. These mappings are conventional for the LOGO! 8 base modules listed in the prerequisites; the exact I/O count depends on the article number.
| LOGO! signal | Physical terminal | Function | Wire color (24 V control) |
|---|---|---|---|
| I1 | Terminal 1 (input) | Piece sensor, PNP, NO | Brown (+24 V), Blue (0 V), Black (signal) |
| I2 | Terminal 2 (input) | Run / enable pushbutton, NO | Brown, Blue, Black |
| I3 | Terminal 3 (input) | Reset pushbutton, NO | Brown, Blue, Black |
| Q1 | Terminal 1 (output, optional) | Run indicator (active while I2 high) | As per load |
| Q2 | Terminal 2 (output, optional) | Service-mode relay (driven from TON_1.QV) | As per load |
| Q3 | Terminal 3 (output, optional) | Washing-mode relay (driven from TON_2.QV) | As per load |
For 230 V AC inputs (LOGO! 230 RCE), the sensor and pushbutton must switch the line voltage. The wiring is otherwise identical; the LOGO! base module internally conditions the input to 24 V logic levels.
Apply ferrules to every conductor that lands on a removable LOGO! terminal block. Torque the terminal screws to 0.6 Nm for the standard 24 V base module or 0.8 Nm for the 230 V base module. The exact value is printed on the terminal block cover and in the device installation guide.
Size the 24 V DC control supply by summing the sensor current, the relay coil currents, and the LOGO! internal consumption (typically 50-150 mA depending on the variant). A 24 V 2.5 A DIN-rail supply is more than adequate for a typical piece-counter application with one relay output. The 12/24 RCE variant also accepts a 12 V DC supply for battery-backed installations; verify the supply tolerance in the LOGO! 8 system manual before commissioning.
For applications that require more than four outputs, add a LOGO! 8 digital output expansion module (for example, 6ED1055-1FB10-0BA2 for four 24 V transistor outputs, or 6ED1055-1NB10-0BA2 for four relay outputs). The expansion module connects to the base module via the side bus connector and is auto-detected by LOGO! Soft Comfort on the next program transfer. Up to eight expansion modules can be added in series for a maximum of 24 digital inputs and 20 digital outputs in one LOGO! 8 station.
Simulation, Transfer, and Field Commissioning
LOGO! Soft Comfort includes a built-in simulator that runs on the PC without a connected LOGO! device. To start the simulator, click the Simulator button on the toolbar. The simulator opens a panel with toggle switches for every input (I1-I8) and indicator lamps for every output (Q1-Q4) and for every function-block QV output. A virtual LCD also appears in the simulator window and renders the active message text.
Run the following verification sequence with the simulator open and the program loaded:
- Toggle I2 high (run enable). Verify that Q1 (run indicator) goes high in the simulator and the message text area is blank.
- Click the I1 toggle four times in quick succession to simulate four pieces. Verify that the counter value reads 4 in the message text area (or in the counter block tooltip).
- Wait 10 s. The Service Mode message text should appear in the on-board LCD simulation window.
- Wait an additional 5 s (15 s total). The Entering Washing Mode message text should replace the service text.
- Pulse I1 to simulate a new piece. Both message texts should clear and the timer accumulators should return to zero.
- Toggle I2 low, then high again. Both timers and the counter should return to zero.
If any of these steps fail, refer to the troubleshooting matrix below. The most common cause of a failed verification is a forgotten OR gate between the I1 reset signal and the on-delay R input, or a message text block whose En pin is tied to a constant 0 by accident.
Once the simulation passes, transfer the program to the physical LOGO! device. From the LOGO! Soft Comfort menu, select Tools -> Transfer -> PC -> LOGO!. Choose the Ethernet interface, enter the LOGO! IP address, and click OK. The transfer takes 5-10 s for a small program like the one in this article.
After the transfer, the LOGO! enters STOP mode. Click RUN -> STOP in the LOGO! Soft Comfort toolbar to start the program on the device. The on-board LCD should display No Program or No Message while no message text is active, and should display Service Mode or Entering Washing Mode when the corresponding trigger is high.
For permanent installation, click Tools -> Protect to set a password on the LOGO! device. The default password is "LOGO" and should be changed for production use. A protected LOGO! does not allow a PC to upload or modify the program without the password. The password also locks operator access to program parameters via the LOGO! front panel.
Field commissioning checklist:
- Verify the 24 V supply is within the LOGO! tolerance range (typically 20.4-28.8 V DC for the 24 RCE variant).
- Verify the polarity of every input wire. A reversed PNP sensor on a LOGO! 24 RCE base module will not pull the input low and the counter will not advance.
- Manually pulse the piece sensor ten times and confirm the counter increments on the LOGO! LCD.
- Hold I2 high, stop feeding pieces, and time the 10 s and 15 s message transitions with a stopwatch.
- Cycle the supply power and confirm the counter and timer accumulators return to zero.
- Set the LOGO! password to prevent unauthorized program modification.
- Save a backup copy of the program in the project folder and in the maintenance documentation binder.
- Record the LOGO! Ethernet IP address on the cabinet label for future maintenance access.
Troubleshooting Matrix
| Symptom | Likely cause | Resolution |
|---|---|---|
| Counter does not reset on power cycle | Retention is enabled on the counter block | Open the counter block properties and clear the Retention checkbox. |
| Service mode message appears immediately at power-up | On-delay timer retention is on, or the timer reset signal is wired wrong | Disable retention on the on-delay block and verify the R input is driven by the I1/I2 OR gate. |
| Both message texts flash alternately on the display | Priorities are equal, or both priorities are 0 | Set MT_WSH priority higher than MT_SVC. Priority must be greater than 0. |
| Message text shows garbled characters | Character set mismatch between Soft Comfort and the LOGO! firmware | In the message text block properties, set Character set to Latin-1. Re-transfer the program. |
| Counter increments twice per piece | Sensor contact bounces, or input is configured for both edges | Add hardware debounce (RC filter 100 nF / 10 kOhm) and verify the Cnt input is set to rising edge only. |
| LOGO! does not respond to Ethernet transfer | PC and LOGO! are on different subnets, or firewall is blocking UDP 1900 | Set the PC IP to 192.168.0.10/24, disable the firewall, and retry. |
| Message text does not show counter value | Counter block reference is wrong, or CV is selected instead of QV | In the message text editor, click Insert -> Tag / I/O status and select the counter CV (analog value), not the QV output. |
| Timers do not start after transfer | Program is in STOP mode on the LOGO! | Press the OK button on the LOGO! front panel, or use Tools -> RUN in LOGO! Soft Comfort. |
| Counter counts even when I2 is low | Counter R input is not driven by I2 inverted | Add a NOT gate to I2 and wire it into the counter R input. |
| LOGO! display shows "No Program" | Program transfer did not complete, or program is corrupted | Re-transfer the program. If the issue persists, use Tools -> Clear Program in LOGO! Soft Comfort, then re-transfer. |
| LOGO! web server is unreachable on 192.168.0.1 | IP address has been changed on the LOGO! | Use the LOGO! front panel to navigate to Network -> IP Address and read the current address. Set the PC to the matching subnet. |
| 15 s timer appears to count from 10 s | Trigger input is wired to TON_1.QV instead of I2 (cascaded timing) | Verify the Trg input of TON_2 is connected to I2. If cascaded behavior is required, document it in the program header comment. |
FAQ
Why does my counter not reset when the power is cycled?
The counter is configured with retention enabled. Open the counter block properties in LOGO! Soft Comfort and clear the Retention checkbox. With retention off, the counter value is stored in volatile RAM and is reset to zero on every power cycle, program stop, and cold restart.
Why are both message texts visible on the LOGO! display at the same time?
The two message text blocks have the same priority. Set the washing-mode message text (MT_WSH) to a higher priority value (for example, 2) and leave the service-mode message text (MT_SVC) at 1. The LOGO! display always shows the active message with the highest priority; lower-priority messages are queued and shown only when the higher-priority message is released.
Can I change the 10 s and 15 s time values from the LOGO! display without a PC?
Yes. In the block properties of each on-delay timer, set the parameter protection to Display + adjust. The time value then appears as an editable parameter on the LOGO! on-board display, and the operator can change it via the LOGO! front-panel cursor keys. The change is stored in volatile memory and is reset on the next power cycle unless retention is enabled on the timer.
How do I add the current counter value to the message text on the LOGO! LCD?
Open the message text block in LOGO! Soft Comfort, click Insert, and choose Tag / I/O status. Select the counter block name and the CV (current value) parameter. The counter value appears in the message text in decimal and updates every LOGO! scan cycle (typically 10 ms to 100 ms depending on the program size).
Why does the 15 s timer start counting from 10 s instead of from zero?
Both on-delay timers share the same reset source (I1 and I2 inverted through an OR gate). If you want the 15 s timer to start only after the 10 s timer has elapsed, change the trigger input of the 15 s timer from I2 to the 10 s timer's QV output. This converts the two parallel timers into a sequential cascade.
How do I prevent the operator from changing the time value on the LOGO! display?
In the on-delay block properties, set the parameter protection to Locked or Password. The Locked option hides the time value entirely on the LOGO! display. The Password option prompts the operator for the LOGO! password before the time value can be edited. Use the Password option for field installations where the operator may need to adjust the time but a full program change must be restricted.