Siemens LOGO! 0BA0 to LabVIEW: Ethernet Communication Guide

David Krause12 min read
Data AcquisitionSiemensTutorial / 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

Overview

Integrating a Siemens LOGO! with National Instruments LabVIEW over Ethernet is a recurring requirement on small machine retrofits and laboratory test rigs, where the LOGO! handles local discrete I/O and LabVIEW performs higher-level data logging, supervisory control, or HMI rendering. The constraint is that the original LOGO! 0BA0 base module (released 1996) predates the Ethernet-equipped generations, so any statement of feasibility must begin with a hardware reality check before a single TCP socket is opened. This article documents the protocol selection process, the required NI software stack, and the implementation paths that work on every Ethernet-capable LOGO! variant while remaining fully compatible with LabVIEW on Windows or LabVIEW Real-Time targets.

LOGO! 0BA0 Hardware Capability Assessment

The 0BA0 designation identifies the first LOGO! hardware generation (also marketed simply as "LOGO!"). The base units catalog numbers in this family include 6ED1052-1CC00-0BA0, 6ED1052-1MD00-0BA0, and the 8/16 I/O variants. None of these provide:

  • An on-board Ethernet port (RJ45 is absent).
  • An expansion bus slot for the LOGO! AM2 or AM2 RTD Ethernet module (those modules physically fit only 0BA5 and later bases).
  • A serial RS-232/RS-485 port for converting to Ethernet via a third-party gateway.

Programming the 0BA0 requires the LOGO! Soft Comfort RS-232 cable (6ED1057-1AA00-0BA0) and direct connection to a PC COM port. After the program is downloaded, the cable is removed and the LOGO! runs standalone with no remote I/O capability. Therefore, the literal answer to "interfacing a 0BA0 via Ethernet" is: not possible without replacing or augmenting the controller hardware. Two practical paths exist:

  1. Retain the 0BA0 program logic but swap the hardware for a 0BA7 or 0BA8 base module. The user program must be re-imported and re-mapped because the VM (variable memory) address scheme differs across generations, but the ladder/FBD behavior is preserved.
  2. Add an external Ethernet gateway. If the 0BA0 is replaced with any 0BA4/0BA5 base that exposes an AS-i bus, a Schneider Link150, HMS Anybus, or Moxa MGate unit can be configured to map discrete I/O. This is rarely cheaper than a direct controller swap.
Always confirm the generation suffix on the LOGO! label. 0BA0, 0BA1, 0BA2, 0BA3, and 0BA4 are non-Ethernet. 0BA5 (LOGO! 6) added a serial AS-i variant but still no native Ethernet. 0BA6 (LOGO! 7) introduced native Ethernet using Siemens S7 communication only. 0BA7/0BA8 (LOGO! 8 and 8.3) added native Modbus TCP server functionality on port 502.

Compatible LOGO! Generations for Ethernet Communication

Generation Catalog root Ethernet? Native Protocol(s) LabVIEW Path
0BA0 – 0BA4 6ED1052-1x No None Hardware replacement required
0BA5 (LOGO! 6) 6ED1052-2x No None Hardware replacement required
0BA6 (LOGO! 7) 6ED1052-3x Yes (LOGO! AM2 Ethernet module) S7 communication (ISO-on-TCP, port 102) Third-party S7 client in LabVIEW or NI OPC Servers
0BA7 (LOGO! 8) 6ED1052-4x Yes (on-board RJ45) S7 communication, Modbus TCP server (port 502) from FW 1.16 Direct LabVIEW Modbus master or OPC UA
0BA8 (LOGO! 8.3) 6ED1052-5x Yes (on-board RJ45) S7, Modbus TCP, optional LOGO! CMR2020/CMR2040 cloud relay Same as 0BA7 plus OPC UA server via LOGO! Soft Comfort >= 8.3

For a brand-new integration, choose a 0BA7 (e.g., 6ED1052-1MD08-0BA1) or 0BA8 (6ED1052-1MD08-0BA2) base module plus a LOGO! TDE text display if local HMI is required. The Modbus TCP capability is the lowest-friction path to LabVIEW because the protocol maps cleanly to the NI Modbus library without OPC server licensing.

Communication Protocol Selection

