Siemens LOGO! 8 Two-Button Dimmer with Short/Long Press Logic

David Krause12 min read
PLC HardwareSiemensTutorial / 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

1. Overview

The Siemens LOGO! 8 logic module is a compact micro-PLC frequently used for small building-services, machine-control, and lighting-control tasks. One of the most common lighting applications is a 0–10 V dimmer controlled by two momentary push-buttons (UP and DOWN). The required behaviour is:

  • Short press of UP (< 0.5 s) → output jumps to full brightness (level 100).
  • Long press of UP (> 0.5 s) → output ramps up slowly.
  • Short press of DOWN (< 0.5 s) → output jumps to OFF (level 0).
  • Long press of DOWN (> 0.5 s) → output ramps down slowly.

This article resolves the typical open question when programming this application: where exactly must the "set-light-to-100" output (B008) be connected, and how is the same behaviour obtained with a cleaner analog-counter block in LOGO!Soft Comfort V8.3? The solution is built around the LOGO! 8.3 base module plus the LOGO! AM2 AQ analog-output expansion (part number 6ED1055-1MM00-0BA2), which provides the actual 0–10 V signal to the LED-driver or 1–10 V ballast.

2. Hardware Bill of Materials and Terminal Wiring

The base LOGO! 8.3 module does not contain an analog output, so an AM2 AQ module is mandatory for any 0–10 V dimming task.

Component Siemens part number Function in this project
LOGO! 12/24 RCE (with display, FW 8.3) 6ED1052-1MD08-0BA1 CPU, scan, digital inputs
LOGO! 24 CE (no display, FW 8.3) 6ED1052-1FB08-0BA1 Alternative CPU if no display is required
LOGO! AM2 AQ 6ED1055-1MM00-0BA2 Two 0–10 V analog outputs (AQ1, AQ2)
LOGO!Soft Comfort V8.3 6ED1058-0BA08-0YA1 (DVD) or download from SIOS Programming software
Push-button (UP) Any momentary NO, 24 V rated I1
Push-button (DOWN) Any momentary NO, 24 V rated I2
0–10 V LED driver / dimmable ballast Manufacturer specific AQ1 input

Wire the two push-buttons between the LOGO! +24 V terminal and the digital inputs I1 (UP) and I2 (DOWN). The AM2 AQ is snapped to the right of the base module and the analog output terminal AQ1+ / AQ1- is wired to the dim input of the driver. Shield the analog cable if the run exceeds 2 m, and observe the polarity printed on the AM2 AQ front panel (Pin 1 = +, Pin 2 = -).

Polarity reminder: On a LOGO! AM2 AQ, the analog output terminals are marked AQ1+ and AQ1- for channel 1, and AQ2+/AQ2- for channel 2. Reversing them produces a negative output and turns the lamp fully off (or fully on, depending on driver logic) but never at the right brightness.

3. LOGO! 8 Firmware and LOGO!Soft Comfort Version Compatibility

The same program does not transfer cleanly between every LOGO! generation. The version-aware behaviour that matters for the dimmer is summarised below.

Base module firmware LOGO!Soft Comfort Behaviour relevant to this program
LOGO! 8.0 (FS02, 2014) V8.0 or higher Program loads directly.
LOGO! 8.1 / 8.2 (FS04, 2016-2018) V8.1 or V8.2 In LOGO!Soft Comfort, select the target device LOGO! 8 FS4; otherwise the AMx analog blocks cannot be loaded.
LOGO! 8.3 (FS06, 2020+) V8.3 only Older projects containing AMx with open inputs raise a load error; either delete the AMx block or upgrade to V8.3.

Reference: LOGO! 8.3 System Manual and LOGO!Soft Comfort V8.3 Online Help.

AMx rule: A LOGO! 8.3 firmware will refuse to load any program containing an Analog Multiplexer (AMx) block whose unused analog inputs have not been explicitly set to constant 0 or terminated. Replace AMx with the analog counter approach in Section 7 to avoid the load error.

4. Function Block Program Architecture

The full program uses eight to eleven standard LOGO! blocks. The block-numbering convention below matches the user's original file and is preserved here for reference.

Block Type Function Key parameters
B001 On-delay (edge-triggered) Detects long press of DOWN (> 0.5 s) TH = 0.5 s
B002 On-delay (edge-triggered) Detects long press of UP (> 0.5 s) TH = 0.5 s
B003 AND / OR combinator Combines the two long-press flags -
B004 Pulse generator / clock Defines the ramp speed (≈ one count / 200 ms) T = 0.2 s, pulse width 50%
B005 Direction selector Sets up/down direction from long-press flag DIR pin driven by B001/B002
B007 Reset pulse (edge) Resets the counter on short DOWN press R-pin, edge-triggered
B008 Set pulse (edge) Sets the counter to 100 on short UP press S-pin, edge-triggered
B011 Up/Down Counter (or Analog Counter) Holds the dim level (0–100) SV = 100, ON = 100, OFF = 0
Analog output AQ1 Built-in AQ output Scales B011 to 0–10 V Gain = 10, Offset = 0

