Siemens LOGO! 8 PT100 Window Comparator with Spare 0-10 V AQ

David Krause19 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

Application Overview

A Siemens LOGO! 8 logic module supervises a glycol-cooled bath that combines continuous refrigeration with on-demand resistive heating. The compressor runs constantly; an immersion heater is energized only when the bath must be warmed toward setpoint. The operator enters the temperature setpoint through a counter value, and a PT100 RTD on AI3 of an AM2 RTD expansion module returns the measured bath temperature. A spare 0-10 V analog output (AQ1) on an AM2 AQ expansion is repurposed as a "correct temperature" indicator by driving an external 24 V LED panel through a current-limiting resistor.

The required behavior is a one-degree window comparator that fires AQ1 to 100 % (10.0 V) only when the measured value lies inside a ±1.0 °C band centered on the setpoint. Outside the band, AQ1 must fall to 0 % (0.0 V). The full operating range is -20.0 °C to +30.0 °C, so the logic must accept negative setpoints and remain stable across the zero crossing.

Setpoint (counter CV) Measured (AI3) |Deviation| AQ1 output LED state
+20.0 °C +20.0 °C 0.0 °C 10.0 V (100 %) ON
+20.0 °C +19.0 °C 1.0 °C 10.0 V (100 %) ON
+20.0 °C +18.5 °C 1.5 °C 0.0 V (0 %) OFF
+20.0 °C +21.5 °C 1.5 °C 0.0 V (0 %) OFF
-5.0 °C -4.5 °C 0.5 °C 10.0 V (100 %) ON
-5.0 °C -6.5 °C 1.5 °C 0.0 V (0 %) OFF

Prerequisites

Before implementing the logic, confirm that the following hardware and software are available and that the installed firmware supports signed counter values.

  • LOGO! 8 base module with Ethernet interface, catalog 6ED1052-1xx08-0BA1 (LOGO! 8) or 6ED1052-1xx08-0BA2 (LOGO! 8.3/8.4). Firmware ≥ 8.1.0 is recommended so the counter block supports signed actual values.
  • LOGO! AM2 RTD expansion, catalog 6ED1055-1MD00-0BA2, for two PT100/PT1000/Ni1000 inputs. AI3 of the AM2 RTD occupies the third analog word in the process image when the module is fitted in slot 1.
  • LOGO! AM2 AQ expansion, catalog 6ED1055-1MM00-0BA2, for two configurable 0-10 V or 4-20 mA outputs. AQ1 occupies the first analog output word when fitted in slot 2.
  • PT100 Class A or Class B sensor wired in 3-wire configuration to the AM2 RTD (2-wire and 4-wire are also supported; see the LOGO! 8 manual).
  • LOGO! Soft Comfort V8.3 SP1 or later, catalog 6ED1058-0BA08-0YA1, for FBD programming, online monitoring, and program download.
  • Operator panel or LOGO! TDE feeding the setpoint counter value, or a local Up/Down counter wired to discrete inputs.
  • 24 V LED indicator with series current-limiting resistor sized for the AQ pin: R = (10 V - V_F) / I_F. For a typical 20 mA red LED (V_F ≈ 2.0 V), R ≈ 390 Ω ¼ W is standard.
Note on AQ loading: The AM2 AQ in 0-10 V mode requires a minimum load impedance of 5 kΩ and can source up to 20 mA per channel. A standard indicator LED draws 5-20 mA and presents negligible impedance relative to 5 kΩ, so direct drive from the AQ pin through a series resistor is acceptable. Do not connect inductive loads (relays, solenoids) directly to an AQ pin.

Hardware Configuration and Wiring

Mount the modules on the DIN rail in the order base-AM2 RTD-AM2 AQ. Slot numbering in LOGO! 8 is left-to-right; the analog I/O tags AI1...AI4 and AQ1, AQ2 populate automatically when the modules are dragged into the project tree at the correct position. Verify by selecting Tools > Select Hardware in LOGO! Soft Comfort and confirming the I/O map matches the physical layout.

