Resolving Disabled Open User Communication on S7-300 CP 341

David Krause15 min read
SiemensTIA PortalTroubleshooting
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

Problem Summary: Disabled Open User Communication Options in TIA Portal V15

An integrator working on a MATLAB-to-PLC data exchange configures TIA Portal V15 on a SIMATIC S7-300 station consisting of CPU 313C (order number 6ES7 313-5BF03-0AB0, firmware V2.6.11) and a CP 341 communications processor. When opening the project's Instructions task card and filtering on Communication > Open User Communication, every block category (TSEND_C, TRCV_C, TCON, TDISCON, TMAIL_C, etc.) appears in a faded, non-selectable state. The same symptom recurs under Communication processor > SIMATIC NET CP. The PLC is offline in the project, the software is fully installed with all optional packages, and changing the CPU version selector does not restore the libraries.

This symptom is not a TIA Portal defect and not a license issue. It is a direct consequence of the hardware catalog selected in the device configuration. The CP 341 family is a serial point-to-point (PtP) communications processor, not an Industrial Ethernet / PROFINET module. TIA Portal therefore correctly hides all Open User Communication (OUC) instructions, which are exclusively Ethernet-bound primitives that operate over TCP, UDP, or ISO-on-TCP transport. They are linked at compile time to the firmware of an Ethernet-capable CPU or Ethernet CP. A serial CP cannot host them.

Three diagnostic facts must be established before any code change is attempted:

  1. The exact catalog (MLFB) number of the inserted CP and its article state (6ES7 341-1XE02-0AE0 vs. 6ES7 341-1CH02-0AE0, etc.).
  2. Whether the slot is occupied by an Ethernet-capable alternative such as a CP 343-1 family module or a CPU variant with integrated PROFINET interface.
  3. Whether the firmware version of the CPU/CP is supported by TIA Portal V15 for OUC (it is; V15 supports OUC on S7-300 CPUs from firmware V2.x and on CP 343-1 family from firmware V1.x onwards).

Root Cause: CP 341 Is a Serial PtP Module, Not an Ethernet Module

The CP 341 family (MLFB prefix 6ES7 341-1...) provides a single serial interface (RS-232C, RS-422, or RS-485 depending on the variant) that is configured for point-to-point protocols. The hardware runs a loadable driver from the CP 341 parameterization tool and exposes its functionality through the standard PtP function blocks: FB 7 (P_PRGE for ASCII / free-port), FB 8 (P_RCV), FB 9 (P_SND), FB 10 (P_PRINT), and the optional Modbus master/slave FBs (FB 80/81/82/83). None of these blocks implements TCP/IP, ISO-on-TCP, UDP, or any Ethernet stack. The serial ASIC on the module cannot transmit or receive Ethernet frames.

By contrast, the CP 343-1 family (MLFB prefix 6GK7 343-1...) is an Industrial Ethernet / PROFINET communications processor for the S7-300 backplane. It implements an internal TCP/IP stack, supports S7 communication, SEND/RECEIVE (ISO-on-TCP, TCP, UDP), FETCH/WRITE, PROFINET IO controller/device, and is the target hardware for Open User Communication instructions in TIA Portal. The Open User Communication library is enabled only when at least one Ethernet-capable device (CPU with PN/PN-IO interface, CP 343-1, CP 343-1 Lean, or CP 343-1 Advanced) exists in the device configuration of the S7-300 station.

Engineering rule: Open User Communication instructions map at download time to the firmware services of an Ethernet-enabled CPU or CP. If no Ethernet service channel is available, the Instruction palette correctly renders the blocks as unavailable. Adding the blocks by hand from another project, or copying instance DBs across projects, will compile but the CPU will return runtime error 0x8085 / 0x80A1 "Fault in connection description" because the underlying CP cannot satisfy the connection descriptor.

Hardware Identification: Distinguishing CP 341 from CP 343 Catalog Numbers

Use the table below to map the inserted module to its actual capability set before changing hardware. Read the MLFB label on the front panel and cross-check against the Siemens Industry Online Support product tree.