The 0.5 s threshold is the determining constant of the algorithm. If the threshold is altered, both TH values in B001 and B002 must be updated together.

5. Implementing the Short/Long Press Detection

The 0.5 s threshold is realised with two parallel branches, one per push-button.

  1. Wire I1 (UP) to the input of B002 (on-delay, TH = 0.5 s).
  2. Wire I2 (DOWN) to the input of B001 (on-delay, TH = 0.5 s).
  3. Add a positive edge trigger on the Set (S) input of B008 directly from I1, so that every short release of UP raises a one-cycle pulse.
  4. Add a positive edge trigger on the Reset (R) input of B007 from I2, mirroring the OFF action.
  5. Wire the output of B002 to the Count-up enable input of the counter; wire B001 to the Count-down enable input.
  6. Use the output of the pulse generator (B004) as the count clock for B011, so that the level advances only while a long-press flag is true.

Press-time behaviour mathematically:

  • If t_press < 0.5 s, B001/B002 stay 0. Edge detectors on I1/I2 generate one pulse on B008 (Set) or B007 (Reset).
  • If t_press > 0.5 s, B001/B002 latch at 1. The clock from B004 then counts B011 up or down.
  • If t_press = 0.5 s, the On-delay transition fires exactly once on release. Add a 50 ms hysteresis in B001/B002 to avoid simultaneous Set and Reset.

The number of steps traversed while ramping is computed as:

t_dim  =  (level_target - level_start) × pulse_period
        =  100 × 0.2 s
        =  20 s end-to-end (full off → full on)

Adjust the pulse period in B004 to taste. 0.1 s yields a 10-second ramp; 0.5 s yields 50 s.

6. Wiring the B008 "Set Light to 100" Output

The user's question is specifically: where does the output of B008 connect? The answer is the Set (S) input of B011, not the count input. On the Up/Down Counter (or the Analog Counter) block, the S input loads the parameter SV into CV irrespective of the current value, which is exactly what is required for "go to full brightness instantly".

  1. In the LOGO!Soft Comfort editor, locate B011.
  2. Identify the connector labelled S on the block symbol (top-left input pin).
  3. Click the connector, drag a wire to the output pin Q of B008.
  4. Compile the program (Tools → Compile → PC → LOGO!) and verify that B008 is now listed as connected in the program information window.

Behaviour after connection:

Action on I1 (UP) B008 output B011 CV (counter value) AQ1 voltage
Short press One-cycle pulse Forced to SV = 100 10.0 V (full brightness)
Long press Stays 0 Counts up 1 per 200 ms Rises proportionally
Released 0 Holds last CV Holds last voltage
Common mistake: Connecting B008 to the Count-up (Cu) input instead of Set (S). That makes the lamp jump 1 % per press, not to 100 %. Always confirm with an online observation: in LOGO!Soft Comfort, open Online → Observation, force B011 = SV by toggling B008 manually, and verify that CV = 100 in one cycle.

7. Alternative Implementation: Analog Counter Block

For new programs in LOGO!Soft Comfort V8.3, the cleaner solution is to use the dedicated Analog Counter block (B030–B039 typically) instead of the discrete-edge architecture. The Analog Counter block already provides dedicated Set and Reset inputs and exposes the current value as an analog signal that can be wired directly to AQ.

Parameter Value Meaning
On threshold 100 Maximum counter value (matches AQ scale)
Off threshold 0 Minimum counter value (lamp fully off)
Pulse duration 0.2 s Counts one step every 200 ms while enabled
Direction input 0 / 1 0 = down, 1 = up
Set (S) input From short-press-UP pulse Jumps CV to 100
Reset (R) input From short-press-DOWN pulse Jumps CV to 0
Count (Cnt) input From long-press OR (B003) Enables counting while held

This block eliminates the B008 "where do I connect it" problem because the Set/Reset inputs are visible on the block symbol by default. It also removes the need for AMx multiplexers, which is the source of the LOGO! 8.3 load error discussed in Section 3.

8. 0–10 V Analog Output Scaling

The AM2 AQ module provides two 0–10 V outputs with 10-bit resolution (1024 steps, 1 step ≈ 9.77 mV). LOGO!Soft Comfort exposes the analog value as an integer 0–1000 in the AQ parameter; the hardware scaling is fixed by Siemens.

The B011 value range (0–100) is wired to AQ1 either directly through a scaling Analog Amplifier (gain = 10) or implicitly when B011 is replaced by the Analog Counter described in Section 7. The voltage equation is:

V_AQ1 (V)  =  (AQ_value / 1000) × 10 V
            =  (B011_value / 100) × 10 V
            =  B011_value × 0.1 V

Useful intermediate points:

B011 value AQ1 integer Output voltage Typical LED brightness
0 0 0.00 V Off
10 100 1.00 V 10 %
50 500 5.00 V 50 %
75 750 7.50 V 75 %
100 1000 10.00 V 100 %

Many commercial LED drivers clamp their input below 1 V to off and above 9 V to full on, so B011 = 1 (≈ 0.1 V) may already produce no light. If the lamp never goes fully off, insert an Analog Threshold Switch with ON = 1 and OFF = 0 between B011 and AQ1 to force a binary off state below 1.