Slot Module Catalog number Digital I/O Analog I/O
0 (base) LOGO! 8 230 RCE 6ED1052-1HF08-0BA1 DI1-DI8 / DQ1-DQ4 AI1, AI2 (0-10 V)
1 AM2 RTD 6ED1055-1MD00-0BA2 — AI3, AI4 (PT100/PT1000)
2 AM2 AQ 6ED1055-1MM00-0BA2 — AQ1, AQ2 (0-10 V or 4-20 mA)
LOGO! 8 base230 RCE AM2 RTD6ED1055-1MD00 AM2 AQ6ED1055-1MM00 LED panel24 V / 20 mA PT100 sensor3-wire Operator TDsetpoint AI3 Counter CV AQ1 0/10 V

Figure 1 — Hardware topology. The base LOGO! 8 receives the operator setpoint and the PT100 sensor signal; AQ1 of the AM2 AQ drives the LED panel.

PT100 wiring on the AM2 RTD:

  1. Connect one PT100 lead to terminal M1+.
  2. Connect the second PT100 lead to terminal M1-.
  3. Connect the third (return) lead to terminal IC1 for 3-wire lead-resistance compensation. For a 2-wire sensor, jumper M1- to IC1.
  4. Repeat for the second channel (M2+, M2-, IC2) if a redundant sensor is fitted.

Refer to the LOGO! 8 System Manual for the exact terminal diagram and for 4-wire variants.

Signal Path: PT100 Scaling in the AM2 RTD

The AM2 RTD module performs linearization and lead-resistance compensation internally when configured in LOGO! Soft Comfort. The analog value presented on AI3 is already scaled in 0.1 °C units over the configured measurement range. The default PT100 range on the AM2 RTD is -50.0 °C to +200.0 °C, which fully covers the application's -20 °C to +30 °C window. The 12-bit ADC combined with internal scaling delivers a numeric resolution of approximately 0.07 °C per LSB over the standard range; an effective step of 0.1 °C is exposed to the user program.

AI3 property Setting Comment
Sensor type PT100 Dropdown selection
Sensor connection 3-wire Compensates lead resistance
Temperature unit °C Internal scaling in 0.1 °C units
Smoothing None or 4-sample average Use averaging if the bath shows fast fluctuations
Resulting AI3 range -500 to +2000 (integer) Direct mapping to -50.0 °C to +200.0 °C
Numeric resolution: AI3 returns an integer in units of 0.1 °C. A measured bath temperature of +19.0 °C is reported as 190; +20.0 °C is 200; -5.0 °C is -50. All setpoint offsets and thresholds must be entered in 0.1 °C units. A one-degree band equals a numeric threshold of 10 units.

Setpoint Source: Signed Counter and VM Mapping

The operator enters the setpoint through a counter block whose actual value (CV) is used as an integer reference. In LOGO! 8 the Counter block (C001...C024) maintains an actual value that can be used directly as a signed setpoint. To support the application's negative temperature range, configure the counter as follows:

Property Setting
Function Up/Down counter
Setpoint (SV) 0 (used only as threshold; not relevant here)
Threshold Adjustable via TD/HMI
With sign Enabled (firmware ≥ 8.1.0)
Inputs Cnt → DI1; Dir → DI2; Reset → DI3
CV range -32768 to +32767 in signed mode

If signed counter mode is unavailable on the installed firmware, route the setpoint through an analog marker or VM (Variable Memory) address that supports negative values. LOGO! 8 AM and VM addresses are signed 16-bit (-32768 to +32767):

  1. Place a Numeric Input block on the function diagram.
  2. Set the data range to -200 to +300 (covering -20.0 °C to +30.0 °C in 0.1 °C units).
  3. Bind the value to a VM address via VM mapping.
  4. Reference the VM address as the setpoint in the comparator arithmetic.

An operator entry of "20.0" must place the value 200 into the counter or VM; "-5.0" must place -50.

Window Comparator Architecture

The required behavior is a two-sided threshold test on the deviation between setpoint and measured value. The condition for LED-ON is:

|AI3 − Setpoint| ≤ 10 (i.e. ±1.0 °C)

Equivalently, two simultaneous inequalities must hold:

AI3 ≥ (Setpoint − 10) AND AI3 ≤ (Setpoint + 10)