MLFB Family Interface Transport supported OUC enabled in TIA Portal?
6ES7 341-1XE02-0AE0 CP 341 RS-232C (V.24) ASCII, 3964(R), Modbus RTU master/slave (loadable) No
6ES7 341-1CH02-0AE0 CP 341 RS-422 / RS-485 (X27) ASCII, 3964(R), Modbus RTU master/slave (loadable) No
6ES7 341-1AE02-0AE0 CP 341 RS-232C + RS-422 combo (limited) ASCII, 3964(R), Modbus RTU No
6GK7 343-1EX30-0XE0 CP 343-1 RJ45 10/100 Mbit, PROFINET TCP, UDP, ISO-on-TCP, S7 comm, PROFINET IO Yes
6GK7 343-1CX10-0XE0 CP 343-1 Lean RJ45 10/100 Mbit TCP, UDP, ISO-on-TCP, S7 comm Yes (no PROFINET IO)
6GK7 343-1HX00-0XE0 CP 343-1 Advanced 2x RJ45 switch, security TCP, UDP, ISO-on-TCP, S7 comm, PROFINET IO, IP routing, firewall Yes
6ES7 315-2EH14-0AB0 CPU 315-2 PN/DP Integrated PROFINET + MPI/DP TCP, UDP, ISO-on-TCP, S7 comm, PROFINET IO controller Yes (firmware V3.x)
6ES7 313-5BF03-0AB0 CPU 313C MPI + DP only No integrated Ethernet port No

The catalog number is the single most reliable diagnostic indicator. CP 341 variants begin with 6ES7 341 and are always serial; CP 343 variants begin with 6GK7 343 and are always Ethernet. The CPU 313C (6ES7 313-5BF03-0AB0) used in the project has no PN/PN-IO port, so without an Ethernet CP it cannot reach any TCP-based service.

Confirming the Symptom: Diagnostic Procedure in TIA Portal V15

Run the following checks before touching hardware. They isolate whether the issue is hardware, software-installation, or project-level configuration.

  1. Open Device Configuration and inspect slot 4 (or whichever slot hosts the CP). Confirm the inserted device exactly matches the physically installed MLFB. A mismatch (e.g., a CP 343-1 inserted in the project while a CP 341 is mounted in the rack) explains a download-time fault but not the disabled Instructions palette, because the palette reflects the inserted project's CP, not the physical rack.
  2. Right-click the station > Properties > Catalog. Confirm that the Hardware Catalog is not filtered to "Modules that can be diagnosed online" only. If filtered, switch to "All modules" so that the full Ethernet CP family is shown.
  3. Check the installed TIA Portal options: Start > Control Panel > Programs > SIMATIC > TIA Portal V15 > Install/Update Additional Components. Verify that "SIMATIC S7-300 Open User Communication" and "CP 343-1" support packages are installed. TIA Portal V15 ships these by default, but minimal installs omit them.
  4. Check the firmware compatibility list: TIA Portal V15 supports CP 343-1 with firmware V2.x and V3.x. CPUs of the S7-300 family require firmware V2.0 or higher for OUC; CPU 313C V2.6.11 is fully sufficient.
  5. Verify whether an Ethernet CP exists in the project: If yes, the OUC instructions should be enabled even though the CP 341 is also present. If no Ethernet CP and no PN-capable CPU is inserted, OUC is correctly disabled. The diagnosis is unambiguous: add Ethernet capability to the station.

Solution Path A: Add an Ethernet CP (CP 343-1 Lean or Standard)

The most direct fix is to insert an Ethernet CP into a free S7-300 backplane slot and re-download the hardware configuration. The CP 343-1 Lean (6GK7 343-1CX10-0XE0) is the recommended minimum for MATLAB TCP integration: it supports TCP, UDP, ISO-on-TCP, and S7 communication at a lower price point than the standard CP 343-1. The standard CP 343-1 (6GK7 343-1EX30-0XE0) is preferred if PROFINET IO is required by other parts of the line.

  1. Power down the S7-300 rack, insert the CP into slot 4 to 11 (slots 0 and 1 are reserved for the power supply and CPU; slot 3 is the interface module for the expansion rack).
  2. Open Device Configuration in TIA Portal V15. From the Hardware Catalog navigate to SIMATIC S7-300 > Communication > CP 343-1 > 6GK7 343-1CX10-0XE0 (or 6GK7 343-1EX30-0XE0). Drag the module to the free slot.
  3. Assign a PROFINET interface with a fixed IPv4 address (e.g., 192.168.0.10, subnet mask 255.255.255.0) under Properties > PROFINET interface [X1] > Ethernet addresses. Disable router and PROFINET IO device mode unless needed.
  4. Enable the CP for Open User Communication: under Properties > Operating mode, confirm "Open communication via TCP / UDP / ISO-on-TCP" is allowed. On CP 343-1 this is enabled by default.
  5. Compile the hardware configuration (right-click station > Compile > Hardware and Software only). The Instructions palette should immediately render OUC blocks (TSEND_C, TRCV_C, TCON, TDISCON, TMAIL_C, etc.) as selectable.
  6. Download the hardware configuration to the CPU. The new CP must be present physically before download, or the online diagnostic buffer returns fault "Module does not exist".