Three viable protocols bridge the LOGO! to LabVIEW over TCP/IP. Selection depends on firmware, required throughput, and licensing budget.

Protocol Transport Default Port LOGO! FW Required LabVIEW Implementation Latency License Cost
Modbus TCP TCP 502 0BA7 >= FW 1.16 / 0BA8 any NI Modbus Library (free) or NI Industrial Communications for Modbus TCP ~20 ms Free with LabVIEW
S7 Communication ISO-on-TCP (RFC 1006) 102 0BA6 or newer LibNoDave, Snap7, or NI OPC Servers ~30 ms Third-party or paid
OPC UA TCP 4840 0BA8 with LOGO! Soft Comfort >= 8.3 NI OPC UA Toolkit or third-party UA client ~50 ms Toolkit required

Recommended default: Modbus TCP. It is open, royalty-free, deterministic, and supported by every LabVIEW version since 2012 without additional paid toolkits. S7 is reserved for sites that already run NI OPC Servers and want a single configuration pane for Siemens controllers. OPC UA is chosen when the LOGO! must publish to a multi-vendor SCADA layer rather than to LabVIEW directly.

LabVIEW Communication Stack Prerequisites

Before opening any block diagram, verify the following host-side requirements:

  • LabVIEW 2020 or later (32-bit or 64-bit). The NI Modbus Library is available from the NI downloads portal and installs onto any active LabVIEW version.
  • The NI Modbus Library (VIPM package or built-in palette on LabVIEW 2021+). It provides high-level VIs for opening a TCP connection, reading coils, reading input registers, writing single/multiple registers, and closing the session.
  • If using S7 communication instead, install either the open-source Snap7 client wrapped through LabVIEW Call Library Nodes, or a commercial NI OPC Servers 2019 SP1 or later with the Siemens TCP/IP Ethernet driver enabled.
  • For OPC UA, the NI OPC UA Toolkit 2024 or the open-source open62541 DLL wrapped in LabVIEW.
  • Network reachability: the LOGO! default IP is 192.168.0.3 with subnet mask 255.255.255.0; configure the LabVIEW host on the same subnet or add a static route.
Firewalls on Windows 10/11 block inbound TCP 502 by default. Add an inbound rule allowing TCP 502 (Modbus) and 102 (S7) on the LabVIEW host, or run LabVIEW elevated during the integration phase.

Method 1: Modbus TCP Direct Implementation

This is the simplest and most portable path. The LOGO! 8 acts as a Modbus TCP server (slave) and LabVIEW runs as a Modbus master (client). I/O and VM flags are exposed at fixed addresses documented in the LOGO! Modbus Mapping manual, retrievable from the Siemens Industry Online Support portal under entry ID 109751654.

LOGO! Configuration Steps

  1. Open LOGO! Soft Comfort 8.x, connect to the controller over Ethernet, and assign a static IP, subnet, and gateway under Tools > Ethernet Connections.
  2. In the project tree, expand Online > Modbus TCP Settings and enable the server. Leave the unit ID at 255 (the LOGO! ignores the unit ID and treats all masters identically).
  3. Confirm that any VM (Variable Memory) bits you wish to expose have a defined name in the program; only named variables are reachable via Modbus address offsets.
  4. Download the program and cycle power to the LOGO! so the Modbus server starts cleanly.

LabVIEW Block Diagram Skeleton

The following pseudo-ST demonstrates the polling loop. Translate to LabVIEW by using the Modbus VIs and a flat sequence structure around the polling loop.

// LabVIEW equivalent using NI Modbus Library
Session := MB Open TCP Master.vi
   Host: "192.168.0.3"
   Port: 502
   Timeout: 2000 ms