This is a classic analog window comparator. LOGO! 8 does not provide a single absolute-value block, so the dual-comparator + AND architecture is the idiomatic implementation. Each comparator can be tuned independently with its own hysteresis parameter, which makes the logic easy to debug and easy to verify against the requirements table above.

Counter C001 AI3 (PT100) CV -200…+300 AR01: SP − 10 AR02: SP + 10 AC01: AI3 ≥ (SP−10) AC02: AI3 ≤ (SP+10) AND (B003) AQ1 0/10 V

Figure 2 — Window comparator signal flow. AI3 and the counter CV feed two arithmetic blocks that compute the band edges; the analog comparators generate Q01 and Q02, which the AND gate combines into the band flag that drives AQ1.

LOGO! Soft Comfort Implementation

Step-by-step procedure to build the comparator in LOGO! Soft Comfort V8.3 SP1:

Step 1 — Insert the analog input

From the toolbar, drag AI3 onto the function diagram. Right-click and confirm that the input is mapped to the AM2 RTD channel. The tag AI3 is sourced at runtime with the integer value 190 for +19.0 °C.

Step 2 — Insert the counter

Drag a Counter block (special functions palette) onto the diagram. Configure as Up/Down, assign Cnt to a discrete input wired to the operator panel's increment pushbutton, Dir to a second input wired to decrement, and Reset to a third input for clearing the setpoint. Enable signed mode if available; otherwise route the value through VM mapping.

Step 3 — Compute the lower and upper bounds

Place two Arithmetic blocks (AR01 and AR02) on the diagram. Configure each as follows:

Block Function Input A Input B Gain Offset Output
AR01 Subtraction (A − B) Counter CV 10 1 0 AM01 = Setpoint − 10
AR02 Addition (A + B) Counter CV 10 1 0 AM02 = Setpoint + 10

The constant 10 represents the 1.0 °C band width in 0.1 °C units. To change the band width, replace 10 with the equivalent integer (5 for 0.5 °C, 20 for 2.0 °C).

Step 4 — Insert the analog comparators

Place two Analog Comparator blocks from the special functions palette:

Block Function Ax Ay Hysteresis Output Q
AC01 A ≥ B AI3 AM01 (SP − 10) ±0.3 °C (3 units) Q01
AC02 A ≤ B AI3 AM02 (SP + 10) ±0.3 °C (3 units) Q02

The hysteresis parameter prevents output chatter when AI3 dithers around the band edge. With ±0.3 °C hysteresis, Q01 rises when AI3 crosses Setpoint − 10 + 3 = Setpoint − 7 (i.e. +18.7 °C when setpoint is +20.0 °C) and Q02 falls when AI3 crosses Setpoint + 10 + 3 = Setpoint + 13 (i.e. +21.3 °C when setpoint is +20.0 °C).

Step 5 — AND the comparator outputs

Place an AND block (B003 in the basic functions palette). Connect Q01 to its first input and Q02 to its second input. The output Q03 is the boolean band flag.

Step 6 — Drive AQ1 from the boolean flag

The AM2 AQ expects an analog value in the range 0 to 1000 (corresponding to 0 % to 100 % of the configured output range, i.e. 0-10 V). The boolean Q03 must be converted to either 0 or 1000. Two methods are available.

Method A — Arithmetic block conversion (recommended):

  1. Place an Arithmetic block AR03 with Function = Multiplication (A × B).
  2. Input A = Q03 (interpreted as 0 or 1).
  3. Input B = 1000 (constant).
  4. Gain = 1, Offset = 0.
  5. Output AM03 = 0 or 1000.
  6. Open AQ1 properties in the project tree. Set the reference source to AM03.

Method B — Direct digital flag mode:

  1. Open AQ1 in the project tree and select Use digital flag (0 / 100 %).
  2. Choose Q03 as the flag source.
  3. Verify the firmware release notes if the option does not appear — it is supported in LOGO! Soft Comfort V8.2 and later.

With either method, AQ1 produces 10.0 V when Q03 = 1 (within band) and 0.0 V when Q03 = 0 (outside band).

Boolean-to-Analog Conversion for AQ1

