Siemens LOGO! 8: 4 Digital Inputs to One Analog Output (5-8V)

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

This technical reference documents a Siemens LOGO! 8 implementation that maps four digital inputs from a four-position selector switch to four discrete analog voltage setpoints on a single analog output channel. The original customer request asks for 5 V, 6 V, 7 V, and 8 V to be delivered on one proportional output, with the additional requirement that each setpoint be changeable from the front display. The implementation uses the LOGO! 8 Analog Multiplexor (block B26) to select between four configurable analog constants, an Analog Ramp (block B43) to suppress step transitions, and parameter-VM binding so that the setpoints can be edited at runtime from the LOGO! TDE, the onboard display, or the integrated web server.

Application Overview

The classic industrial problem is simple to state and slightly less simple to implement: a four-position detent or rotary selector must produce one of four stable analog voltages on a single channel. Many proportional controllers accept only one reference signal, so the customer cannot use the brute-force solution of placing four parallel analog outputs in parallel. The clean solution is to encode the four switch positions into the two-bit selector of the LOGO! Analog Multiplexor, feed four user-editable analog constants into the multiplexor's inputs, and pass the selected value through a ramp block and out to one analog output channel.

The setpoint voltages requested by the source application are 5 V, 6 V, 7 V, and 8 V. These values sit comfortably inside the 0-10 V output range of any LOGO! 8 analog output channel. The implementation must also support changes to any setpoint from the operator interface - this is achieved by binding each of the four multiplexor inputs to a parameter-VM address that the LOGO! TDE exposes as a writable numeric element.

Important: A four-position single-pole switch wired to four discrete digital inputs is the most common interpretation. If the switch is wired as a 2-bit binary encoder (for example, two commons with four contact positions shorting different combinations of two sense lines), the decoder block in section four can be simplified accordingly.

Hardware Selection and Specifications

The implementation targets a LOGO! 8 base module with at least one analog output channel. Three hardware configurations cover the majority of field installations.

Module Order Number (MLFB) Function Key Specs
LOGO! 12/24 RCEo 6ED1052-2MD08-0BA2 Base module with built-in analog I/O 8 DI / 4 DO, 2 AI (0-10 V), 2 AQ (0-10 V), Ethernet
LOGO! 24 RCEo 6ED1052-2CC08-0BA2 Base module, 24 V logic 8 DI / 4 DO, 2 AI, 2 AQ, Ethernet
LOGO! AM2 AQ 6ED1055-1MM00-0BA2 Analog output expansion module 2 AQ, 0-10 V or 0/4-20 mA, 12-bit resolution
LOGO! TDE 6ED1055-4MH08-0BA2 External text display, 6-line, Ethernet Editable parameter display, alarm display
LOGO! Power 24 V 6EP1331-1SH03 24 V power supply 1.3 A, 24 VDC, DIN rail

The onboard AQ channels of the LOGO! 12/24 RCEo and 24 RCEo are adequate for this application. If the base module does not provide analog outputs, add a LOGO! AM2 AQ expansion module on the right-hand bus. Confirm firmware status - LOGO! 8.3 base modules (FS 04 or later) and LOGO! Soft Comfort V8.3 or later are recommended for the Analog Ramp parameter exposure and the parameter-VM enhancements referenced in this article. Reference the LOGO! 8 system manual at the Siemens Industry Online Support portal for current FS levels.

The selector switch must be specified for the input voltage level used by the LOGO! digital inputs. For a 24 V system, choose a switch rated for at least 24 VDC / 10 mA resistive. For a 12/24 VDC base module the digital inputs are bipolar; for a 230 VAC base module use a 230 V-rated selector and provide proper isolation.

