NI OPC Servers to LOGO! 0BA7: Configuring S7-200 Ethernet Driver

David Krause12 min read
OPC / OPC UASiemensTutorial / 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

1. Problem Overview and Architecture

Connecting National Instruments OPC Servers to a Siemens LOGO! 0BA7 logical module is a recurring integration challenge because the LOGO! 0BA7 implements a stripped-down subset of the S7 communication protocol rather than a full S7-300/400 or S7-1200/1500 stack. NI OPC Servers ships with a Siemens TCP/IP S7-200 driver that, when correctly pointed at a LOGO! 0BA7 and configured with a valid TSAP pair on ISO-TSAP port 102, can read digital inputs, digital outputs, and VM markers.

The two failure modes most engineers encounter are:

  • "Device does not respond" in the NI OPC Servers channel diagnostics
  • "Error Occurs / Network error" displayed on the LOGO! front-panel screen

Both symptoms are usually TSAP or boot-order issues, not hardware faults. The goal of this reference is to eliminate the configuration noise and produce a deterministic S7-200-style link from NI OPC Servers 2018 or later to a LOGO! 0BA7 with firmware ES4 or newer.

2. LOGO! 0BA7 Communication Capabilities

The LOGO! 0BA7 (and the successor 0BA8) ships with an on-board Ethernet interface. The on-board port implements:

  • S7 communication as a passive partner (server role only)
  • Modbus TCP (server role, function codes 03/06/16 on the standard ports 502/1025)
  • LOGO!Soft Comfort programming and online monitoring over TCP/UDP 135, 136, 137

For OPC integration you must use the S7 passive-partner side because NI OPC Servers' S7-200 Ethernet driver speaks the S7 protocol on top of ISO-on-TCP (RFC 1006) at port 102. Detailed protocol characteristics for the 0BA7/0BA8 are documented in the Snap7 project notes at https://snap7.sourceforge.net/logo.html.

Three TSAPs are meaningful for OPC integration:

TSAP (hex) Logical Role Use
20.00 LOGO! local S7 connection Reserved by LOGO!Soft Comfort
30.00 LOGO! remote S7 connection Reserved by LOGO!Soft Comfort
02.00 OP / HMI connection Free for OPC / HMI clients
01.00 – 01.FF Additional S7 partners Available if OP not enabled

The crucial rule: if the OP bit is enabled in the LOGO! circuit program, only TSAP 02.00 is free. If OP is not enabled, any free TSAP in the 01.00 – 0F.FF range is usable.

3. NI OPC Servers and the S7-200 Ethernet Driver

NI OPC Servers acts as a protocol bridge that converts the proprietary Siemens S7-on-ISO-TSAP protocol to OPC Classic DA 2.05/3.0 and (in the 2019+ releases) OPC UA. The bridge is documented at https://www.ni.com/en/solutions/industrial-machinery/smart-machine-control/ni-opc-technologies.html. The installation media and current versions are listed at https://www.ni.com/en/support/downloads/software-products/download.opc-servers.html.

The S7-200 Ethernet driver inside NI OPC Servers uses:

  • Transport: ISO-on-TCP (RFC 1006) on TCP port 102
  • Application layer: S7 Communication (S7COMM) with userdata functions 0xF0 (read/write) and 0x00 (setup)
  • Addressing: TSAP pair (Local TSAP, Remote TSAP) per connection
  • Data blocks: VB-area style byte addressing

The driver assumes an S7-200 with CPU 224/226 semantics. A LOGO! 0BA7 speaks the same wire protocol at the byte-stream level, but the data-block offsets are different — see the VM mapping section.

4. VM Memory Map of LOGO! 0BA7

The LOGO! exposes its I/O and flag area through the VM (Variable Memory) byte area. NI OPC Servers does not understand symbolic names; you must address the raw bytes. The mapping is documented in the LOGO!Soft Comfort help under "VM Mapping" and is reproduced below.