A common stumbling block is that an AQ pin cannot be driven directly by a boolean flag. The AQ channel always interprets its reference as an integer in the range 0-1000 representing 0 %-100 % of the configured physical range. Skipping the boolean-to-analog conversion is the most frequent reason for an unexpected mid-range voltage at the AQ pin (e.g. AQ1 stuck at 5 V).

The recommended conversion path is the Arithmetic block with Function = Multiplication, Gain = 1, Offset = 0, Input A = Boolean flag (0 or 1), Input B = 1000. This produces AM = 0 when the flag is low and AM = 1000 when the flag is high. Assign AQ1 to AM. Method B (the digital flag mode of AQ1) achieves the same result internally and is preferred in LOGO! Soft Comfort V8.2 and later.

Verification tip: When the band is satisfied, AQ1 should measure 9.95 V to 10.05 V against a calibrated multimeter. If AQ1 measures any intermediate value (e.g. 5 V, 2 V, 7 V), the boolean-to-analog conversion is missing or the AM03 reference is sourced from an unintended block.

Hysteresis and Anti-Chatter Tuning

The window comparator architecture provides two independent opportunities for hysteresis. Each analog comparator block has a configurable hysteresis parameter; a typical setting is ±0.3 °C (3 in 0.1 °C units). Increasing the hysteresis:

  • Reduces LED flicker near the band edges by widening the gap between the rising-edge trigger and the falling-edge trigger.
  • Widens the effective "ON" region in the temperature space (the LED stays lit across a slightly wider band).

For a glycol bath that drifts at < 0.05 °C/s, hysteresis of 0.2 °C to 0.5 °C is appropriate. Faster-changing systems (e.g. high-mass reactors with rapid heating) may need up to ±1.0 °C, but excessive hysteresis defeats the purpose of the indicator. The 4-sample AI3 smoothing option in the AM2 RTD configuration complements the hysteresis and should be enabled in noisy environments.

When adjusting hysteresis, view the comparator outputs Q01 and Q02 independently in the LOGO! Soft Comfort online watch window. If Q01 or Q02 oscillates faster than 1 Hz when AI3 is near a band edge, increase that comparator's hysteresis until the oscillation stops. A clean transition is mandatory for an operator-visible indicator.

Verification and Commissioning Procedure

Once the program is downloaded to the LOGO! 8, perform the following commissioning sequence. Each step is mandatory; do not sign off the system until every step passes.

  1. Online watch setup. Connect LOGO! Soft Comfort to the running LOGO! via Ethernet. Open Online > Watch and add tags AI3, AM01, AM02, Q01, Q02, Q03, and AQ1. Verify the values change in real time as the counter is adjusted.
  2. Force setpoint +20.0 °C (counter CV = 200). Manually heat or cool the bath and verify the LED transitions at the expected boundaries: AI3 < +18.7 °C → LED OFF; +18.7 °C < AI3 < +21.3 °C → LED ON; AI3 > +21.3 °C → LED OFF. Allow several minutes for the bath to settle across each boundary.
  3. Measure AQ1 with a multimeter: 9.95 V to 10.05 V when the LED is on, < 50 mV when the LED is off. If AQ1 shows an intermediate voltage, the AM03 reference is incorrect or Q03 is floating.
  4. Negative range test. Force counter CV = -50 (representing -5.0 °C). Verify AM01 = -60 and AM02 = -40 in the online watch. Adjust the bath temperature to -5.0 °C and confirm the LED is on; adjust to -6.5 °C and confirm the LED is off.
  5. Edge chatter test. Bring the bath temperature slowly toward the lower band edge at < 0.02 °C/s. Verify the LED transitions cleanly without flicker. If chatter occurs, increase both comparators' hysteresis to 0.5 °C (5 units) and re-test.
  6. Sensor fault test. Disconnect the PT100 from the AM2 RTD terminals. LOGO! AI3 should report an out-of-range value (typically -1000 or +10000). AQ1 must drop to 0 V. If AQ1 stays at 10 V, the comparator logic is not evaluating correctly during the fault; verify that the out-of-range value is outside the AM01-AM02 band.