Prerequisites

  1. LOGO! Soft Comfort V8.3 or later installed on the engineering PC. The installer is available from the Siemens LOGO! product support page (siemens.com/logo).
  2. LOGO! 8 base module (FS 04 or later recommended) and an Ethernet cable for program download.
  3. LOGO! TDE (recommended for commissioning) or use of the LOGO! onboard display with arrow keys.
  4. 24 VDC power supply with sufficient headroom for the LOGO! base, the AM2 AQ if used, and the sensor wiring.
  5. Four-position selector switch (SP4T) wired to four digital inputs. Confirm whether the switch provides four independent normally-open contacts or a common pole plus four throws.
  6. Multimeter or calibrated analog signal source for verification at 0-10 V on the output terminal.

Switch-to-Selector Decoding Topology

The LOGO! Analog Multiplexor expects two binary selector lines S1 and S2. The two-bit code selects one of the four analog inputs:

S2 S1 Selected MUX Input
0 0 Input 1 (Position 1 = 5 V)
0 1 Input 2 (Position 2 = 6 V)
1 0 Input 3 (Position 3 = 7 V)
1 1 Input 4 (Position 4 = 8 V)

If the selector switch is wired so that each of its four positions closes a discrete digital input (I1, I2, I3, I4), the LOGO! program must decode the four mutually-exclusive inputs into the two-bit binary code. Boolean logic for the selector lines is:

S1 = I2 OR I4
S2 = I3 OR I4

If no input is active (switch between detents) the selector defaults to S1=0, S2=0 and the output holds the position-1 value. If two inputs are simultaneously closed (fault condition), the selector defaults to S4=position-4 because of the OR structure. Wire I1-I4 as inputs that go HIGH when their respective switch position is selected, and use the LOGO! NOT block on each input if the switch is wired as a sinking contact to 0 V rather than sourcing to 24 V.

Caution: never wire the selector switch commons to 230 VAC if the LOGO! base is a 12/24 VDC unit. The digital inputs share a common reference and any voltage above the rated input voltage will damage the module.

Wiring and Terminal Layout

Wire the four selector positions to I1 through I4 of the LOGO! base. The wiring depends on whether the AM2 AQ expansion or the onboard AQ of the RCEo variant is used.

Onboard AQ (LOGO! 12/24 RCEo and 24 RCEo):

  • Terminal I1, I2, I3, I4 - four selector switch poles (24 V sourced through 10 kohm pull-up to onboard supply).
  • Terminal M - common reference for digital inputs (returns).
  • Terminal Q1 (AQ1) - analog output 0-10 V to downstream proportional controller.
  • Terminal M - common reference for the analog output.

AM2 AQ expansion:

  • Slot the AM2 AQ module to the right of the base module - it auto-detects.
  • Terminal V1+/V1- (or AQ1+/M) - analog output channel 1.
  • External 24 VDC supply on the AM2 AQ terminals (U and M) - mandatory for current output and recommended for voltage output.

Add a 100 nF X7R ceramic capacitor across the analog output terminals close to the receiving device to suppress high-frequency noise from the panel environment. Cable length to the analog receiver should be kept under 10 m for 0-10 V signaling in electrically noisy cabinets, or convert to 4-20 mA at the receiver for longer runs.

LOGO! Soft Comfort Program Structure

The ladder/FBD program in LOGO! Soft Comfort consists of five functional groups:

  1. Decoder block: four digital inputs plus two OR gates producing S1 and S2.
  2. Four Analog Constant blocks representing the four setpoint voltages (initially 500, 600, 700, 800 internal units corresponding to 5 V, 6 V, 7 V, 8 V).
  3. Analog Multiplexor block B26 with the four constants on its inputs and S1/S2 on the selectors.
  4. Analog Ramp block B43 on the MUX output, with configurable ramp-up and ramp-down times.
  5. Analog Output block AQ1 bound to the ramp output.

Open LOGO! Soft Comfort and create a new FBD program. Drag the following blocks from the Analog folder of the programming palette:

  • OR gate x2 (from the Digital folder)
  • Analog Constant x4
  • Analog Multiplexor (B26)
  • Analog Ramp (B43)
  • Analog Output (AQ1)