LOGO! Object Range VM Address (byte.bit) Length (bits)
Digital Inputs I1 – I24 V923.0 – V925.7 24
Digital Outputs Q1 – Q16 V942.0 – V943.7 16
Marker / Flags M1 – M27 V952.0 – V955.2 27
Analog Inputs AI1 – AI8 V926 – V933 8 words
Analog Outputs AQ1 – AQ2 V938 – V939 2 words
Shift Register Bits S1 – S8 V944.0 – V944.7 8
Cursor Keys C, C V951.0 – V951.2 3
Field rule: Inputs and outputs in the LOGO! are read-only or write-only from the OPC side respectively. Trying to write to V923.0 from the OPC client does not toggle a physical input — it only writes into the LOGO!'s input image, which is overwritten on the next cycle.

Example: to read digital input I1 in NI OPC Servers, create a tag at V923.0 with data type Boolean. To read Q1, create a tag at V942.0.

5. Prerequisites

  1. LOGO! 0BA7 with firmware ES4 or newer (firmware updates from Siemens LOGO!Soft Comfort).
  2. Ethernet cable connected to the on-board RJ45; LINK LED must be solid green.
  3. LOGO! configured with a static IP in the same subnet as the OPC server, for example 192.168.0.10 / 255.255.255.0.
  4. LOGO!Soft Comfort installed; verify Tools → Ethernet Connections shows the module and lets you go online.
  5. NI OPC Servers 2018 or later installed on a Windows 10/11 host. If using the 2024 release, install with the .NET 4.8 runtime.
  6. LabVIEW 2018 or later on the same or a client machine, plus the NI OPC UA or DSC module if you intend to read tags as OPC UA.
  7. The Windows firewall must allow outbound TCP 102 (ISO-TSAP) and outbound UDP 135-137 (LOGO!Soft Comfort discovery, not strictly required for OPC but useful for diagnostics).

6. Step-by-Step: Configuring NI OPC Servers

6.1 Create the project

  1. Launch NI OPC Servers Configuration.
  2. Click File → New, choose a save location, and name the project (for example LOGO0BA7.opf).

6.2 Add the S7-200 Ethernet device

  1. Right-click Channels → Add Channel. Select the Siemens TCP/IP S7-200 Ethernet driver.
  2. Set Network Adapter to the physical NIC that faces the LOGO!. Do not pick a virtual adapter.
  3. Set Default Port to 102. Do not use 10001 — that is the S7-200 PPI/PROFIBUS-over-MPI port used by older MicroWin, not the ISO-TSAP listener on the LOGO!.

6.3 Add the LOGO! as a device

  1. Right-click Devices → Add Device → S7-200.
  2. Enter the LOGO! IP address, for example 192.168.0.10.
  3. Open Device Properties → S7-200 Settings and set:
Parameter Value
Local TSAP 01.00
Remote TSAP 02.00 (or 20.00 if OP is not enabled)
Connection Type PG (or OP)
Slot / Rack 0 / 0 (LOGO! ignores slot for 0BA7)
Timeout (ms) 3000
Retry Count 3
Field rule: The Local TSAP is the OPC-server-side identifier; the Remote TSAP is the LOGO!-side identifier. The pair must not collide with another active S7 connection on the LOGO!. If 02.00 already shows "OP active" in LOGO!Soft Comfort → Tools → Ethernet Connections, use 01.01 remote instead.

6.4 Add tags for inputs and outputs

  1. Right-click the new device, Add Tag.
  2. For I1: address V923.0, data type Boolean, client access Read.
  3. For Q1: address V942.0, data type Boolean, client access Read/Write.
  4. Continue with V924.x and V943.x for the rest of the inputs and outputs as required.

Address syntax accepted by the S7-200 driver is byte-relative and supports the bit separator .: V923.0, V923.1, ..., V943.7. Use VW for 16-bit words and VD for 32-bit double words if you want to read analog channels like AI1 at VW926.

7. Step-by-Step: Configuring the LOGO! Connection

  1. In LOGO!Soft Comfort, open the project that runs on the LOGO! 0BA7.
  2. Select Tools → Ethernet Connections.
  3. Click Add and create a Server Connection with these parameters:
Parameter Value
Connection Type S7 Connection
TSAP local 20.00 (LOGO! side)
TSAP remote 01.00 (OPC server side)
Accept all partners No — restrict to OPC server IP
Active Yes
  1. Download the program to the LOGO! and cycle power to the module so the connection table is re-read.
Boot-order warning: Always write the LOGO! connection table before configuring the OPC channel. If the OPC channel attempts a connection before the LOGO! knows the TSAP, the LOGO! responds with RST and the channel stays disabled. NI OPC Servers cannot auto-recover from RST without a manual reinitialization.

8. Step-by-Step: Reading the Tags from LabVIEW

  1. Open LabVIEW and place a DataSocket Read or, in 2018+, an OPC UA Client Read VI.
  2. Browse the OPC server. NI OPC Servers registers itself under the programmatic identifier National Instruments.NIOPCServers and the versioned tag National Instruments.NIOPCServers.V5 for the 2018+ release.
  3. Navigate to Channel1.Device1.V923.0 for I1 and to Channel1.Device1.V942.0 for Q1.
  4. Use a Boolean indicator for inputs and outputs. For analog channels, use a Numeric Indicator with display format %f if the value is scaled 0–1000 (LOGO! AI default scaling).

If you are using the OPC UA endpoint exposed by NI OPC Servers 2020+, point the UA client at opc.tcp://<opc-host>:49320 and import the namespace http://www.ni.com/opcua/2019/01. Reference documentation is at https://www.ni.com/en/solutions/industrial-machinery/smart-machine-control/ni-opc-technologies.html.

9. Boot-Order and Reinitialization

OPC clients that connect to a PLC before the PLC has finished startup often hang on the first handshake. NI documents this class of issue in their reinitialization knowledge base (article ID 4310258) — the canonical symptom is that the channel works on a clean boot but fails when the OPC server is started before the PLC. Two mitigations:

  1. Boot PLC first. Power the LOGO! 30 s before launching NI OPC Servers, or use a delayed-start service wrapper.
  2. Enable auto-reinitialize. In NI OPC Servers, on the device properties dialog, set Reinitialize on communication failure = Yes, with a retry interval of 5 s. The driver will re-issue the connect CR (Connection Request) after each RST or timeout until the LOGO! responds.

If the OPC server still shows Device does not respond after a clean boot, open the OPC Diagnostics window and capture the wire trace. A healthy handshake looks like: CR → CC → DT (read request) → DT (read response). A failing handshake stops at CR with a TCP RST, which means the LOGO! rejected the TSAP — fix the TSAP pair before anything else.

10. Network Error on the LOGO! Display

If the LOGO! front panel shows "Error Occurs → Network error" while LOGO!Soft Comfort still communicates, the OPC client is trying to use a TSAP the LOGO! does not know. The most common reasons:

  • The LOGO! connection table in LOGO!Soft Comfort lists TSAP 20.00 / 30.00 but the OPC server uses 20.00 / 20.00 on both ends.
  • The OP bit is set in the user program and 02.00 is therefore not free, but the OPC server is configured for 02.00.
  • Two OPC clients (for example two channels in NI OPC Servers, or NI plus a separate Kepware instance) try to bind the same remote TSAP. Only one S7 connection per TSAP is allowed per partner.

Fix the connection table, write it to the LOGO!, then power-cycle. Confirm via Tools → Ethernet Connections → Status that the connection is "Established" before re-launching the OPC channel.

11. Verification Checklist

  1. From the OPC server host, run ping 192.168.0.10 — must succeed with sub-millisecond latency.
  2. Run telnet 192.168.0.10 102 — the connection must open without "connection refused". A "connection refused" here means the LOGO! ISO-TSAP listener is down; verify the network configuration in LOGO! → Settings → Network.
  3. In NI OPC Servers, click Test on the device; verify Connect returns success.
  4. In the OPC Diagnostics trace, confirm a successful CR/CC exchange followed by at least one DT read response.
  5. In LabVIEW, observe tag V923.0; force I1 high by bridging the terminal on the LOGO!. The indicator must toggle within one update interval (default 1 s).
  6. Toggle the OP bit in the LOGO! user program; the connection must remain active if TSAP 01.01 was used as remote.

12. Troubleshooting Matrix