9. Commissioning Procedure and Verification

Follow this sequence on first power-up. Each step has a binary pass/fail criterion that can be observed on the LOGO! display or in LOGO!Soft Comfort Online → Observation.

  1. Connect the LOGO! 8.3 base to the PC via Ethernet, set the IP, and click Tools → Transfer → PC → LOGO!. The transfer log must show OK and no AMx warnings.
  2. Switch LOGO! to RUN. The status line on the display should read RUN, not STOP or ERROR.
  3. Short-press I1 (UP). Verify on AQ1 that the voltage jumps to 9.8–10.0 V within one scan cycle. If not, B008 is not wired to B011 S (see Section 6).
  4. Short-press I2 (DOWN). Verify AQ1 = 0.0 V within one scan cycle.
  5. Long-press I1 for 3 s. AQ1 should rise smoothly from 0 to ≈ 1.5 V (15 steps × 0.1 V). At 0.2 s / step, 3 s ≈ 15 steps.
  6. Long-press I2 for 5 s. AQ1 should fall proportionally. Stop short of zero and verify that the counter holds (no drift over 60 s).
  7. Power-cycle the LOGO! and verify whether the dim level is retained. To retain, mark B011 as Remanent in the block properties.
  8. Force a max-brightness event by sending a Set pulse from LOGO!Soft Comfort Online → Simulation to B008. Confirm CV = 100 in the observation panel.

Verification formula for ramp tests:

Expected AQ (V)  =  (t_press - 0.5 s) / pulse_period × 0.1 V
                 =  (3.0 - 0.5) / 0.2 × 0.1
                 =  1.25 V (within ±0.1 V tolerance)

10. Troubleshooting Matrix

Observed symptom Likely root cause Corrective action
Short UP press raises the lamp only by 1 % B008 wired to Count input (Cu) instead of Set (S) Move the wire from Cu pin to S pin on B011
Lamp never goes fully off Driver interprets < 1 V as 1–10 V low-end dimming Insert Analog Threshold Switch before AQ1 or use a 1–10 V driver with explicit OFF contact
Lamp flickers during ramp Pulse period too small for the driver's update rate Raise B004 period to ≥ 0.1 s; verify driver supports ≥ 100 Hz dim input
Program refuses to load on LOGO! 8.3 AMx block has open analog inputs Replace AMx with the Analog Counter block (Section 7)
Both long presses dim the lamp up Direction (Dir) pin of B011 is hard-wired high Wire Dir to the output of the direction selector (B005)
Dim level resets to 0 every power-cycle B011 not flagged as remanent Open B011 properties → tick Remanence = On
AQ1 always reads 10 V Counter is stuck at SV; Set input is continuously high Add a positive edge trigger on the B008 path
AQ1 always reads 0 V Reset input permanently high or output amplifier gain is 0 Check I2 wiring; check amplifier gain in the signal chain to AQ1
LOGO! stays in STOP after transfer Program exceeds 400-block limit of the base module Reduce block count; remove unused AMx instances
Display shows "Error: Block B011" B011 Set and Reset simultaneously asserted Add 50 ms hysteresis between B007 and B008

Additional diagnostics are available in LOGO! 8 System Manual (entry ID 109741041), specifically chapters 4.4 (function blocks) and 7 (analog value processing).

11. Frequently Asked Questions

Where exactly must B008's output be connected in the dimmer program?

B008's output must be wired to the Set (S) input pin of the B011 counter block. The Set input forces the current value (CV) to the configured set value (SV = 100) in a single scan, which is what is required for "short UP press → lamp to 100 % instantly".

Why does the program refuse to load on a LOGO! 8.3 with an "AMx open" error?

LOGO! 8.3 firmware (FS06) added a stricter check on Analog Multiplexer (AMx) blocks. If an analog input is left open, the controller rejects the program at transfer. The cleanest fix is to replace the AMx block with the dedicated Analog Counter block, which has explicit Set and Reset inputs and exposes the count directly as an analog signal.

How is the 0.5 s short/long press threshold implemented?

Two on-delay blocks (B001, B002) with TH = 0.5 s are placed on the I1 (UP) and I2 (DOWN) lines. Their outputs are interpreted as "long press active", while the rising edge of I1 and I2 feeds the Set/Reset inputs of the counter for the "short press" action.

Can the AM2 AQ output be scaled 0–100 % even though the LOGO! AQ range is 0–1000?

Yes. Insert an Analog Amplifier with Gain = 10 between the B011 counter and the AQ1 output. The amplifier converts the 0–100 counter range to the 0–1000 AQ range, and the AM2 AQ hardware then produces 0–10 V at 9.77 mV / LSB.

How do I retain the last dim level across a power-cycle?

Open the B011 (or Analog Counter) block properties and tick Remanence = On. LOGO! 8 stores the current value in non-volatile memory on STOP and reloads it on next RUN. Without this flag, CV always returns to 0 on power-up.

Back to blog