Connect the four digital inputs I1, I2, I3, I4 to the appropriate terminals of the OR gates to produce the selector lines described in the previous section. Connect the four Analog Constants to inputs A1, A2, A3, A4 of the MUX. Connect the MUX output to the Analog Ramp input. Connect the ramp output to the AQ1 block. Compile with F5.

Analog Multiplexor (B26) Configuration

Double-click the B26 block to expose its configuration dialog. The block has the following parameters in LOGO! Soft Comfort V8.3:

Parameter Default Description
Enable (En) 1 Block enable; set to high (constant 1) for unconditional operation
A1, A2, A3, A4 0 Four analog inputs (bind to Analog Constants)
S1, S2 0 Binary selector lines (bind to decoded switch inputs)
Output AQ - Selected input value, mirrored as VM address

The field report notes that the MUX selector lines on the top edge of the block must be enabled. Right-click the S1 connector and select "Invert connector" if the block appears stuck on input A1 - this toggles the default state of the selector between active-high and active-low and resolves a common startup-state issue. After enabling, the MUX passes the selected analog input through to its output.

The Analog Constants are configured for the source setpoints in internal LOGO! units:

Position Voltage Target Internal Constant Calculation
1 5 V 500 5 V / 10 V * 1000
2 6 V 600 6 V / 10 V * 1000
3 7 V 700 7 V / 10 V * 1000
4 8 V 800 8 V / 10 V * 1000

To permit runtime adjustment from the TDE, each Analog Constant must be configured as Parameter-VM. In the Analog Constant dialog, tick "Parameter enable" and set "Parameter mode" to either "Last value" or "Set after stop", depending on whether the value must survive a power cycle. Repeat for each of the four constants. The dialog then exposes a VM address (for example VW0, VW2, VW4, VW6) which can be displayed or written from the TDE.

Analog Scaling Mathematics

The LOGO! 8 analog output channel AQ1 converts internal counts to voltage linearly across the full 0-10 V range:

V_out = (count / 1000) * 10 V

Therefore the inverse calculation is:

count = (V_target / 10 V) * 1000

For 4-20 mA signaling on the AM2 AQ:

I_out = (count / 1000) * 16 mA + 4 mA

count = (I_target - 4 mA) / 16 mA * 1000

Resolution of the LOGO! onboard AQ and AM2 AQ is 12 bits across the 0-10 V span, yielding approximately 2.44 mV per count - more than adequate for proportional valve or variable-speed drive reference signals. The Analog Ramp block adds integer quantisation noise of the same magnitude at the output; if smoother tracking is required, append an additional low-pass behavior at the receiving device.

Analog Ramp (B43) Smoothing

The field report highlights that the original prototype switched the output as an impulse between setpoints. This is acceptable for slow-moving proportional controllers but generates mechanical shock on hydraulic and pneumatic actuators. Insert an Analog Ramp block (B43) between the MUX and the analog output to enforce a controlled transition speed.

Parameter Default Description
Enable (En) 1 Enable the ramp
Analog Input (Ax) 0 Target value (bind to MUX output)
Output (AQ) - Current value, ramps toward Ax
Ramp Up Time (Tu) 10 s Time in seconds to span the full 0-1000 count range when rising
Ramp Down Time (Td) 10 s Time in seconds to span the full 0-1000 count range when falling

Calculate ramp time per volt from the parameter values:

Ramp per volt = T_ramp / 10 V

For example, with Tu = 10 s and Td = 10 s, a transition from 5 V to 8 V (delta = 3 V) requires 3.0 seconds; a transition from 8 V to 5 V also requires 3.0 seconds. To accelerate transitions, reduce Tu and Td; to decelerate, increase them. For a proportional valve with a 1 s response requirement, set Tu = Td = 2 s.

Warning: parameter values of Tu or Td set to 0 disable the ramp and the block reverts to pass-through behavior. Do not confuse zero with a "fastest possible" setting.

Parameter-VM Binding for TDE Adjustment