Symptom Likely Cause Resolution
"Device does not respond" from the first request Wrong IP, wrong subnet, or wrong TCP port Telnet 102 to the LOGO!; fix IP/port
Connect succeeds but reads return 0xFFFF Wrong VM offset (data block not present on LOGO! 0BA7) Use the VM table from section 4
Channel goes disabled after PLC power-cycle Auto-reinitialize disabled Enable reinitialize with 5 s retry
LOGO! shows "Network error" TSAP mismatch or duplicate partner Re-write the LOGO! connection table
Inputs read but never change Wrong byte offset (inputs start at V923, not V0) Re-map tags to V923.x
Outputs toggle in OPC but physical output does not respond LOGO! rejects write to Q area via OPC Enable write access in the LOGO! user program (Tools → Parameter VM Mapping) or use M-flag area
OPC channel works in Configuration app but not as a Windows service Service runs under LocalSystem which lacks NIC binding rights Run the NI OPC Servers service under a domain user with rights on the target NIC
Intermittent timeouts during heavy traffic LOGO! 0BA7 supports max 1 active S7 partner on TSAP 20.00 / 30.00 Reduce scan rate to 500 ms; avoid simultaneous HMI + OPC traffic

13. Field-Proven Notes

  • The LOGO! 0BA7 supports at most four S7 passive connections in total, including the programming port. If you already have LOGO!Soft Comfort and an HMI, only one free slot remains for OPC.
  • Set the OPC server scan rate to no less than 250 ms. The 0BA7 cannot sustain 100 ms polling without dropping CR packets, which manifests as the channel flipping between Active and Reinitialize.
  • If the LOGO! is on a managed switch with port-security, register the OPC server's MAC or you will see intermittent RSTs that the driver logs as S7COMM_TIMEOUT.
  • The 0BA7 does not expose S7 function codes for forcing outputs directly. Writing to V942.x sets the output image but does not energise the relay until the next LOGO! cycle, and only if the user program allows it.
  • For long-term reliability, prefer Modbus TCP on port 502 of the LOGO! if you only need read access. NI OPC Servers' Modbus TCP driver is more tolerant of transient outages than the S7-200 driver because it does not rely on the S7 keep-alive.

14. FAQ

Which NI OPC Servers version is recommended for LOGO! 0BA7?

Use NI OPC Servers 2018 or later. The 2018 release introduced the OPC UA endpoint on port 49320 and refreshed the S7-200 Ethernet driver with better TSAP parsing. Download the current build from https://www.ni.com/en/support/downloads/software-products/download.opc-servers.html.

Do I need the NI OPC Servers bridge, or can LabVIEW talk to the LOGO! directly?

LabVIEW has no native S7-200 driver. You can use the free NI DataSocket server, the OPC UA I/O server in LabVIEW DSC, or a third-party S7 client such as LibNoDave. The simplest NI-only path is NI OPC Servers as the bridge, which is documented at https://www.ni.com/en/solutions/industrial-machinery/smart-machine-control/ni-opc-technologies.html.

Why does the LOGO! display "Network error" even though LOGO!Soft Comfort is online?

The "Network error" entry means a configured S7 connection was established and then lost, or a partner tried to open a connection with a TSAP the LOGO! does not know. Verify the LOGO! connection table under Tools → Ethernet Connections and confirm the remote TSAP matches the OPC server's local TSAP exactly.

What VM address do I use for digital input I1 in NI OPC Servers?

Use V923.0. Inputs I1 through I24 occupy V923.0 through V925.7; outputs Q1 through Q16 occupy V942.0 through V943.7. Analog inputs AI1 through AI8 are at VW926 through VW933 (16-bit words).

The OPC channel reports "Device does not respond" but Telnet to port 102 works. What next?

Check the TSAP pair in NI OPC Servers against the LOGO! connection table; a working TCP listener only proves port 102 is open, not that the LOGO! will accept your TSAP. Capture the wire trace in NI OPC Diagnostics and look for the LOGO! sending a TPKT RST after your CR — the RST means TSAP rejection and is fixed by re-writing the LOGO! connection table with the matching pair.

Back to blog