LOGO! 8.3 S7 Server: Transmitting Counter Values to a LoRa/Connectitude Client
This technical reference describes, in engineering detail, how to wire a Siemens LOGO! 8.3 (LOGOSYS-83 family, for example 6ED1052-1MD08-0BA0) into a flour-packaging line so that two production counters (good packages sold vs. all packages produced) are accumulated locally, then exposed to an external S7 client over Ethernet/TCP using the S7 communication protocol. The external client in this case is a LoRaWAN-capable industrial router (Connectitude platform) that reads the counter values on a schedule and forwards them to a cloud dashboard for trending.
The application parameters are:
- Package size: 2 kg flour bags
- Throughput: approx. 24,000 packages per day (one bag every 3.6 s at continuous operation)
- Counter 1: total packages produced (up/down counter, incrementing on each photosensor edge)
- Counter 2: packages actually sold (incrementing on a second quality-gate sensor that rejects defective bags)
- Differential: rejects = Counter 1 − Counter 2
- Communication: S7 protocol (server side: LOGO!), periodic polling by LoRa router
The LOGO! is the S7 server. The LoRa router (Connectitude) is the S7 client. The client initiates a read request; the LOGO! responds with the current counter value from its Variable Memory (VM) area. The client never writes to the LOGO!; it only reads.
1. Prerequisites and Bill of Materials
| Item | Specification | Notes |
|---|---|---|
| LOGO! 8.3 base module | 6ED1052-1MD08-0BA0 (LOGO! 8.3 with display, Ethernet) or 6ED1052-2MD08-0BA0 (LOGO! 8.3 pure without display) | Integrated Ethernet RJ45 port, 10/100 Mbit/s |
| Power supply | 24 V DC (LOGO! 8.3 24V variants) or 230 V AC variant | Match to available cabinet supply |
| LOGO! Soft Comfort | Version V8.3 or later (matches LOGO! 8.3 firmware) | Required for S7 access flag and VM mapping UI |
| Digital input expansion (optional) | LOGO! DM8 24 (6ED1055-1MB00-0BA2) or DM16 24 | Needed if more than 8 DI are required |
| Photosensor 1 (production counter) | PNP/NPN diffuse-reflective or through-beam, 24 V DC, NPN sinking preferred for LOGO! 24V inputs | Mounted on conveyor just after bag sealer |
| Photosensor 2 (sales counter) | PNP/NPN, 24 V DC, identical wiring to sensor 1 | Mounted after quality-gate reject station |
| Network switch / cabling | Industrial 100 Mbit/s switch, Cat5e or better | LOGO! ↔ LoRa router in same subnet |
| LoRa router (Connectitude) | Industrial cellular/LoRa gateway with S7 client support | Must be configured as S7 client pointing at LOGO! IP |
Verify the LOGO! 8.3 system manual (Siemens Online Support) for current ordering data and the corresponding LOGO! Soft Comfort release notes.
2. LOGO! 8.3 Hardware Topology
The reference wiring for the packaging line counter is shown below. The LOGO! sits in the conveyor control panel; both photosensors and the line run/stop contact land on its digital inputs.
24 V DC supply
|
+----[ PSU 24V ]----+----------+--------+
| | |
[ LOGO! 8.3 ] [ Sensor1 ] [ Sensor2 ]
| | |
| I1 | OUT | OUT
| I2 +--------+
| (signal)
|
Ethernet RJ45
|
[ Switch ]
|
[ Connectitude LoRa Router ]
|
(Cellular/LoRa uplink to cloud)
Recommended input assignment on the LOGO! base module:
| LOGO! Input | Signal | Function |
|---|---|---|
| I1 | Photosensor 1 (production counter) | Increments Total produced on rising edge |
| I2 | Photosensor 2 (sales counter) | Increments Total sold on rising edge |
| I3 | Hour-clock pulse from real-time clock | Triggers hourly snapshot to VM area |
| I4 | Day-clock pulse (00:00) from RTC | Triggers daily counter roll-over/reset |
| I5 | Manual reset pushbutton (NO) | Operator-initiated zero of both counters |
Each photosensor output is wired to the LOGO! 24 V digital input. A 4.7 kΩ pull-down is unnecessary because the LOGO! inputs are internally biased; the sensor must drive the input with a clean 24 V signal and a minimum pulse width of 25 ms (LOGO! 8.3 input filter is approximately 1.5 ms by default, configurable per channel in the hardware configuration).
3. IP Network and Subnet Design
The LOGO! 8.3 and the Connectitude LoRa router must share the same IP subnet and the same subnet mask. There is no routing in this application; both devices live on a flat Layer 2 segment with one switch.
| Parameter | LOGO! 8.3 | Connectitude LoRa router (S7 client) | Notes |
|---|---|---|---|
| IP address | 192.168.0.10 | 192.168.0.20 | Static, assigned manually |
| Subnet mask | 255.255.255.0 | 255.255.255.0 | Must match |
| Default gateway | 0.0.0.0 (none) | 0.0.0.0 (none) | No off-segment traffic |
| MAC | printed on front label | printed on router label | Reference for inventory |
| S7 role | Server (passive, responds to read requests) | Client (active, initiates read requests) | LOGO! never dials out |
| S7 port | 102/TCP (default ISO-on-TCP / RFC1006) | 102/TCP destination | Standard S7 port |
| S7 rack/slot | Rack 0, Slot 1 (LOGO! default) | Target = 0/1 | LOGO! uses fixed rack/slot |
| S7 connection resource | 1 (server connection, 1 active connection max by default) | 1 (client connection) | LOGO! 8.3 supports limited parallel S7 connections — see Section 11 |
Configure the LOGO! IP address either from the front keypad (LOGO! with display: Network → IP Address) or from LOGO! Soft Comfort (Tools → Transfer → Ethernet). Always set a static IP; do not rely on DHCP for a counter S7 server.
4. Enabling S7 Access in LOGO! Soft Comfort
S7 access is disabled by default in a new LOGO! 8.3 program. The server only answers S7 requests on port 102 if this flag is on. Procedure:
- Open the project in LOGO! Soft Comfort V8.3.
- Open File → Properties (or Options → File Properties, depending on language version).
- Select the Settings tab.
- Tick "Allow S7 access" (German: S7-Zugriff erlauben).
- Confirm with OK and save the project.
- Transfer the project to the LOGO! over Ethernet (Tools → Transfer → PC → LOGO!).
When the flag is set, the LOGO! listens on TCP/102 for S7 communication and serves the contents of its Variable Memory (VM) area to any client that knows the rack/slot. Without this flag, all S7 read requests are silently dropped — a frequent cause of "client cannot connect" field complaints.
Reference: LOGO! 8.3 system manual, chapter "Communication via Ethernet".
5. VM Memory Layout and Address Allocation
The LOGO! 8.3 reserves 850 bytes of Variable Memory (VM) for S7 read/write. S7 clients read this area as DB1 starting at offset 0:
S7 client view of LOGO!: DB1.DBB0 = VM byte 0 DB1.DBB1 = VM byte 1 DB1.DBW0 = VM word 0 (bytes 0,1) DB1.DBD0 = VM double-word 0 (bytes 0..3) ... DB1.DBDn = VM double-word n (bytes 4n..4n+3)
Recommended address plan for this application:
| S7 address (DB1) | VM offset | Data type | Meaning | Source block |
|---|---|---|---|---|
| DB1.DBW0 | VW0 | INT (16-bit, signed) | Total packages produced — current day | Counter 1, B001 |
| DB1.DBW2 | VW2 | INT | Total packages sold — current day | Counter 2, B002 |
| DB1.DBW4 | VW4 | INT | Rejects (produced − sold) | Subtractor, B003 |
| DB1.DBW6 | VW6 | INT | Hourly snapshot — produced | Latched by hourly trigger |
| DB1.DBW8 | VW8 | INT | Hourly snapshot — sold | Latched by hourly trigger |
| DB1.DBW10 | VW10 | INT | Day-of-week (1..7) for graphing | RTC block |
| DB1.DBW12 | VW12 | INT | Hour-of-day (0..23) | RTC block |
| DB1.DBW14 | VW14 | WORD | Status flags (bit 0 = line running, bit 1 = sensor fault, bit 2 = counter overflow) | Logic flags |
At 24,000 packages/day, the counter value fits comfortably in a 16-bit signed integer (max 32,767). If the plant ever runs two shifts back-to-back without a daily reset, switch to DB1.DBD0 (DWORD, max ≈ 4.29 × 10⁹).
6. Counter Logic — Total Packages Produced
Place an Up/Down Counter block (B001) in the LOGO! Soft Comfort diagram:
- Block number: B001
- Function: Up/down counter
- Input Ref (Cnt): I1 (photosensor 1)
- Input Ref (Dir): constant 0 (count up only)
- Input Ref (Rst): I5 (manual reset) OR'd with the daily-reset flag
- Reference (threshold): 24000 (day target, optional alarm)
- Output Q → VM mapping block, target VW0
The Analog Flag/Threshold Trigger technique: configure an Analog Multiplexer or simply use the VM Mapping feature of the Up/Down Counter to mirror QV (current value) into VW0 each cycle. In LOGO! Soft Comfort:
- Click the Up/Down Counter block B001.
- In the block properties, open the VM Mapping dialog.
- Map block B001's current value output (QV) to VW0.
For every rising edge on I1, the counter increments by 1 and the LOGO! runtime engine writes the new value to VW0, which is reachable by S7 clients as DB1.DBW0.
7. Counter Logic — Total Packages Sold
Place a second Up/Down Counter block (B002) wired to the second photosensor at the post-quality-gate:
- Block number: B002
- Input Ref (Cnt): I2 (photosensor 2)
- Input Ref (Dir): constant 0
- Input Ref (Rst): same daily-reset signal as B001
- VM Mapping: B002.QV → VW2
Because the second sensor only fires when a bag physically clears the reject gate, defective bags are not counted in "sold". The difference (produced − sold) is the reject count.
8. Subtractor Block — Live Reject Count
Insert an Analog Subtractor (B003):
- Input A: VW0 (produced)
- Input B: VW2 (sold)
- Output: VM map to VW4
VW4 = VW0 − VW2, recomputed every LOGO! cycle (typically 50–100 ms cycle time for small programs). The S7 client sees this as a third, derived counter without any extra logic on the cloud side.
9. Hourly Snapshot Using the Real-Time Clock
The user requested that the counter value be transmitted every hour. The LOGO! has no native "on the hour" scheduler, but a Real-Time Clock (RTC) block combined with a Threshold Trigger does the job:
- Insert a Weekly Timer (B004) configured to enable on every minute change of the hour (00:00, 01:00, …, 23:00). An alternative is a Yearly Timer set to fire on every hour boundary; in LOGO! 8.3 the Weekly Timer is the simpler pick.
- Wire B004.Q → input of an Edge-triggered Latching Relay (B005).
- Use the latched output to fire a Counter Snapshot via an Analog Multiplexer (B006) that routes VW0 → VW6 (and VW2 → VW8) on the hour pulse.
The snapshot values VW6 and VW8 are stable between hourly triggers, so the S7 client can read them at any time during the hour and obtain the count at the last top-of-the-hour boundary — useful for plotting hourly throughput.
10. Daily Counter Reset
24,000/day fits inside INT16, but the user explicitly wants a daily zero to align with the Connectitude dashboard's day roll-over. Implement:
- A Weekly Timer (B007) enabled from 00:00 to 00:01 every day.
- Output B007.Q → Rst input of B001 and B002 (OR'd with the manual pushbutton on I5).
If the plant must run a 24/7 continuous shift pattern and resets must be avoided, drop the daily reset and use 32-bit DWORD counters plus a manual reset only. The 16-bit choice above is for the stated 24k/day case.
11. S7 Server Connection — How the Client Talks to the LOGO!
Once S7 access is enabled (Section 4) and the VM mapping is in place (Sections 5–8), the LOGO! 8.3 passively serves the VM area on TCP/102. The Connectitude LoRa router is configured as an S7 client with these parameters:
| Client field | Value |
|---|---|
| Target IP | 192.168.0.10 |
| Target port | 102 |
| Target rack | 0 |
| Target slot | 1 |
| DB number | 1 |
| Start address (read) | DB1.DBD0 (32-bit read covers DBB0..DBB3) |
| Length | 16 bytes (DBB0..DBB15) is enough for the register map |
| Poll interval | 60 s (reads every minute; the cloud aggregates to hourly) |
| Read function | S7 Read Var (function code 0x04) |
Reference: LOGO! 8.3 communication chapter and the S7 protocol standardisation in Snap7 documentation (Siemens S7 protocol reference implementation).
Each S7 poll returns the 16-byte block containing the two live counters, the reject differential, the hourly snapshots, the RTC fields, and the status word. The cloud platform then:
- Aggregates the 60 sampled values per hour into min/avg/max per channel.
- Stores the result tagged with the wall-clock hour from the gateway's own NTP-synced clock.
- Plots produced, sold, and reject count as a stacked time series.
12. Photosensor Debounce and Input Filter
A 2 kg bag falling on a conveyor can cause a fluttering photosensor signal. Without debounce, a single bag can be counted as 2–3 increments. Apply:
- Hardware debounce: use sensors with a 50 ms minimum pulse output (most industrial reflex sensors default to 50 ms response).
- LOGO! input filter: leave at default 1.5 ms for the digital input — this is appropriate for a 50 ms pulse.
- Software debounce in LOGO!: insert a Wiping Relay (On-Delay) of 100 ms in series with the sensor input before the Counter Cnt input. Bags are 600 mm apart at 24000/day, so a 100 ms pulse width is well below the inter-bag gap of ~3.6 s.
Wiring example in ladder-ish pseudo-LOGOSYS:
I1 ──[ On-delay 100 ms ]──┐
├──[ B001.Cnt ]
I2 ──[ On-delay 100 ms ]──┘
13. Status Word Flags for Cloud Diagnostics
Map the following status bits into VW14 so the cloud can alarm on faults:
| Bit | Flag | Set by |
|---|---|---|
| 0 | Line running | Conveyor VFD run contact |
| 1 | Sensor 1 fault (stuck high > 60 s) | Watchdog timer on I1 |
| 2 | Sensor 2 fault | Watchdog timer on I2 |
| 3 | Counter overflow risk (count > 30000) | Threshold trigger on VW0 |
| 4 | Daily reset executed today | Self-latching from B007 |
The Connectitude platform can be configured to raise an alert on bit 1 or bit 2 — a stuck-high photosensor is a real failure mode that would otherwise go unnoticed if the cloud only sees the counter freeze.
14. Commissioning and Verification Procedure
- Power-up test. Apply 24 V, confirm LOGO! enters RUN and the Ethernet link LED on the RJ45 is solid green.
- IP ping. From a laptop on the same subnet, ping 192.168.0.10. Loss must be 0 %.
-
Web diagnostics. Open a browser to
http://192.168.0.10(LOGO! 8.3 exposes a minimal web page with VM values if web server is enabled). - Counter dry run. Manually trigger I1 ten times; verify VW0 reads 10 in the LOGO! display (use Online Test in Soft Comfort).
- S7 client test. From a PC running a generic S7 client (e.g., Snap7 sample, Node-RED with s7 node, or libnodave), execute a read of DB1, length 16, starting at offset 0. Confirm bytes 0–1 = counter, 2–3 = sold, 4–5 = rejects.
- LoRa router test. Configure the Connectitude router with the parameters from Section 11. Watch the router's diagnostic log for a successful S7 handshake on TCP/102.
- End-to-end test. Cycle 100 bags through the line. Verify the cloud dashboard increments by exactly 100 within the next poll cycle (≤ 60 s).
- Hourly snapshot test. Set a temporary RTC time five minutes from now. Wait. Verify VW6 and VW8 update on the boundary.
- Reset test. Manually press the reset pushbutton (I5) and confirm both counters zero; confirm VW0 and VW2 read 0 in the next S7 poll.
15. Troubleshooting Matrix
| Symptom | Likely root cause | Action |
|---|---|---|
| Client cannot open TCP/102 | S7 access flag not enabled in LOGO! Soft Comfort | Re-enable in File → Properties → Settings, re-transfer program |
| Client connects, reads return 0 | VM mapping not configured on the counter blocks | Open each counter's VM mapping dialog, ensure QV → VWx is set |
| Client reads wrong values | Byte-order mismatch (big-endian S7 vs. little-endian dashboard) | Toggle word-swap / byte-swap in the Connectitude gateway settings |
| Counter increments by 2 per bag | Sensor bounce; no debounce | Add 100 ms on-delay in front of Cnt input; check sensor response time |
| Counter frozen at 0 | Sensor NPN vs PNP mismatch; wrong input assignment | Verify sensor output type matches LOGO! 24V input polarity |
| Counter resets at wrong time | Weekly Timer B007 misconfigured (e.g., set to 00:00 Monday only) | Set on-time 00:00, off-time 00:01, all days selected |
| Hourly snapshot does not update | Edge-triggered latch wired wrong; snapshot multiplexer not wired | Verify B004.Q → B005 edge → B006 mux select |
| S7 timeout from LoRa router | Switch port blocked; firewall; wrong VLAN | Capture with Wireshark on the switch mirror port; expect S7 comm on TCP/102 |
| Counter overflows at ~32767 | 16-bit INT exhausted (e.g., plant ran 16h straight without reset) | Switch VM mapping to 32-bit DBD; reset counters daily without fail |
| LOGO! enters STOP after program transfer | Memory error from previous program larger than 850-byte VM | Reduce block count or split counters into a second LOGO! 8.3 |
| Cloud dashboard shows last value, not live | Router polling interval misconfigured (e.g., 1 hour instead of 1 minute) | Reconfigure client poll to 60 s; verify counter values change between polls |
| Both counters equal, rejects always 0 | Both sensors wired to same input, or reject gate never opens | Verify sensor 2 location; confirm bad-bag ejector physically triggers sensor 2 |
16. Engineering Notes and Caveats
- LOGO! 8.3 S7 server capacity. The base LOGO! 8.3 accepts only a small number of concurrent S7 connections. For a single Connectitude polling client, this is not an issue. Do not attempt to add a WinCC panel and a TIA Portal online viewer to the same LOGO! 8.3 — it will refuse further connections.
- Program size limit. LOGO! 8.3 supports up to 400 function blocks in a single program. The counter + subtractor + RTC + status word design above uses fewer than 15 blocks, leaving room for future expansion (e.g., shift counters, OEE calculations).
- Cycle time. Counter increments and VM writes happen on the LOGO! scan cycle. A full program of this size runs at 30–60 ms cycles, which is well within the photosensor pulse width of 50–100 ms. The S7 client never sees a partial write because LOGO! updates VM atomically per cycle.
- Endianness. S7 is big-endian on the wire. LOGO! writes values to VM in big-endian order. Most Connectitude gateways handle this transparently; if you see counter values "swapped" (e.g., 0x4E20 = 20000 reading as 0x204E = 8270), enable word-swap on the gateway side.
- Security. The S7 protocol is unauthenticated and unencrypted. The reference design is intended for a physically isolated industrial segment. Do not expose TCP/102 directly to the corporate LAN or the internet.
- Alternative path. If the Connectitude gateway cannot speak S7, the LOGO! 8.3 also exposes a Modbus TCP server on the same Ethernet port. Switching from S7 to Modbus requires only re-enabling Modbus server in LOGO! Soft Comfort (File → Properties) and re-pointing the gateway to the Modbus registers that back the same VM area.
Does the LOGO! 8.3 act as S7 server or client by default?
By default the LOGO! 8.3 is an S7 server when the "Allow S7 access" flag is enabled in the program file properties. The device does not initiate outgoing S7 connections. For this application, the LOGO! is the server and the Connectitude LoRa router is the S7 client.
Which LOGO! memory area does the S7 client read?
The S7 client reads the Variable Memory (VM) area, presented as DB1. Each double-word in DB1 corresponds to a VM double-word; for example, the production counter at VM word VW0 is reachable as DB1.DBW0 and the 32-bit variant as DB1.DBD0.
Do the LOGO! and the LoRa router need to be in the same IP subnet?
Yes. Both devices must share an IP subnet and subnet mask (for example 192.168.0.0/24) and be reachable at Layer 2. There is no router between them. Set static IPs on both devices and disable DHCP for these two nodes.
How are the counters reset each day?
A Weekly Timer in the LOGO! program is set to enable from 00:00 to 00:01 every day. Its output drives the Rst input of both Up/Down Counters. A manual pushbutton on a digital input is OR'd with the same reset line for operator-initiated zeroing.
What happens if the LoRa router cannot be an S7 client?
Switch the LOGO! 8.3 to Modbus TCP server mode (also enabled in File → Properties). The same VM area is exposed as Modbus holding registers starting at 0, and most Connectitude-class gateways speak Modbus natively. The counter logic and VM mapping remain unchanged.