The customer requirement that setpoints be editable from the front screen is implemented via Parameter-VM binding. Each Analog Constant is configured with "Parameter enable" checked and "Parameter mode" set as required. The LOGO! Soft Comfort FBD compiler then exposes four VM addresses, which are visible as Variables on the TDE and the onboard display.

The standard VM address assignment for an Analog Constant parameter is:

Position 1 setpoint -> VW0   (read/write, word)
Position 2 setpoint -> VW2
Position 3 setpoint -> VW4
Position 4 setpoint -> VW6

The actual VM addresses depend on the order in which the constants are placed on the FBD canvas and on the LOGO! Soft Comfort build. Confirm the assigned addresses in the Tools -> Parameter VM Mapping dialog, then note them for TDE configuration.

TDE and LOGO! Onboard Display

The LOGO! TDE (6ED1055-4MH08-0BA2) provides a six-line text interface and supports message texts that include up to four variable values per screen. Configure a message text on the TDE with the four setpoint VM addresses as variables.

  1. Open LOGO! Soft Comfort and select "Message text" from the panel configuration.
  2. Add a new message text and place four variable fields labelled "Pos1", "Pos2", "Pos3", "Pos4".
  3. Bind each variable field to the VM address of the corresponding Analog Constant.
  4. Set "Editable" to yes for each field so operators can change values directly from the TDE.
  5. Set "Scaling" to 0-1000 so the displayed values match the internal units (corresponding to 0.00-10.00 V when scaled by the operator).
  6. Push the program to the LOGO! base and TDE over Ethernet.

When using only the onboard LOGO! display (no TDE), navigate to the Parameters menu and edit the four Analog Constant values using the up/down arrow keys. The onboard display has a 4-line LCD; values are shown without scaling and operators must enter raw internal counts (for example, 500 to set 5.00 V).

Tip: the LOGO! onboard display cannot label variables with engineering units. Use the TDE for production deployments to avoid operator confusion between raw counts and voltage values.

Web Server Setpoint Editing

The LOGO! 8 base module includes an integrated web server that exposes variables for read and write over Ethernet. To enable setpoint editing from a browser:

  1. Set the LOGO! IP address, subnet mask, and gateway in the LOGO! Soft Comfort Ethernet dialog or via the onboard menu.
  2. From a PC browser, navigate to http://<logo-ip>. The default username is "LOGO" and the default password is "LOGO".
  3. Open the "Variables" tab - the four Analog Constant values appear with current values and allow editing.
  4. Enter new internal counts (0-1000) and click "Set Variable".
  5. Verify the change on the analog output with a multimeter.

For commercial deployments, change the default password. Reference the LOGO! 8 system manual on the Siemens Industry Online Support portal for the full web server configuration procedure.

Commissioning and Verification

After program download and TDE configuration, perform the following verification sequence before releasing the panel to production:

  1. Power up the LOGO! and verify all four digital inputs read LOW (LED off) with the switch in position 1 (or no position selected).
  2. Connect a calibrated multimeter (Fluke 87V or equivalent) to AQ1 and M. Set meter to VDC.
  3. Step the switch through positions 1-2-3-4. Verify output values match the setpoints (5.00, 6.00, 7.00, 8.00 V ± 0.05 V).
  4. Edit position 1 to 5.50 V via the TDE, then re-cycle the switch to position 1 and verify the output reads 5.50 V.
  5. Verify ramp behavior by switching rapidly from position 1 to position 4 and timing the output rise from 5 V to 8 V; it should equal (3 / 10) * Tu (for the configured Tu).
  6. Disconnect the multimeter and connect the actual load (proportional valve, VFD reference input, etc.). Re-verify at the load terminals.
  7. Power cycle the LOGO! and confirm that setpoint values are retained (per Parameter-VM mode selection).

Document the final setpoint values, ramp times, IP address, and TDE password in the project file. Save the LOGO! Soft Comfort archive (.lma or .lsc) to the engineering repository.

Troubleshooting Matrix