Backplane rule: The CP 343-1 occupies one slot in the S7-300 rack and is addressed by the CPU through the backplane bus as a logical CP with module address derived from its slot. The CP does not need a separate power supply segment when inserted in the central rack.

Solution Path B: Replace the CPU With a PN-Enabled Variant

If a slot is unavailable or rack geometry is fixed, replacing the CPU 313C with a PN-enabled alternative consolidates Ethernet on the CPU itself, freeing the slot and removing the need for an extra CP. Candidates that preserve the S7-300 program footprint:

  • CPU 314C-2 PN/DP (6ES7 314-6EH04-0AB0): replaces 313C, adds integrated PROFINET interface, supports OUC natively. Same work memory class as 313C-2 DP but with PN.
  • CPU 315-2 PN/DP (6ES7 315-2EH14-0AB0): larger work memory, supports OUC and PROFINET IO controller. Recommended for systems that will grow.

Migration in TIA Portal: open the project, right-click the CPU > Change device > SIMATIC S7-300 > CPU 31xC > CPU 314C-2 PN/DP. Re-assign the program blocks (no source change required because OUC blocks are compatible across the S7-300 family), add the integrated PN interface IP address, and recompile. The Instructions palette becomes available immediately because the new CPU carries a PROFINET service channel.

Solution Path C: OPC UA Bridge via SIMATIC NET and MATLAB OPC Toolbox

If the rack cannot be physically altered, route TCP/IP through the Siemens OPC UA server stack and consume the data from MATLAB's OPC Toolbox. This pattern works even when the PLC exposes only MPI/DP and a serial CP. Topology:

  1. SIMATIC NET OPC Server (version V16/V18) runs on a Windows station connected to the S7-300 over MPI/DP/ISO-on-TCP. It exposes an OPC UA endpoint.
  2. MATLAB OPC Toolbox (R2021a or newer) connects as an OPC UA client, browses the server namespace, and reads/writes tags asynchronously using opcua objects.

This path trades deterministic TCP latency for protocol versatility: it works over the existing MPI backbone without new hardware. It is not appropriate for high-speed closed-loop control but is suitable for supervisory data exchange, logging, and parameterization from MATLAB/Simulink.

Solution Path D: Serial Bridge With Modbus RTU to MATLAB

If the integrand goal is MATLAB-to-PLC data exchange and the MATLAB host has a free COM port or USB-to-serial adapter, the existing CP 341 can carry the traffic using Modbus RTU slave protocol. The CP 341 must be loaded with the Modbus slave loadable driver (order number 6ES7 870-1AA01-0YA1, parameterization tool 6ES7 841-0AA01-0YE0 historically, superseded by the SIMATIC PTP Modbus Master/Slave tool). MATLAB then opens the COM port and exchanges Modbus function codes 3 (read holding registers) and 16 (preset multiple registers) directly. This path is useful for legacy brownfield installations, but it is not TCP/IP and does not satisfy "TCP/IP between MATLAB and TIA Portal" as originally specified.

Configuring the CP 343-1 for an OUC TCP Connection in TIA Portal V15

Once the Ethernet CP is inserted, the connection must be described in the Devices & Networks editor. For MATLAB acting as a TCP client and the S7-300 acting as a TCP server, follow the procedure below.

  1. Open Devices & Networks and click the Connections button at the top right.
  2. Select TCP connection from the drop-down list of connection types.
  3. Click the CP 343-1 of the S7-300 station, then click the partner endpoint placeholder. Choose Unspecified because MATLAB is not a TIA Portal device.
  4. Open Properties > General > Address Details
  5. Local port: e.g., 2000 (avoid reserved ports < 1024 and well-known Modbus 502).
  6. Partner IP address: leave blank or use 0.0.0.0 to accept any client.
  7. Partner port: 0 to accept any client-side source port.
  8. Connection name: MATLAB_TCP_server.
  9. Connection ID: e.g., 1 (referenced by TCON in the user program).
  10. Active/passive connection establishment: Passive on the PLC side (server role).
  11. Compile the project. TIA Portal generates a connection DB (system-generated, type "TCON_PARAM" / "CONN_OUA") that contains the IP, port, and connection ID.
  12. In the user program, instantiate TCON, TSEND, TRCV, and TDISCON from the Instructions palette (now enabled). Wire TCON's CONNECT input to the generated connection DB.

