Acquiring LOGO! 8 Analog Data to Excel and Email Alerts
The Siemens LOGO! 8 (6ED1052-xxx08-0BAx) is a common logic relay deployed in test rigs, laboratory benches, and small production cells. Engineers who need to monitor a 4-20 mA transducer and archive the trace in Excel, and who also want a remote alarm path, can do so with a mix of built-in LOGO! features and inexpensive add-on software. This reference covers the hardware selection, transducer wiring, network configuration, polling logic, data logging, and alert delivery paths that fit a bench- or lab-scale application.
1. System Overview
The minimal reference architecture is built around the following components:
- LOGO! 8 Base Module (BM) with built-in Ethernet and SD card slot.
- LOGO! AM2 expansion (6ED1055-1MA00-0BA0) to accept a true 0/4-20 mA analog input. The BM's on-board AI1 and AI2 are 0-10 V only.
- 2-wire loop-powered 4-20 mA current transducer (or externally powered 4-wire device).
- 24 V DC power supply for sensor and loop.
- PC on the same Ethernet subnet running LOGO!Soft Comfort V8.x (engineering) and a polling client (Python, Node-RED, or third-party LOGO!Monitor).
- Outbound e-mail / SMS path: either a LOGO! CMR2020 / CMR2040 cellular router, a Windows PC running LOGO!Monitor, or a custom Python script with SMTP/SMS gateway.
The flow is: transducer mA signal -> AM2 analog input -> LOGO! program scaling -> process image word -> Ethernet (S7 or Modbus TCP) -> PC application -> Excel/CSV file and email/SMS dispatcher.
2. Hardware Selection and Catalog Numbers
LOGO! 8 Base Module variants and part numbers relevant to a 24 V test rig:
| Catalog number | Description | Notes |
|---|---|---|
| 6ED1052-1MD08-0BA1 | LOGO! 8.3 12/24 RCE, 8 DI / 4 DO relay, on-board AI1-AI2 (0-10 V), Ethernet, SD card | Standard 24 V BM with built-in Ethernet |
| 6ED1052-2MD08-0BA1 | LOGO! 8.3 12/24 RCEo, same I/O without display | Lower cost if TDE is used for display |
| 6ED1055-1MA00-0BA0 | LOGO! AM2 analog module, 2 AI, 0-10 V or 0/4-20 mA | Mandatory for 4-20 mA loop |
| 6ED1055-1MD00-0BA1 | LOGO! AM2 RTD, PT100/PT1000/Ni1000 | Use only if transducer is resistive temperature |
| 6ED1055-4MH08-0BA0 | LOGO! TDE text display | Optional operator panel with two Ethernet ports |
| 6BK1700-0HA00-0AA1 | LOGO! CMR2020 cellular router (4G) | SMS and e-mail relay for the LOGO! 8 network |
| 6BK1700-0HA10-0AA1 | LOGO! CMR2040 cellular router (4G/Europe) | Variant for EU bands |
The LOGO! 8.3 system manual (Siemens ID 109767120) lists every catalog number and the firmware feature set. The current firmware is V8.3.x (FS4 or later), which is the minimum that enables Modbus TCP without registration.
3. Current Transducer Sizing and Wiring
For a 4-20 mA current loop, select a transducer whose range covers the expected process current. As a sizing example: for a 360 A primary conductor on a motor feeder, use a transducer with a 400 A or 500 A primary window and a 4-20 mA secondary. The classic Phoenix Contact MACX MCR-SL-CAB or Carlo Gavazzi CTD series are typical choices; both are loop-powered (12-30 V DC) and have an output that ties directly to AM2.
Three-phase apparent power sizing (for dimensioning the feeder):
S_3ph = sqrt(3) * V_LL * I_line / 1000 [kVA]
If the application note states "360 A" without specifying the topology, both interpretations must be checked:
- If 360 A is three-phase line current at V_LL = 400 V, S = sqrt(3) * 400 * 360 / 1000 = 249 kVA.
- If 360 A is the single-phase primary current of a single transducer at V_LL = 400 V between phases, S = 400 * 360 / 1000 = 144 kVA.
Three transducers are required for full three-phase monitoring; a single-phase transducer only reports its own phase. Select the primary current rating of each transducer based on the actual line current, with a 25-50% margin to avoid saturation.
3.1 Wiring the 4-20 mA Loop to AM2
- Connect the +24 V sensor supply to the transducer + terminal (terminal 1 on most loop-powered devices).
- Connect the transducer - terminal to AM2 I1m (current input) on the AM2 module. The AM2 input is set to "0-20 mA" or "4-20 mA" with the selector on the module and the corresponding configuration in LOGO!Soft Comfort.
- Jumper the unused voltage terminal I1u to nothing; do not parallel voltage and current inputs.
- Tie the cable shield at the cabinet entry to PE on one side only to prevent ground loops.
Refer to the LOGO! 8 system manual, chapter "AM2 analog module" for the exact terminal layout.
4. LOGO! Program: Scaling and Threshold Detection
Within LOGO!Soft Comfort V8.3, the AM2 input returns a raw integer in the range 0-1000 for the configured span. For a 4-20 mA input, raw value 0 corresponds to 0 mA, raw 200 corresponds to 4 mA, and raw 1000 to 20 mA. The transducer datasheet maps the engineering units (A or kVA) to the 4-20 mA span.
4.1 Linear Scaling Block
Use the Analog Amplifier block to rescale the raw value to engineering units, then feed the result to display, network, and threshold blocks.
- Insert an Analog Input block tied to the AM2 input.
- Insert an Analog Amplifier block. Set Gain = (E_max - E_min) / 1000 and Offset = E_min to map raw to engineering units.
- Insert one or more Analog Comparator blocks for thresholds (e.g., 80% warning, 95% alarm). Wire a digital output or message text to trigger on the comparator.
- Drag the engineering-unit value onto a flag bit (M field) or expose it as a network variable. Modbus TCP and S7 read the value from the variable table.
4.2 Variable Tag Table
| Variable name | Type | Source | Modbus register (LOGO! holding) | Modbus address (LOGO! 8 FS4+) |
|---|---|---|---|---|
| Current_Amps | Word | Analog amplifier output | VW0 | 0000h |
| Current_pct | Word | Analog amplifier output 0-100 | VW2 | 0002h |
| Alarm_OverCurrent | Bit | Analog comparator > 95% | VB4.0 | 0004h bit 0 |
| Warn_High | Bit | Analog comparator > 80% | VB4.1 | 0004h bit 1 |
The exact register mapping is documented in the LOGO! 8 Modbus TCP communication manual (Siemens ID 109768718). Variable tag access via Modbus TCP is enabled by toggling "Modbus server access" in the project properties.
5. Network Configuration
The LOGO! 8 BM has one Ethernet port. A TDE in the chain adds a second port but is logically the same node. Configure the BM with a static IP that matches the engineering subnet:
- Default IP: 192.168.0.100, mask 255.255.255.0.
- Recommended: assign a static IP outside the DHCP range (e.g., 192.168.0.50).
- Set "Allow Web access" and "Allow S7 access" under Tools > Ethernet Connections in LOGO!Soft Comfort.
6. Built-in Web Server for Visualization
LOGO! 8 exposes a built-in web server at http://<LOGO_IP> that requires the project to be transferred with the "Enable Web Server" option selected. The web server shows the variables, I/O states, and message texts, and can be configured to require a user name and password (firmware FS4+). For a quick sanity check, open the page in any browser on the engineering PC; the live current value should be visible without any extra software.
7. Excel Data Logging with a Python Polling Client
The most flexible path is a small Python script that polls Modbus TCP or S7, decodes the variables, appends a row to a CSV (which Excel opens directly), and dispatches alerts.
7.1 Polling via Modbus TCP
The pymodbus library is sufficient for LOGO! 8 FS4+.
# pip install pymodbus==3.6.*
from pymodbus.client import ModbusTcpClient
import csv, time
LOGO_IP = "192.168.0.50"
PORT = 502
UNIT = 1
CSV = "current_log.csv"
client = ModbusTcpClient(LOGO_IP, port=PORT, timeout=2.0)
client.connect()
with open(CSV, "a", newline="") as f:
w = csv.writer(f)
w.writerow(["timestamp", "current_A", "current_pct", "alarm"])
while True:
rr = client.read_holding_registers(address=0, count=3, slave=UNIT)
if not rr.isError():
amps, pct, alarm_bits = rr.registers[0], rr.registers[1], rr.registers[2]
alarm = bool(alarm_bits & 0x01)
w.writerow([time.strftime("%Y-%m-%d %H:%M:%S"), amps / 10.0, pct / 10.0, alarm])
f.flush()
time.sleep(0.5)
Notes on scaling: the script assumes the LOGO! program scaled the integer to "tenths of an amp" (i.e., 360.0 A is sent as 3600) and to "tenths of a percent" for the percentage reading. Adjust the divisor if the LOGO! program uses a different engineering unit.
7.2 Polling via S7
For S7 polling, use python-snap7:
# pip install python-snap7
import snap7, ctypes, time, csv
client = snap7.client.Client()
client.connect("192.168.0.50", 0, 1, 102) # IP, rack, slot, port
DB = 1 # use DB1 in the LOGO! project
OFF = 0
LEN = 10 # bytes to read
with open("current_log.csv", "a", newline="") as f:
w = csv.writer(f)
w.writerow(["timestamp", "raw_word", "raw_word2"])
while True:
buf = client.db_read(DB, OFF, LEN)
word1 = int.from_bytes(buf[0:2], "big", signed=False)
word2 = int.from_bytes(buf[2:4], "big", signed=False)
w.writerow([time.strftime("%Y-%m-%d %H:%M:%S"), word1, word2])
f.flush()
time.sleep(0.5)
Confirm the DB number, byte offset, and word order in the LOGO!Soft Comfort variable mapping; the values above are examples and must be matched to the actual project. The LOGO! 8 S7 communication manual (Siemens ID 109751825) lists the supported DB areas and word order.
7.3 Importing CSV to Excel
Excel reads the CSV directly: Data > From Text/CSV. For a live tail of the running script, use Data > From Text/CSV > Refresh All every minute. The python script should be set up as a scheduled task or as a Windows service if continuous logging is required.
8. Email and SMS Alerting
LOGO! 8 cannot send e-mail or SMS directly. The alert must be initiated by a device or PC on the network that observes the variable. The most common options are listed below.
8.1 LOGO! CMR Cellular Router
The LOGO! CMR2020 / CMR2040 manual (Siemens ID 109795851) describes a small DIN-rail cellular router that sits on the same Ethernet subnet as the LOGO! 8. The CMR can:
- Send SMS or e-mail triggered by a polling threshold on a Modbus TCP register or a Siemens S7 variable.
- Forward Ethernet alarms via its integrated alarm function (event configuration per tag with hysteresis, deadband, and delay).
- Provide a fallback remote access path via VPN if a cloud login is set up.
This is the cleanest hardware-only solution and replaces the older GSM modem kits that are no longer in production. Cost is higher than a Windows PC solution but avoids the need for a permanent PC.
8.2 Third-Party PC Software: LOGO!Monitor
LOGO!Monitor is a Windows application that polls the LOGO! 8 over Ethernet and provides:
- Trending graphs.
- CSV / Excel export.
- Threshold-based e-mail alarms.
Configuration is a two-step process: add the LOGO! 8 IP under "Connections", then add the variables to monitor under "Tags". An e-mail action is set up under "Actions". The recommended polling interval is 10 s for stable operation with a USB-to-LAN print server; with direct Ethernet this can be reduced to 1 s.
8.3 Custom Python Alert Path
For engineers who already have a Python polling client, integrate smtplib for e-mail or a webhook for SMS via Twilio:
import smtplib, ssl
from email.message import EmailMessage
def send_alert(subject, body):
msg = EmailMessage()
msg["From"] = "[email protected]"
msg["To"] = "[email protected]"
msg["Subject"] = subject
msg.set_content(body)
with smtplib.SMTP_SSL("smtp.example.com", 465, context=ssl.create_default_context()) as s:
s.login("[email protected]", "app-password")
s.send_message(msg)
Trigger send_alert on the rising edge of the alarm bit. Avoid sending on every poll; latch the alarm and require a manual reset or a time-based clear in the LOGO! program.
9. Commissioning Procedure
- Install the AM2 module to the right of the BM. Power up and verify the module is detected (Tools > Module Status in LOGO!Soft Comfort online mode).
- Configure the AM2 input for 0/4-20 mA in the I/O properties and download the project to the BM.
- Wire the transducer with the loop supply and confirm the input voltage at the AM2 terminals with a multimeter. A healthy loop reads 4 mA at zero primary current and rises with primary current.
- Set the BM IP and enable Web Server, S7 access, and Modbus access in the project properties.
- Open the LOGO! Web Server in a browser and confirm the current value matches the multimeter-derived estimate.
- Run the Python poller and check the first 10 seconds of CSV. Cross-check with the Web Server values.
- Force an over-current condition (or temporarily lower the comparator threshold) and confirm the e-mail/SMS is sent.
- Restore the threshold and re-verify normal logging.
10. Verification Matrix
| Check | Expected | Pass criterion |
|---|---|---|
| AM2 input current at zero primary | 4.0 mA (loop-powered) | +/- 0.05 mA |
| AM2 input current at full primary | 20.0 mA | +/- 0.1 mA |
| Web Server current value | Matches multimeter-estimated value | +/- 1% of range |
| Python poller first row timestamp | Current system time at start | Within 1 s of system clock |
| Threshold comparator bit at 90% | True | Tag VB4.0 = 1 in poller |
| Test e-mail arrives | Within 30 s of alarm edge | Sent from alerting account |
11. Troubleshooting Matrix
| Symptom | Likely cause | Fix |
|---|---|---|
| Web Server not reachable | Web access disabled in project properties, or wrong subnet | Enable Web access in LOGO!Soft Comfort; verify PC subnet mask |
| Modbus poll times out | Modbus server disabled or FS3 firmware | Enable Modbus server access; update to FS4+ |
| Poller reads 0 / 65535 | Wrong register address, wrong unit ID, or wrong byte order | Verify address from the LOGO! variable table; try slave ID 0 and 1 |
| Current value always 0 | AM2 jumper not set to "current", or transducer wired to voltage terminal | Set AM2 jumper to I; re-wire to I1m |
| Current value always 4 mA (scaled 0) | Loop polarity reversed or supply missing | Verify 24 V at transducer +; swap loop wires |
| Current value spikes at startup | LOGO! program reads raw before AM2 initializes | Add a 1 s startup delay using a delay-on block |
| E-mail alerts spam every poll | No latching or hysteresis in alert logic | Add a hysteresis comparator; latch the alarm in the LOGO! and reset it explicitly |
| CMR2020 SMS not delivered | SIM not activated, APN wrong, or antenna missing | Check signal LEDs; verify APN in CMR config |
| Excel shows dates as text | Locale mismatch in CSV format | Save CSV with ISO-8601 timestamps; force text-to-columns in Excel |
12. Field-Proven Caveats
- The BM's on-board AI1 and AI2 are 0-10 V only. A 4-20 mA transducer will not work on the BM directly and requires AM2.
- Modbus TCP access on the LOGO! 8 is free for up to two concurrent connections in firmware FS4+; additional connections require a license registration on the Siemens Web Site, even on a license-free device.
- The LOGO! 8 base module can sustain roughly 50-100 polls per second before response time degrades. Plan for 250-500 ms per poll in a logging client.
- When the LOGO! program uses a power-fail retentive flag for the alarm latch, the alarm state survives a power cycle; remember to clear it after a service event.
- 4-20 mA loops are sensitive to ground loops. Keep the shield grounded on one side only, typically at the cabinet entry, and avoid tying the sensor return to PE at the sensor end.
- For an SMS alert, the LOGO! CMR2020 / CMR2040 is the only Siemens solution in production today; the older GSM modem kits referenced in legacy support entries are discontinued and increasingly difficult to source.
13. FAQ
Can the LOGO! 8 read a 4-20 mA transducer directly on its built-in analog inputs?
No. The on-board AI1 and AI2 on the LOGO! 8 BM are 0-10 V only. For a 4-20 mA signal, add the AM2 expansion module (6ED1055-1MA00-0BA0) and set its input jumper to current mode.
What is the fastest stable polling rate against a LOGO! 8 over Ethernet?
Around 500 ms per poll is reliable for a single client. The legacy Sharkoon USB-LanPort path used in older LOGO! 7 setups was limited to roughly 10 s and should not be used with a LOGO! 8.
How do I get the measured value into Excel?
Run a Python poller that pulls the value via Modbus TCP or S7 and writes a row to a CSV file. Excel opens the CSV directly with Data > From Text/CSV. LOGO!Monitor provides the same function with a GUI and a built-in Excel export.
Can the LOGO! 8 send an e-mail by itself?
No. LOGO! 8 has no built-in e-mail or SMS function. Use a downstream device such as the LOGO! CMR2020 / CMR2040 cellular router, a Windows PC running LOGO!Monitor, or a custom script that triggers an e-mail when a tag threshold is crossed.
What is the difference between S7 polling and Modbus TCP polling on LOGO! 8?
S7 uses the Siemens S7 protocol over the Ethernet port and works on every LOGO! 8 firmware version. Modbus TCP is supported natively on firmware FS4+ (V1.16.0 or later) and is the simplest path for non-Siemens clients. The two protocols read from different process-image areas; the LOGO! 8 S7 and Modbus manuals list the exact register and DB mappings.