Symptom Probable Cause Diagnostic Corrective Action
Output stuck at 5 V regardless of switch MUX selector connector not enabled Inspect B26 dialog - S1/S2 may show as inverted Right-click S1, select "Invert connector"
Output oscillates between setpoints Two digital inputs simultaneously closed; contact bounce Monitor I1-I4 LED on base module Add 50 ms input debounce via Pulse Generator + AND logic
Output does not reach 8 V at position 4 Analog Constant value not 800 Read VM via web server Edit constant to 800 via TDE or browser
Output steps instead of ramping Ramp Tu/Td = 0 Inspect B43 parameters Set Tu and Td to non-zero (e.g., 5 s)
TDE shows blank parameter fields Parameter-VM binding missing Reopen Analog Constant dialog Check "Parameter enable" and re-download program
Edited setpoint does not persist after power cycle Parameter mode = "Set after stop" only Inspect Analog Constant dialog Change Parameter mode to retain values
Output reads 0 V at all positions AQ1 not assigned in I/O mapping Check FBD - AQ block must reference physical AQ1 Re-bind Analog Ramp output to AQ1 in I/O config
Setpoint changes via TDE work but web edit fails Default password not changed or browser session timed out Re-login to web server Set new password, verify IP/Subnet
Output reads correct voltage at panel but wrong at load Voltage drop in long cable, ground loop Measure at panel and at load Use 4-20 mA output, increase wire gauge, separate grounds
LOGO! displays "BLOCK ERROR" or red LED Program error or firmware mismatch Check LOGO! Soft Comfort compile output Update firmware or fix compile warning, re-download

How does a four-position switch drive only two selector lines on the LOGO! MUX?

The four switch positions are decoded into two binary selector lines using two OR gates. S1 = I2 OR I4 and S2 = I3 OR I4. The default state (no inputs active) selects position 1, and the OR structure guarantees that any single input determines a unique two-bit code.

What is the difference between the onboard AQ on the RCEo module and the AM2 AQ expansion?

The onboard AQ on the LOGO! 12/24 RCEo and 24 RCEo provides two 0-10 V outputs sourced from the LOGO! supply. The LOGO! AM2 AQ (6ED1055-1MM00-0BA2) provides two isolated outputs configurable as 0-10 V or 0/4-20 mA and requires an external 24 VDC supply. Both have 12-bit resolution; the AM2 AQ is preferred for current loops and longer cable runs.

How are the five voltages 0 V, 5 V, 6 V, 7 V, and 8 V represented inside the LOGO!?

LOGO! represents all analog values as integers from 0 to 1000, where 0 = 0 V (or 4 mA) and 1000 = 10 V (or 20 mA). The setpoint 5 V is therefore the constant 500, 6 V is 600, 7 V is 700, and 8 V is 800. Operators editing the TDE or web server enter these integer counts unless the TDE variable field is configured with custom scaling.

Why does the LOGO! MUX appear stuck on input A1 in online monitoring?

When the Analog Multiplexor is first dragged into the FBD canvas, the S1 connector defaults to inverted logic. Online monitoring will show the block always selecting A1 until the connector is inverted by right-clicking the S1 input and choosing "Invert connector". After inverting and recompiling, the block responds correctly to the selector lines.

Can the setpoints be edited without a TDE?

Yes. The LOGO! onboard display allows parameter editing through the "Parameters" menu using the arrow keys. Without a TDE, however, values appear as raw internal counts (500, 600, 700, 800) rather than scaled voltages, and there is no descriptive label for each parameter. For production use, add a LOGO! TDE (6ED1055-4MH08-0BA2) or use the integrated web server.

What ramp time should be configured for a hydraulic proportional valve?

Typical hydraulic proportional valves require 0.5 to 2.0 seconds for full-scale travel. Configure Tu and Td so that the worst-case step (5 V to 8 V = 30 percent of span) takes approximately 1.0 second. With a 10 V span, this requires Tu = Td = 10 / 3.0 = 3.3 seconds. Verify empirically with a pressure gauge and adjust.

Back to blog