PLC Programming: TCON, TSEND, TRCV, and TDISCON Blocks

The OUC blocks reside in the "Communication" subset of the Instructions palette. The following structured-text-style pseudocode captures a typical S7-300 server pattern that exchanges a 32-byte payload with a MATLAB tcpclient instance.

// OB1 cyclic main
// Connection DB auto-generated by TIA Portal: "MATLAB_TCP_server_DB"
// Instance DBs created when blocks are inserted:
//   "TCON_DB"   (instance of FB 65 "TCON")
//   "TSEND_DB"  (instance of FB 68 "TSEND")
//   "TRCV_DB"   (instance of FB 67 "TRCV")
//   "TDISCON_DB" (instance of FB 66 "TDISCON")

// 1. Establish connection once on startup
IF "FirstScan" THEN
    "TCON_DB".REQ := TRUE;
END_IF;

// 2. When connected, send telemetry every cycle
IF "TCON_DB".DONE THEN
    "TSEND_DB".REQ := TRUE;
    "TSEND_DB".ID   := 1;            // matches connection ID
    "TSEND_DB".LEN  := 32;           // payload length
    "TSEND_DB".DATA := P#DB100.DBX0.0 BYTE 32;
END_IF;

// 3. Receive commands into a command DB
"TRCV_DB".EN_R := TRUE;
"TRCV_DB".ID   := 1;
"TRCV_DB".LEN  := 32;
"TRCV_DB".DATA := P#DB101.DBX0.0 BYTE 32;
IF "TRCV_DB".NDR THEN
    // new data available, validate and apply
END_IF;

// 4. Optional: tear down on shutdown
// "TDISCON_DB".REQ := "ShutdownRequested";

Key parameter mappings for S7-300 OUC:

Block / Parameter Typical value Comment
TCON.CONNECT Reference to TCON_PARAM DB Auto-generated by TIA Portal
TCON.ID 1 (matches connection ID) W, integer
TSEND.ID 1 Same connection ID
TSEND.LEN User-defined 1 to 8192 bytes typical
TRCV.LEN 0 = "receive all available" Length = 0 disables boundary marking
TSEND.CONT FALSE for one-shot, TRUE for streaming Streaming mode keeps connection open between sends
TRCV.RCVD_LEN Output, integer Actual bytes received

MATLAB TCP Client Integration

MATLAB exposes TCP client primitives through Instrument Control Toolbox. Modern MATLAB releases (R2020b and newer) use the tcpclient object; legacy code uses tcpip which is deprecated and should be migrated.

% MATLAB R2020b+ TCP client targeting the S7-300 OUC server
host = "192.168.0.10";   % CP 343-1 PROFINET address
port = 2000;            % Local port configured on the PLC

t = tcpclient(host, port, "ConnectTimeout", 5);
configureCallback(t, "terminator", @myCallback);

% Send a 32-byte command frame
command = uint8(zeros(1,32));
command(1:4)   = typecast(uint32(0xCAFEBABE), "uint8");   % sync word
command(5:6)   = typecast(uint16(0x0001), "uint8");       % function code
command(7:32)  = uint8(payloadStruct);                    % payload bytes
write(t, command);

% Read response asynchronously via callback
function myCallback(src, ~)
    if src.NumBytesAvailable > 0
        data = read(src, src.NumBytesAvailable, "uint8");
        fprintf("Received %d bytes\n", numel(data));
    end
end

If the TCP handshake stalls, verify that the CP 343-1 has accepted the connection by inspecting its online diagnostics: Online > Diagnostics > Connection diagnostics in TIA Portal. The connection should appear in state "Established" once MATLAB writes the first byte. The CP uses a three-way handshake consistent with the standard Transmission Control Protocol definition; no special framing is required because OUC runs over raw TCP without a Siemens application-layer envelope.