While Stop button is FALSE:
   I  := MB Read Input Registers.vi(Session, 0, 16, 16#1000) // 16 VM words
   Q  := MB Read Coils.vi       (Session, 0, 16, 16#0000) // 16 Q outputs
   M  := MB Read Coils.vi       (Session, 0, 24, 16#0200) // 24 M flags
   Display I, Q, M on Front Panel
   Wait 100 ms
End While

MB Close.vi(Session)

Method 2: OPC UA Bridging via Third-Party Server

When the LOGO! 8.3 (0BA8) is configured with the OPC UA server enabled in LOGO! Soft Comfort, port 4840 accepts incoming UA sessions. LabVIEW consumes the OPC UA server using the NI OPC UA Toolkit. Advantages: structured tag browsing, encrypted transport, and integration with shared SCADA namespaces. Disadvantages: the toolkit is a paid add-on, and the LOGO! only publishes a flat address space so most UA features are unused.

  1. In LOGO! Soft Comfort 8.3, open Tools > OPC UA Server and enable the server. Define a certificate (self-signed is acceptable for lab use).
  2. On the LabVIEW host, install the NI OPC UA Toolkit and open UA Tag Browser. Add an endpoint at opc.tcp://192.168.0.3:4840.
  3. Drag tags onto the LabVIEW project; the toolkit generates typed VIs for read/write. Use a 250 ms poll rate to avoid saturating the LOGO! embedded server.

Method 3: NI OPC Servers with S7 Communication

This is the right answer for sites with mixed Siemens fleets (S7-1200, S7-1500, ET200SP, and LOGO! 7/8 on the same network). NI OPC Servers 2019 SP1 includes a Siemens TCP/IP Ethernet driver that speaks S7 to the LOGO! 6/7/8 via port 102. LabVIEW reads OPC DA 2.05 / 3.0 items via the LabVIEW DSC module or the OPC Quick Client.

  1. Install NI OPC Servers and launch Configuration.
  2. Add a new channel using driver Siemens TCP/IP Ethernet. Set the device address to the LOGO! IP, rack 0, slot 1 (LOGO! default).
  3. Define device items: I0.0 through I0.7, Q0.0 through Q0.7, and any VM words you have named (e.g., VW0, VW2).
  4. Activate the server. From LabVIEW DSC, add an OPC client I/O server and bind each item to a shared variable.

LOGO! Modbus Register Map (LOGO! 8 / 0BA7-0BA8)

The following table reproduces the published mapping. All addresses are 0-based as sent on the wire; subtract 1 in LabVIEW function calls that use Modicon-style 1-based addressing.

Modbus Function Code Memory Type Address Range LOGO! Resource Access
01 / 02 Discrete Inputs 0000 – 0007 Inputs I1 – I8 R
01 / 05 / 15 Coils 0000 – 0007 Outputs Q1 – Q8 R/W
01 / 05 / 15 Coils 0200 – 0231 Merker M1 – M24 R/W
03 / 04 Input Registers 0000 – 0007 Analog inputs AI1 – AI8 R
03 / 06 / 16 Holding Registers 0000 – 0007 Analog outputs AQ1 – AQ2 (16-bit) / VM words R/W
03 / 04 / 06 / 16 Registers 1000 – 10FF Variable memory VW0 – VW255 (named VM words) R/W

Bit-packed access (function 01/02/05/15) is faster for digital state. For analog values, use function 04 against the AI region; the LOGO! returns signed 16-bit values scaled by the configured sensor type. Raw engineering units require division by 100 in LabVIEW if the sensor is a Pt100/Pt1000, or by 10 for 0-10 V inputs.

Step-by-Step: Building the LabVIEW Modbus Master

  1. Create a new LabVIEW VI. Drop a MB Open TCP Master.vi from the Modbus palette on the block diagram. Wire the IP constant "192.168.0.3" and port constant 502. Set timeout to 2000 ms.
  2. Add a While Loop. Inside, place four MB Read VIs: one for coils (Q1–Q16), one for discrete inputs (I1–I16), one for input registers (AI1–AI8), and one for holding registers (VW0–VW15).
  3. Convert the boolean array returned by the coil read into an array of named booleans (e.g., Boolean Array to Boolean Indicator Cluster). Wire each element to a labeled LED on the front panel.
  4. Convert the 16-bit signed register values to engineering units using a Divide primitive followed by a Numeric Indicator. For Pt100 inputs, divide by 10; for 0-10 V, divide by 1000.
  5. Add a Wait (ms) set to 100. This caps the loop at 10 Hz, well below the LOGO! Modbus server throughput.
  6. Outside the loop, place MB Close.vi inside an Error Handler case structure so the TCP session terminates cleanly on Stop.
  7. Save as LOGO_Modbus_Master.vi and run. Verify that the LED cluster mirrors the physical inputs and outputs.

Verification and Diagnostics

Acceptance testing follows three steps once the LabVIEW master is running:

  1. Wire-level check. Install Wireshark on the LabVIEW host and capture on the Ethernet adapter. Apply filter modbus. You should see a steady stream of MBAP headers with transaction IDs incrementing by 1. Missing transaction IDs indicate dropped requests or socket errors.
  2. Logical check. Force each LOGO! input low and high with a jumper or test switch and verify the corresponding LabVIEW indicator changes within 200 ms. Force each output from LabVIEW using MB Write Single Coil.vi and measure the LOGO! output terminal with a multimeter.
  3. Stress test. Run the LabVIEW loop for 24 hours with logging enabled. Confirm zero disconnections and zero CRC or transaction-ID errors. The LOGO! 8 server is rated for indefinite TCP session holding, but Watchdog timers in the LOGO! program itself can clear the session if the Watchdog time is exceeded.
Enable the LOGO! program Watchdog with a value above 500 ms if you intend to halt the LOGO! during firmware updates. A Watchdog time shorter than the LabVIEW poll interval will trip and reset outputs unexpectedly.

Troubleshooting Matrix

Symptom Likely Cause Diagnostic Fix
LabVIEW error -1950679027 "TCP Open" Wrong IP, firewall, or controller offline Ping the LOGO!; verify router port 502 allowed Add Windows firewall inbound rule for TCP 502; correct IP in MB Open
Error -1950679034 "Modbus Illegal Function" Attempting S7-only functions on 0BA6 base Check LOGO! generation label Replace base with 0BA7 or 0BA8, or switch to NI OPC Servers with S7 driver
Coils read returns all FALSE Address mismatch: using 1-based instead of 0-based Inspect wire with Wireshark Subtract 1 from all coil addresses before passing to LabVIEW
Read succeeds but writes have no effect Programmed VM word does not exist Open LOGO! Soft Comfort online view Define the VM word in the program and redownload
Connection drops every 5 minutes LOGO! Watchdog set to 300 s View LOGO! > Diagnostics > Watchdog Increase Watchdog to 0 (off) or above poll rate * 3
OPC UA client returns BadCertificate Untrusted LOGO! certificate on LabVIEW host Check UA session log Export the LOGO! certificate from Soft Comfort and add to the UA client trust store

Frequently Asked Questions

Can a Siemens LOGO! 0BA0 talk to LabVIEW over Ethernet at all?

No. The 0BA0 base has no Ethernet port, no expansion bus for the LOGO! AM2 Ethernet module, and no serial port. Direct Ethernet communication requires replacing the controller with at minimum a 0BA6 (LOGO! 7) base plus the LOGO! AM2 Ethernet module, or a 0BA7/0BA8 (LOGO! 8 / 8.3) base with on-board RJ45.

What is the easiest firmware to use for Modbus TCP from LabVIEW?

LOGO! 0BA7 with firmware 1.16 or higher, or any 0BA8. Modbus TCP server runs on TCP port 502 and the NI Modbus Library in LabVIEW communicates without any paid add-on. Address named VM variables from offsets 0x1000 upward and digital I/O at offsets 0x0000.

Do I need the NI Industrial Communications for EtherNet/IP toolkit?

No. EtherNet/IP is not supported by any LOGO! generation. The toolkit is useful for Allen-Bradley and other EtherNet/IP controllers but provides no value on a LOGO!. Use the free NI Modbus Library or NI OPC Servers instead.

What is the maximum sustainable polling rate between LabVIEW and the LOGO! 8 Modbus server?

Empirically about 50 requests per second with four registers per request before the LOGO! starts queueing and adding jitter. A 10 Hz loop with consolidated reads (one request per memory region) is the recommended upper bound for reliable operation over weeks of continuous logging.

Can I use OPC UA instead of Modbus TCP for newer LOGO! 8.3 bases?

Yes. Enable the OPC UA server in LOGO! Soft Comfort 8.3 or later, accept the self-signed certificate in the NI OPC UA Toolkit client, and browse to opc.tcp://<LOGO_IP>:4840. Latency is higher (around 50 ms) and the toolkit is paid, but OPC UA provides encrypted transport and a hierarchical tag namespace useful in multi-vendor SCADA.

Back to blog