1. Problem Statement: Live AI1 to a Retentive MUX Path
The application is a Siemens LOGO! 8 logic module that needs to read a live analog signal on AI1 and feed it into the on-board Analog Multiplexer (MUX) function block in LOGO! Soft Comfort. The current workaround uses an intermediate block (typically an Analog Amplifier or Math instruction) that does not retain its output when the controller is powered down or switched to STOP. The user requirement is unambiguous: the value presented to the MUX must be either
- tracked live from AI1 during RUN, and
- retained across power-cycle / STOP-RUN transitions, or
- sampled on a digital trigger (button, edge flag) and held.
The official LOGO! documentation classifies function-block output behavior under retentivity: any block whose output is flagged as retentive keeps its last computed value when the program restarts, while non-retentive outputs are reset to their initialization value (typically 0). The MUX block itself has four Ax inputs, an S selector, and a single AQ output. None of the MUX inputs is intrinsically retentive; retentivity must be enforced on the source that drives the chosen MUX input.
2. LOGO! 8 Hardware and AI1 Specifications
The relevant Siemens LOGO! 8 base modules that expose AI1 are listed below. Order numbers follow the Siemens catalog and the LOGO! manual set on the Siemens Industry Online Support portal.
| Module | Order Number | AI Count | AI1 Range | Resolution |
|---|---|---|---|---|
| LOGO! 8.1 12/24V (no display) | 6ED1052-1CC08-0BA1 | 4 (AI1-AI4) | 0-10 V | 10 bit (0-1000) |
| LOGO! 8.1 12/24V (display) | 6ED1052-2CC08-0BA1 | 4 | 0-10 V | 10 bit |
| LOGO! 8.2 24V (no display) | 6ED1052-1MD08-0BA1 | 4 | 0-10 V / 0-20 mA / 4-20 mA | 10 bit |
| LOGO! 8.2 24V (display) | 6ED1052-2MD08-0BA1 | 4 | 0-10 V / 0-20 mA / 4-20 mA | 10 bit |
| LOGO! 8.3 230V (no display) | 6ED1052-1FB08-0BA1 | 4 | 0-10 V (via ext. divider) | 10 bit |
| LOGO! 8 AM2 expansion | 6ED1055-1MA00-0BA2 | +4 (AI5-AI8) | 0-10 V / 0/4-20 mA | 10 bit |
| LOGO! 8 AM2 RTD | 6ED1055-1MD00-0BA2 | +2 (Pt100/Pt1000) | -50 to +200 °C | 16 bit |
For the MUX path, only the first 4 analog values (Ax) on the function block are usable. The MUX output AQ is a 10-bit word (0-1000 normalized). For current-loop sensors, route the 0-20 mA or 4-20 mA signal into a 12 Ω sense resistor on AI1 to obtain 0-240 mV / 48-240 mV and use the LOGO! analog amplifier scale block to linearize.
3. Prerequisites
- LOGO! 8 base module (6ED1052-xC/2xC08-0BA1 family) or higher.
- LOGO! Soft Comfort V8.0 or later (V8.4 recommended). Download from the Siemens Industry Online Support portal under entry ID 109751049.
- LOGO! firmware ≥ V8.0.x (matching the Soft Comfort release).
- Active Ethernet or micro-SD programming cable to transfer the project.
- An analog source wired to
AI1(potentiometer, 4-20 mA transmitter, 0-10 V sensor, or thermocouple via AM2 RTD). - For the hardware-mux path: a CMOS analog mux such as the Texas Instruments CD74HC4067 or Analog Devices LTC1043, a decoupling capacitor (100 nF + 10 µF), and a 1 % reference resistor.
4. Understanding the MUX (Analog Multiplexer) Block
The MUX block selects one of four analog inputs (Ax1...Ax4) and forwards it to AQ based on a two-bit selector S:
| S = 0 | S = 1 | S = 2 | S = 3 |
|---|---|---|---|
| AQ = Ax1 | AQ = Ax2 | AQ = Ax3 | AQ = Ax4 |
The MUX itself has no retentivity flag, no edge detection, and no scaling. All intelligence must live in the source block driving the chosen Ax. Wiring topology:
5. Retentivity in LOGO! Function Blocks
Retentivity in LOGO! is per-block and per-output. Open the block in the FBD editor, click the block body to enter properties, and tick the Retentive check-box in the Output group. The following blocks support retentive outputs as of LOGO! Soft Comfort V8.x:
| Block | Retentive Output? | Notes |
|---|---|---|
| On/Off Delay | Yes | Time accumulator is retained |
| Retentive On Delay | Yes (intrinsic) | No extra flag needed |
| Pulse Relay | Yes | Edge memory retained |
| Counter | Yes | CV is retained |
| Max/Min | Yes (Mode 3 hysteresis) | Internal peak/valley held |
| Analog Amplifier | Yes | Output value retained |
| Math (advanced) | Yes | Output retained |
| Set/Reset Latch | Partial | Only with retentive RS |
| Shift Register | Yes | Bit pattern retained |
| PI Controller | No | Integrator re-zeros on RUN |
| PID (V8.2+) | No | Manual mode persists |
After enabling retentivity, the value survives a STOP->RUN transition, a power loss, and a download of a new program only if the Retain memory on power failure option is set in the LOGO! hardware menu (LOGO! display path: Setup > Retain). On a micro-SD card, the file LOGO_RET.DAT stores the retained state at shutdown; on the 8.3 firmware this is automatic and does not need user action.
6. Solution A: Max/Min Block in Mode 3 (Hysteresis Tracking)
The Max/Min block is the most direct answer when the user requested "a block with retentivity." It has three operating modes:
| Mode | Function | Use Case |
|---|---|---|
| 1 | Maximum tracker | Latch the highest AI1 ever seen |
| 2 | Minimum tracker | Latch the lowest AI1 ever seen |
| 3 | Hysteresis tracker | Follow AI1, hold if change is < Hyst |
Mode 3 is the correct mode for "live but stable" tracking. The block continuously samples Ax and updates its output only when the input differs from the stored value by more than the hysteresis threshold. The internal peak/valley registers are retentive, so the value persists across power cycles.
Implementation steps in LOGO! Soft Comfort:
- Insert a Max/Min block (function group Analog).
- Wire
AI1toAx. - Open block properties, set Mode = 3.
- Set Hy = 5 (units are 1/1000 of full scale = 5 LSBs = 50 mV on 0-10 V). Lower values follow the input more closely; higher values give a noise-immune latched reading.
- Tick Retentive output.
- Connect the
AQof the Max/Min block to one MUX input (e.g.Ax1).
Why the "goes to last last value" symptom appears: if the user left the block in Mode 1 or Mode 2, the output only ever increases (or decreases) and never returns to the current AI1. Mode 3 with a small hysteresis is the cure.
7. Solution B: Analog Amplifier with Retentive Output
When the application requires the MUX to read the most recent AI1 sample at the moment a digital trigger fires, the analog amplifier with a retentive output is the cleanest path:
- Insert an Analog Amplifier block.
- Wire
AI1toAx. - Set gain
Gand offsetOfor sensor linearization (e.g.G = 1.0,O = 0for a 0-10 V -> 0-1000 pass-through). - Tick the Retentive check-box. The block then behaves like a sample-and-hold whose latch value is the last value the amplifier produced before the LOGO! transitioned out of RUN.
The amplifier is faster than the Max/Min block (no hysteresis) and does not modify the value at all. It is the right pick when the MUX should see the exact AI1 value at all times and only need retention on power-down.
8. Solution C: Set/Reset Latch Driving a Sample-and-Hold
For a true "capture on button press" workflow, build a small state machine:
- Insert an Edge-triggered pulse (rising edge of
I1) to a 1-cycle trigger. - Insert a Set/Reset Latch (RS) with the pulse on the
Sinput and a power-on reset flag on theRinput. - Use the latch output to enable an Analog Multiplexer at the front of the path: when the latch is
1, AI1 is routed; when0, a constant0is routed, but a retentive analog amplifier placed on the AI1 branch holds the last value. - Wire the amplifier output to the MUX
Ax1input.
This pattern is field-proven for operator set-point entry where the operator turns a potentiometer, presses a button, and walks away.
9. Hardware MUX Alternative (External Analog Switch)
If the LOGO! 8 has only one usable AI channel in the physical location of the cabinet and multiple sensors must share it, an external CMOS analog MUX is appropriate. Two industry-standard parts:
| Part | Manufacturer | Channels | On-Resistance RDS(on) | Bandwidth | Logic Supply |
|---|---|---|---|---|---|
| CD74HC4067 | Texas Instruments | 16:1 / 8:2 / 4:1 | 70 Ω typ | 200 MHz | 2-6 V (5 V tolerant AI) |
| LTC1043 | Analog Devices | 2:1 (dual) | < 240 Ω | DC coupled, chopper | Self-powered, no logic supply |
| MUX36S16 | Texas Instruments | 16:1 / 8:2 | 125 Ω typ | 500 MHz | 1.8-5.5 V |
| ADG726 | Analog Devices | 16:1 dual | 4 Ω typ | 200 MHz | 1.8-5.5 V |
For 4-20 mA loops the LTC1043 is preferred because it uses switched-capacitor techniques to pass current directly without a logic-level supply, eliminating a common ground-loop failure mode. The CD74HC4067 needs a 5 V rail and four selection bits; the selection bits can come from LOGO! digital outputs Q1..Q4.
Two application references for sizing the upstream divider are the DigiKey tutorial on analog switch resource sharing and the Analog Devices ADALM1000 LTC1043 user guide. Both are useful for the part-selection and grounding discussion that follows when adding a MUX in front of AI1.
10. Step-by-Step Implementation in LOGO! Soft Comfort
The reference path uses Solution A (Max/Min Mode 3) because it is the smallest block count and ships with all V8.x firmwares.
- Open LOGO! Soft Comfort, create a new project, select target "LOGO! 8 (6ED1052-xxx08-0BA1)".
- Drag an Analog MUX block from the analog group. Position it in the right pane.
- Drag a Max/Min block. Place it to the left of the MUX.
- Connect
AI1(left toolbar, "Inputs" tab) to theAxpin of the Max/Min block. - Connect the
AQpin of the Max/Min toAx1of the MUX. - Connect
I1andI2toSof the MUX (two-bit selector). - Double-click the Max/Min block. Set Mode = 3, Hy = 5. Tick Retentive in the Output group. Click OK.
- From the menu Tools > Simulation, run the simulation. Sweep
AI1from 0 to 1000 and watchAQfollow it within the 5-LSB hysteresis band. Stop and re-run the simulation; the value should be retained. - Compile the project (File > Compile) and download via Ethernet or micro-SD.
- On the LOGO! display, navigate to
Setup > Retainand confirm Memory = On.
...08-0BA1 family).11. Verification and Commissioning
Run the following checks on the live controller before returning to service:
| # | Check | Pass Criterion |
|---|---|---|
| 1 | Apply 0 V to AI1, observe MUX AQ (Ax1 path) | AQ = 0 ± 1 LSB |
| 2 | Apply 5.00 V to AI1 | AQ = 500 ± 5 |
| 3 | Apply 10.00 V to AI1 | AQ = 1000 ± 5 |
| 4 | Toggle LOGO! to STOP, wait 5 s, toggle back to RUN | AQ holds the last value (retentive) |
| 5 | Power down for 30 s, power up | AQ = last value (if Retain is enabled) |
| 6 | Change S from 0 to 3 and back | AQ = AI1 only when S = 0; holds when S ≠ 0 and another path drives the active MUX input |
| 7 | Check LOGO! webserver / LOGO! Access Tool trend | AI1 trace and MUX AQ trace overlap within hysteresis |
12. Troubleshooting Matrix
| Symptom | Likely Cause | Fix |
|---|---|---|
| AQ = 0 in RUN | Source block not retentive; reset on RUN | Tick Retentive on the Max/Min or Amplifier block |
| AQ sticks at maximum | Max/Min left in Mode 1 (max only) | Set Mode = 3 (hysteresis) and tune Hy |
| AQ = AI1 but jumps erratically | Sensor noise > hysteresis | Raise Hy to 10-20 LSB; add 100 nF + 10 µF on AI1 |
| AQ resets after power-down | Retain disabled in LOGO! setup | LOGO! display: Setup > Retain > On |
| AI1 reads low only on MUX path | External mux RDS(on) loading AI1 | Use a lower-RDS(on) mux (ADG726) or buffer with op-amp follower |
| AQ drifts when S changes | Adjacent Ax not initialized | Drive unused Ax with a constant 0 from a retentive Amplifier |
| AI1 saturates at 1023 | Sensor output > 10 V | Add a 2:1 resistive divider (10 kΩ / 10 kΩ) ahead of AI1 |
| LOGO! Soft Comfort compile error "B027: output AQ not assigned" | Source block not driving any MUX input | Reconnect Max/Min AQ -> MUX Ax1 |
| Online monitor shows AQ frozen | AI1 not in the configured range (e.g. 4-20 mA on a 0-10 V module) | Confirm module variant matches sensor type, or re-scale in the Amplifier |
13. Related Considerations
- Scan-time effect: the LOGO! 8 cycle is typically 5-20 ms depending on program size. The Max/Min hysteresis should be larger than 1 LSB * dV/dt * cycle_time to avoid thrashing.
- Numerical resolution: with 10-bit ADC and a 10 V input, 1 LSB = 9.77 mV. Set Hy ≥ 5 LSBs (about 50 mV) for a robust hold.
-
Webserver / LOGO! Access Tool: live trending of
AI1and MUXAQis available in V8.3 firmware and later. Use it to verify the four commissioning checks above without a scope. - Migration: on LOGO! 8.4 / Soft Comfort V8.4, the analog blocks gained a parameter Initial value on cold start. Use it to set a known-good value when retentive memory is intentionally disabled.
14. Frequently Asked Questions
Why does the MUX block not have a retentive output of its own?
The MUX block in LOGO! Soft Comfort is a pure selector with no internal state. Retentivity must be applied to the source block that drives the chosen Ax input, such as the Max/Min (Mode 3) or Analog Amplifier with the Retentive flag enabled.
Which Max/Min mode keeps a live value with retentivity?
Mode 3 (hysteresis tracker) follows AI1 but latches the value whenever the input changes by less than the configured Hy threshold. Tick Retentive output in the block properties to retain the latch value across STOP-RUN and power cycles.
What value of hysteresis should I set for a 0-10 V AI1 on LOGO! 8?
Start with Hy = 5 (about 50 mV on a 0-10 V, 10-bit input). Increase to 10-20 LSBs for noisy sensors or for longer cycle times above 10 ms.
Can I add an external analog mux like the CD74HC4067 in front of AI1?
Yes. Drive the four selection inputs of the CD74HC4067 from LOGO! outputs Q1..Q4 and use a 5 V supply. Budget the 70 Ω typical on-resistance against the 72 kΩ AI1 input impedance to keep the divider error below 1 LSB. For 4-20 mA loops use the LTC1043 which needs no logic supply.
My AQ resets to 0 after every power-down. What setting is missing?
Open the LOGO! display menu Setup > Retain and set Memory = On. Also confirm that the source block (Max/Min or Analog Amplifier) has its Retentive flag ticked in the LOGO! Soft Comfort block properties.