Verification and Commissioning Checklist

  1. After hardware insertion, the Instructions palette shows TSEND_C, TRCV_C, TCON, TDISCON as selectable with non-grey icons.
  2. The project compiles without warnings about missing connection descriptions.
  3. Download the hardware configuration. The CPU diagnostic buffer must remain free of fault 0x80A1 "Connection resource exhausted" and fault 0x8085 "Fault in connection description".
  4. From the engineering station, ping the CP 343-1 IP address. Successful reply confirms the IP and PROFINET interface wiring.
  5. Use the TIA Portal online "Connection diagnostics" view to verify that the configured TCP connection shows state "Established" once MATLAB calls tcpclient(...) and writes the first frame.
  6. In MATLAB, observe t.NumBytesAvailable incrementing; the myCallback should fire on every TSEND from the PLC.
  7. Capture a Wireshark trace between MATLAB and the PLC; you should see only the TCP three-way handshake and application data, no Siemens proprietary protocol bytes.

Troubleshooting Matrix

Symptom Likely cause Corrective action
OUC instructions greyed out No Ethernet CP or PN-CPU inserted Insert CP 343-1 or migrate to CPU 31x-2 PN
TCON returns STATUS 0x8085 Connection DB not downloaded / wrong ID Re-compile and download hardware configuration; verify ID matches between TIA Portal and TCON.ID
MATLAB tcpclient times out Wrong IP, firewall, or PLC is passive but partner IP is fixed Set partner IP to 0.0.0.0 in the connection properties
Data received but byte-swapped Endian mismatch (S7-300 is big-endian, MATLAB little-endian on x86) Use swapbytes or typecast in MATLAB; or send integer values in network byte order on PLC side using TAW/TAD
Connection drops after a few seconds Keepalive not configured; intermediate firewall idle-timeout Enable TCP keepalive on CP 343-1 properties > Keepalive; tune firewall idle timer
TRCV returns STATUS 0x80A8 Receive length set too short Increase TRCV.LEN or set to 0 for "any length"
Download fails with "Module does not exist" Hardware configuration does not match physical rack Physically insert the Ethernet CP, or revert hardware config to existing modules

Key Takeaways

  • The disabled OUC palette is a hardware-capability signal, not a bug. CP 341 is serial PtP and cannot host TCP-based Open User Communication.
  • Add a CP 343-1 family module, migrate to a CPU with integrated PROFINET, or route traffic through an OPC UA bridge.
  • Confirm catalog numbers, slot assignments, and firmware versions before treating the symptom as a software-installation problem.
  • After Ethernet capability is added, the entire Open User Communication palette becomes available and a TCP connection to MATLAB can be established using standard TCON/TSEND/TRCV blocks.

Why are all Open User Communication instructions greyed out in TIA Portal V15?

The OUC instructions are linked to an Ethernet-capable CPU or CP at compile time. If the station contains only a CP 341 (serial PtP) and a CPU without an integrated PROFINET port, TIA Portal correctly hides the Ethernet-bound blocks. Insert an Ethernet CP such as a CP 343-1, or migrate to a CPU with integrated PROFINET, to enable the palette.

What is the difference between CP 341 and CP 343-1?

CP 341 (MLFB 6ES7 341-1...) is a serial point-to-point module supporting RS-232/RS-422/RS-485 and loadable drivers such as ASCII, 3964(R), and Modbus RTU. CP 343-1 (MLFB 6GK7 343-1...) is an Industrial Ethernet / PROFINET communications processor supporting TCP, UDP, ISO-on-TCP, S7 communication, and PROFINET IO. CP 341 cannot run Open User Communication; CP 343-1 can.

Can the CP 341 be used for TCP/IP communication with MATLAB?

No. CP 341 has no Ethernet interface and no TCP/IP stack. It can exchange serial data only, typically Modbus RTU or ASCII, with a host that has a serial port or USB-to-serial adapter. For TCP/IP between MATLAB and the S7-300 you must add an Ethernet CP or replace the CPU with a PN-enabled variant.

Which blocks are required to set up an OUC TCP server on the S7-300?

Use TCON to establish the passive connection, TSEND to transmit, TRCV to receive, and TDISCON to terminate. Each block is instantiated in its own instance DB; the connection parameters are stored in a TCON_PARAM DB that TIA Portal auto-generates when the connection is configured in Devices and Networks.

Will migrating from CPU 313C to a CPU 315-2 PN/DP require code changes?

No source changes are required for OUC blocks because the TCON/TSEND/TRCV/TDISCON instruction set is identical across S7-300 CPUs. The migration steps in TIA Portal are: change the device to the new CPU, reassign the integrated PROFINET interface IP address, recompile, and download. The Instructions palette becomes available immediately because the new CPU carries a PROFINET service channel.

Back to blog