Document each step's result in the commissioning log. The LOGO! web server (built into firmware ≥ 0BA8) can be enabled to allow remote monitoring of AI3 and AQ1 from any browser at http://<logo-ip>; use this for unattended verification.

Edge Cases: Negative Temperatures and Sensor Faults

When the setpoint is negative, the lower-bound arithmetic Setpoint − 10 is also negative, and AI3 returns signed integers. LOGO! 8 arithmetic blocks treat signed inputs correctly as long as the firmware is ≥ 8.1.0. Verify by entering test setpoints of -50, 0, and +200 and confirming the comparator outputs behave as expected.

For setpoints near zero (e.g. -5 °C and +5 °C are both legitimate), the band crosses the zero point. Test that AR01 and AR02 produce the correct signed results (e.g. setpoint = -50, AM01 = -60, AM02 = -40). Use LOGO! Soft Comfort's Online > Watch view to step through the values.

When the PT100 sensor fails open or short, the AM2 RTD drives AI3 to its rail value (typically -1000 or +10000). Both comparators will report false, Q03 falls, and AQ1 drops to 0 V. The behavior is fail-safe (LED OFF) by construction. To add a dedicated sensor-fault alarm, wire AI3 to a third analog comparator with Ay = -50 °C and Ay = +200 °C band edges; a fault outside the sensor range raises the alarm flag.

Alternative Architectures

Single comparator with absolute deviation

Some engineers prefer to compute the absolute deviation |AI3 − Setpoint| with a single chain and feed it to one comparator with a threshold of 10. This requires two arithmetic blocks, an absolute-value trick, and an analog multiplexer:

  1. AR01: A − B = AI3 − Setpoint → AM01 (signed).
  2. AR02: B × Gain = AM01 × -1 → AM02 (negated).
  3. MUX01: select max(AM01, AM02) → AM03 (the absolute value).
  4. AC01: AM03 ≤ 10 → Q01 (band flag).
  5. Drive AQ1 from Q01 via Method A or B above.

This uses four blocks instead of two comparators + AND (five blocks), but the logic is easier to read for engineers unfamiliar with LOGO!'s analog comparator blocks. It also loses the independent per-edge hysteresis, which is its main drawback.

PWM-style proportional indication

If a proportional indication is desired (e.g. LED brightness proportional to deviation), use LOGO!'s PWM function block instead of an analog AQ. Connect the comparator output to the PWM enable input and the deviation magnitude (AM03 from the architecture above) to the PWM duty-cycle input. The LED brightens as the bath temperature approaches setpoint and dims as it drifts away.

Networked variant (LOGO! 8.3 / 8.4)

If the LOGO! is networked (firmware 0BA2 with Ethernet), expose AI3, AQ1, and Q03 as network variables. A remote SCADA can then read the actual temperature, the band flag, and the analog output simultaneously. Refer to the LOGO! 8.3 Upgrade Notes for the network variable configuration procedure.

Troubleshooting Matrix

Symptom Likely cause Remediation
AQ1 stays at 0 V regardless of temperature AI3 not reading, comparator functions inverted, or AM03 not wired to AQ1 Verify AI3 in online watch; confirm comparator function (≥ vs ≤); confirm AQ1 reference source is AM03 or Q03 flag
AQ1 stays at 10 V continuously Q03 stuck high, or AM03 shorted to constant 1000 Check AND gate inputs; ensure Q01 and Q02 are not tied to constant 1; remove any unused constant blocks feeding AQ1
LED flickers near the band edge Hysteresis too low, or noise on AI3 Increase hysteresis to 0.5 °C (5 units) on both comparators; enable AI3 smoothing (4-sample average)
AQ1 reads intermediate voltage (e.g. 5 V) Boolean-to-analog conversion missing; AQ1 reference is a PWM or uninitialized variable Confirm AR03 produces 0 or 1000 only; verify AM03 is the sole reference assigned to AQ1
Negative setpoints produce wrong band Counter is unsigned; setpoint interpreted as 0 to 65535 Enable signed mode in the counter block (firmware ≥ 8.1.0) or use a VM address with signed range
AM01/AM02 overflow at extreme setpoints Arithmetic block output exceeds signed 16-bit range Within the application range (-200 to +300), overflow is not possible; verify the application does not extend setpoint beyond ±320 °C
PT100 reading offset (e.g. +19.0 °C reads as +19.4 °C) Sensor lead resistance uncompensated Use 3-wire connection; verify jumper between M1- and IC1 for 2-wire sensors
AQ1 does not update immediately when AI3 changes AM2 AQ configured to "Hold last value" In AQ1 properties, change behavior to "Track input"
Web server shows AQ1 = 0 % even when LED is on AQ1 status reports AM03 in %, not the actual physical voltage Multiply by 0.01 to convert % to V, or use the LOGO! diagnostic page for raw values

Related Documentation

  • LOGO! 8 System Manual — primary reference for base modules, AM2 RTD, AM2 AQ wiring, and parameter ranges.
  • LOGO! 8.3 Upgrade Notes — adds the digital-flag mode for AQ and the network variable improvements used in the networked variant.
  • LOGO! Soft Comfort V8.x product page — download, release notes, and training materials for the FBD programming environment.
  • IEC 61131-3:2013 — Programmable controllers, Part 3: Programming languages. Defines the comparator and arithmetic function blocks standardized across PLC vendors and used by LOGO!.
  • IEC 60751:2008 — Industrial platinum resistance thermometers. Defines the PT100 resistance-temperature characteristic implemented internally by the AM2 RTD module.
  • Wikipedia, Setpoint (control system) — overview of positive and negative error definitions and the convention used for band detection.

Why does my LOGO! counter not accept negative setpoints?

The Counter block in LOGO! 8 firmware versions prior to 8.1.0 maintains an unsigned actual value (0 to 999999). To support negative setpoints, enable "With sign" in the counter properties (available in firmware ≥ 8.1.0) or route the setpoint through a VM address with signed range -32768 to +32767. As a workaround, store the value as a positive integer with an offset (e.g. add 5000 to represent a setpoint range of -50 °C to +0 °C) and reapply the offset in the comparator arithmetic.

Can I drive AQ1 directly with a boolean block output?

No. AQ1 expects an analog value in the range 0 to 1000 (0 % to 100 % of the configured output range). Use an Arithmetic block with Function = Multiplication, Input A = Boolean flag (0 or 1), Input B = 1000 constant, Gain = 1 to produce AM = 0 or 1000, and assign AM to AQ1. In LOGO! Soft Comfort V8.2 and later, the AQ block properties expose a "digital flag" mode that performs this conversion internally; confirm your firmware supports it.

What hysteresis value should I use for a slowly drifting glycol bath?

For a glycol bath with a thermal time constant of minutes, set each analog comparator's hysteresis to ±0.3 °C (3 in 0.1 °C units). This gives a 0.6 °C deadband at each band edge, which suppresses flicker from sensor noise and AQ quantization while keeping the indicator accurate to within ±1.5 °C of the true setpoint. Faster systems (heating/cooling rates above 0.5 °C/s) may need up to ±1.0 °C.

How do I wire a 0-10 V LED indicator to the AM2 AQ output?

Connect the LED indicator's positive terminal to AQ1+ on the AM2 AQ through a series current-limiting resistor. Connect the LED's negative terminal to the AM2 AQ common (terminal M or 0 V reference). For a 20 mA red LED with V_F = 2.0 V, use R = (10 - 2) / 0.020 = 400 Ω; a 390 Ω ¼ W resistor is a standard choice. The AM2 AQ in voltage mode sources a maximum of 20 mA per channel with a minimum load of 5 kΩ; an LED panel drawing tens of milliamps easily meets this requirement.

Why is my AQ1 voltage 5 V instead of 0 V or 10 V?

This indicates that the AM03 reference assigned to AQ1 is neither 0 nor 1000. The most common causes are: (1) AQ1 is sourced from an analog marker that holds a mid-range value because the arithmetic block is not producing the expected output; (2) AQ1 is accidentally configured to "Hold last value" mode and is retaining a previous output; (3) the boolean-to-analog conversion is implemented incorrectly — verify AR03 (Multiplication by 1000) is wired with Input A = Q03 and Input B = 1000 constant. Open the AQ1 block properties and re-assign the reference to AM03 only, then re-test.

Back to blog