Writing XML Files from S7-1200/1500 PLCs to a Network Server

David Krause19 min read
S7-1200SiemensTechnical Reference
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: The XML-on-PLC Problem

Siemens SIMATIC S7-1200 and S7-1500 controllers do not provide a native file-system service that maps a UNC path such as \\server\EDV\machine_no\part_xyz.xml as a logical drive to which the user program can stream an XML document. The S7-1200/1500 user program operates on bit memory, data blocks, I/O areas, and on the controller's own load memory; it has no Windows-style file API. The WinCC Runtime Professional PC-based HMI/scada layer, in contrast, can read and write Windows file paths directly through VBScript or C-script, which is why most published solutions show WinCC RT as the file producer.

For a PLC-only architecture, the engineer must therefore select from one of the following transport mechanisms, each of which has its own hardware, firmware, and licensing profile:

  • OPC UA XML server interface on the S7-1500 (firmware V2.6 or later for the basic server, V2.9 or later for the FileType object and Companion Specifications). The S7-1200 supports an OPC UA server from firmware V4.4.
  • FTP client push from a CP 1543-1 communications processor (6GK7543-1AX00-0XE0 for S7-1500) or CP 1243-1 (6GK7243-1BX30-0XE0 for S7-1200) to a remote FTP/FTPS server.
  • Programmatic XML generation as a character buffer in a DB, transmitted via the Open User Communication (OUC) instructions TCON/TSEND/TRCV, TFTP, or OPC UA method call.
  • Industrial Edge S7 Connector XML export on an Edge runtime IPC, which reads PLC tags and writes XML to a local file system share.

The trade-off is consistent: OPC UA is the cleanest fit for standardised machine-to-machine data exchange, FTP via the CP 1543-1 is the most direct fit for depositing files to a server path, and programmatic generation is the cheapest in hardware terms but the most maintenance-heavy in engineering time. The Siemens Online Support entry 81367009 documents the FTP route, and entry 103550797 documents the TCON/TSEND route. Both are valid starting points.

Native XML Handling in the S7-1200/1500 Runtime

The TIA Portal V20 documentation makes the rule explicit: SIMATIC S7 controllers do not provide a runtime XML parser or generator. The XML files that can be consumed by a TIA Portal project are limited to:

  • OPC UA server interface definitions (Nodeset2 XML).
  • GSD/GSDML files for PROFINET device descriptions.
  • TIA Portal project export/import bundles (the .tiaz archive that contains XML manifests).

Within the runtime of the controller, however, the user program can treat a sequence of characters in a DB as an XML payload. There is no built-in BuildXml instruction. The engineer constructs the string in SCL or STL using CONCAT, MID, LEFT, RIGHT, and character-by-character assignment, then writes the string to a transport (FTP STORE, TCP send, OPC UA write, or PG/PC route).

The TIA Portal V20 documentation on OPC UA explicitly states the rules for OPC UA XML files: the namespace http://www.siemens.com/simatic-s7-opcua is reserved for Siemens-specific extensions, and the namespace http://opcfoundation.org/UA/ is the OPC Foundation base. When the controller exposes variables as an OPC UA server, the TIA Portal generates the Nodeset2 XML automatically from the configured server interface; the runtime does not store or read user-defined XML, and the OPC UA client must consume the published variables or call the published methods. See the TIA Portal V20 - Rules for OPC UA XML files (S7-1500, S7-1500T) for the complete namespace table.

Method 1 - OPC UA XML Server Interface (S7-1500)

The S7-1500 OPC UA server exposes data block tags, PLC tags, and method calls to an OPC UA client. The server interface is configured in TIA Portal under Properties > OPC UA > Server. The server generates an XML Nodeset2 file at compile time, but the runtime behaviour is variable publication: a client reads the variable's value over the wire, not an XML file.

For a "write an XML file to a server" requirement, the OPC UA route is therefore indirect. The supported patterns are:

  1. Publish the XML as a STRING variable. The user program builds the XML in a DB of type STRING[nnnnn] and exposes that tag through the OPC UA server. A client (e.g. a Python or C# script on the server PC) subscribes to the variable and writes the file to the local disk. This pattern works on S7-1500 firmware V2.6+ and S7-1200 firmware V4.4+.
  2. Expose a method that returns the XML. The OPC UA client calls a method on the server, the server's SCL function builds and returns the XML, and the client writes the file. This pattern requires an OPC UA method implementation in the user program and is supported on S7-1500 firmware V2.9+.
  3. Use the OPC UA FileType object (Part 20 of the OPC UA specification). The S7-1500 firmware V2.9+ exposes the controller's web server directory as a file system. A client can Create/Write/Read/Delete files in that directory. The user program must move the file to the network share using a separate FTP or UNC path mechanism; the FileType object alone does not push to a remote share.

None of the three patterns place a file on a remote Windows share from the controller alone. The OPC UA server on the S7-1500 is, in the strict sense, a data publisher, not a file depositor.

OPC UA Server Configuration Parameters

Parameter S7-1500 default S7-1200 default Notes
Server endpoint port 4840 4840 Configurable in TIA Portal
Security policy None, Basic128Rsa15, Basic256, Basic256Sha256 None, Basic256Sha256 Set per endpoint
Max sessions 100 20 Configurable
Max subscriptions 100 20 Configurable
Sampling interval 100 ms 1000 ms Minimum allowed
Method calls supported Yes (FW V2.9+) Yes (FW V4.4+) Requires SCL implementation
FileType object Yes (FW V2.9+) No Maps to /webserver path

Method 2 - FTP Client on CP 1543-1 (S7-1500) and CP 1243-1 (S7-1200)

The CP 1543-1 (6GK7543-1AX00-0XE0) for S7-1500 and CP 1243-1 (6GK7243-1BX30-0XE0) for S7-1200 provide an integrated FTP/FTPS client that can be triggered from the user program. The CP maintains the TCP connection, the FTP protocol state machine, and the SSL/TLS handshake; the user program calls a function block and supplies the file source (a DB buffer on the controller's load memory) and the remote path.

Hardware and Firmware Prerequisites

Module Order number Firmware FTP client FTPS (explicit) FTPS (implicit) SFTP
CP 1543-1 6GK7543-1AX00-0XE0 V2.0+ Yes Yes (V2.2+) Yes (V2.2+) No
CP 1543-1 (newer) 6GK7543-1AX10-0XE0 V3.0+ Yes Yes Yes No
CP 1243-1 6GK7243-1BX30-0XE0 V3.0+ Yes Yes (V3.1+) Yes (V3.1+) No
CP 1243-7 LTE 6GK7243-7KX30-0XE0 V3.0+ Yes Yes Yes No

Note: The CP 1543-1 and CP 1243-1 do not support SFTP (SSH File Transfer Protocol). If the server only accepts SFTP, the engineer must use a third-party FTP-to-SFTP gateway, replace the server with an FTP/FTPS endpoint, or move to OPC UA over a TLS-secured channel.

TIA Portal FTP Configuration

  1. Insert the CP in the device view of the S7-1500 rack or S7-1200 left-side slot.
  2. Open Properties > FTP.
  3. Enable the FTP client role and assign the user program to a connection ID (1..16).
  4. Enter the FTP server address, port (default TCP 21, implicit FTPS 990), user name, password, and transfer mode (active or passive). For NAT/firewall traversal, passive mode is almost always required.
  5. Select the security profile: None (plain FTP), Explicit FTPS (FTPES) (AUTH TLS on port 21), or Implicit FTPS (TLS on port 990).
  6. Compile the project and download the configuration to the CP. The CP retains the FTP connection parameters in non-volatile memory; the user program supplies only the file name and trigger.

User Program: FTP_STORE Block

The TIA Portal provides the FTP_CMD function block in the "Communication" library, and Siemens Online Support entry 81367009 documents a reusable FTP_STORE pattern. The block parameters are:

Parameter Type Description
REQ BOOL Rising edge triggers the command
ID WORD Connection ID (must match TIA Portal FTP configuration)
CMD INT 5 = STORE (upload), 6 = RETR (download), 7 = DELETE, 8 = LIST
LOCAL_FILE STRING[254] Path on the controller's memory card, e.g. /xml/buffer.xml
REMOTE_FILE STRING[254] Path on the FTP server, e.g. /EDV/machine_no/part_xyz.xml
DONE BOOL Set when command completes
ERROR BOOL Set on error
STATUS WORD Status code (see Siemens manual for full list)

SCL Example: FTP Upload Triggered by Cycle Counter

// Build the XML string in the DB
"DB_XML_Buffer".xml_data := '';
"DB_XML_Buffer".xml_data := CONCAT(IN1 := '',
                                    IN2 :='<PartData timestamp="',
                                    IN3 := DWORD_TO_STRING(TIME()) );
"DB_XML_Buffer".xml_data := CONCAT(IN1 := "DB_XML_Buffer".xml_data,
                                    IN2 := '">');
"DB_XML_Buffer".xml_data := CONCAT(IN1 := "DB_XML_Buffer".xml_data,
                                    IN2 := '<PartNo>',
                                    IN3 := "DB_Part".part_no);
"DB_XML_Buffer".xml_data := CONCAT(IN1 := "DB_XML_Buffer".xml_data,
                                    IN2 := '</PartNo><Cycle>',
                                    IN3 := INT_TO_STRING("DB_Part".cycle_count));
"DB_XML_Buffer".xml_data := CONCAT(IN1 := "DB_XML_Buffer".xml_data,
                                    IN2 := '</Cycle></PartData>');

// Save the buffer to the memory card first
"FileWrite".REQ  := TRUE;
"FileWrite".FILE := '/xml/buffer.xml';
"FileWrite".DATA := "DB_XML_Buffer".xml_data;

// Trigger FTP upload once the file is committed
IF "FileWrite".DONE THEN
    "FileWrite".REQ := FALSE;
    "FTP_CMD".REQ        := TRUE;
    "FTP_CMD".ID         := 1;
    "FTP_CMD".CMD        := 5;        // STORE
    "FTP_CMD".LOCAL_FILE := '/xml/buffer.xml';
    "FTP_CMD".REMOTE_FILE:= '/EDV/machine_no/part_xyz.xml';
END_IF;

IF "FTP_CMD".DONE OR "FTP_CMD".ERROR THEN
    "FTP_CMD".REQ := FALSE;
END_IF;

Method 3 - Programmatic XML Generation in a DB

The cheapest method in hardware terms (no CP module, no Industrial Edge, no PC) is to build the XML character-by-character in a DB and transmit it through the standard Open User Communication instructions. The trade-off is engineering effort: every field added to the XML schema requires a CONCAT line in SCL and a corresponding entry in the documentation. For static reports with a fixed schema, this is manageable; for dynamic or user-defined schemas, the cost of building and maintaining the generator quickly exceeds the cost of a CP 1543-1.

DB Layout for the XML Buffer

DATA_BLOCK "DB_XML_Buffer"
{ S7_Optimized_Access := 'TRUE' }
AUTHOR : eng
FAMILY : xml
VERSION : 1.0
  STRUCT
    xml_data : STRING[50000];   // 50002 bytes
    xml_len  : DINT;            // current length in chars
    template_id : INT;          // 0=full, 1=delta, 2=alarm
    error_code : WORD;
    busy : BOOL;
    done : BOOL;
  END_STRUCT;
END_DATA_BLOCK

For buffers larger than 50000 characters, use ARRAY[0..n] OF BYTE with manual length tracking; STRING in TIA Portal is limited to 254 bytes for the classic non-optimised type and 65534 characters in the optimised STRING[n] type. For larger payloads, switch to the BYTE array approach with a MID/LEFT/RIGHT sequence on a STRING wrapper.

SCL String Builder Patterns

// Pattern 1: numeric to string
"DB_XML_Buffer".xml_data := CONCAT(IN1 := "DB_XML_Buffer".xml_data,
                                    IN2 := '<Temp>',
                                    IN3 := REAL_TO_STRING("DB_Process".temperature),
                                    IN4 := '</Temp>');

// Pattern 2: escape special characters
"DB_XML_Buffer".xml_data := CONCAT(IN1 := "DB_XML_Buffer".xml_data,
                                    IN2 := '<Name>',
                                    IN3 := "DB_Process".part_name_escaped, // pre-escaped
                                    IN4 := '</Name>');

// Pattern 3: nested element with attribute
"DB_XML_Buffer".xml_data := CONCAT(IN1 := "DB_XML_Buffer".xml_data,
                                    IN2 := '<Measure id="M1" unit="mm">',
                                    IN3 := REAL_TO_STRING("DB_Process".dim1),
                                    IN4 := '</Measure>');

Note on character escaping: The five XML predefined entities &lt;, &gt;, &amp;, &quot;, &apos; must be replaced in any user-supplied string. A simple escape function scans the input character by character and writes &lt; for <, &gt; for >, and &amp; for &. Build this as a reusable FC in the project library.

Transmitting the Buffer over OUC

For TCP-based transmission to a custom server, the user program uses the TCON/TSEND/TRCV instruction set from the standard TIA Portal library. The XML buffer is the DATA pointer of TSEND. Siemens Online Support entry 103550797 provides a complete TCON/TSEND sample for the S7-1500 with active connection establishment, LEN, and DONE/ERROR handling.

"TSEND_DB".REQ   := TRUE;
"TSEND_DB".ID    := 1;
"TSEND_DB".LEN   := "DB_XML_Buffer".xml_len;
"TSEND_DB".DATA  := "DB_XML_Buffer".xml_data;
"TSEND_DB".DONE  := ... ;   // user program checks
"TSEND_DB".ERROR := ... ;
"TSEND_DB".STATUS:= ... ;

Method 4 - Industrial Edge S7 Connector XML Export

The Industrial Edge S7 Connector runs on an Industrial Edge runtime (IPC with the IE runtime installed) and pulls tag values from the S7-1500/S7-1200 over S7 communication or OPC UA. The Common Configurator exports the tag list as an XML file, which the connector can then forward to a local file system, an MQTT broker, or an OPC UA client. The XML file export - SIMATIC S7 Connector - Industrial Edge documentation describes the workflow: compile the TIA Portal project, navigate to the desired PLC's tag list, right-click and select Export file, save as XML, import the XML into the S7 Connector Common Configurator, map the tags, and configure the export target.

This method requires an Industrial Edge IPC in the architecture, which re-introduces the PC the original question sought to avoid. It is the right answer when the customer already has Industrial Edge infrastructure (data lake, containerised apps, Edge apps for analytics), but it is not a PLC-only solution.

Network Architecture - Subnets, Routers, Static IPs

The source question places the PLC and the server in different subnets, with a programmable router (e.g. SCALANCE M876-4, MUM-800, SC646-2C) in between. The relevant design rules for each transport are:

Transport Ports (control) Ports (data, active) Ports (data, passive) NAT considerations
Plain FTP 21/TCP 20/TCP (server -> client) 1024-65535/TCP (server listens) Passive mode + NAT requires application-layer gateway (ALG) on router
Explicit FTPS 21/TCP + AUTH TLS Same as FTP Same as FTP Same as FTP
Implicit FTPS 990/TCP + TLS 989/TCP (server -> client) 1024-65535/TCP (TLS) Same as FTP
OPC UA 4840/TCP n/a n/a Single port, NAT-friendly
TCP (OUC) User-defined n/a n/a Single port, NAT-friendly

Field caveat: Many SCALANCE and Cisco routers strip the FTP control connection's PORT or PASV payload, which breaks the data channel after the TLS handshake. Enable the FTP ALG on the router, or use passive mode with a static port range that is port-forwarded 1:1 to the server. FTPS adds a second layer of complexity because the control channel is encrypted and the router cannot read the PORT/PASV argument; in that case, use passive mode and a fixed server-side port range that is explicitly allowed in the router ACL.

Memory and Performance Considerations

CPU Work memory (data) Load memory (code + data) String concatenation cost (50 KB)
S7-1211C / S7-1212C 50 KB 1 MB (Memory Card) ~50 ms
S7-1214C / S7-1215C 100-150 KB 4 MB (Memory Card) ~30 ms
S7-1511-1 PN 150 KB 320 MB (Memory Card) ~10 ms
S7-1515-2 PN 500 KB 320 MB (Memory Card) ~6 ms
S7-1518-4 PN/DP 4 MB 700 MB (Memory Card) ~2 ms

The figures are rough wall-clock measurements of a single 50 KB string build with ten CONCAT calls on a warm controller. A 50 KB XML payload transferred over 100 Mbit/s Ethernet takes approximately 4 ms wire-time (excluding TCP handshake and FTP protocol overhead). An OPC UA publish of a 50 KB STRING variable with the Basic256Sha256 security profile on a S7-1515 takes 50-200 ms per call. For cycle-by-cycle XML generation, prefer to assemble the buffer in a low-priority OB (e.g. OB1 in a slow task) and trigger the FTP/TCP push on a part-completion event, not in the fast OB.

Step-by-Step: FTP Upload with CP 1543-1

  1. Add the CP 1543-1 to the S7-1500 rack and connect its PROFINET port X1 to the PLC subnet switch.
  2. Configure the CP's IP address (e.g. 192.168.1.10/24) and the default gateway to the SCALANCE router (e.g. 192.168.1.1).
  3. Open Properties > FTP on the CP, enable the FTP client, and enter the FTP server address (e.g. 192.168.10.5), port 21, user name, password, and transfer mode (passive recommended).
  4. Compile and download the hardware configuration to the CPU and CP.
  5. Create DB DB_XML_Buffer with a STRING[50000] field and a DINT length field.
  6. Create a user FC that builds the XML in DB_XML_Buffer using CONCAT, with character escaping for any user-supplied text.
  7. Create the FTP upload instance: drag FTP_CMD from the Communication library, assign the connection ID configured in step 3, and wire REQ/CMD/LOCAL_FILE/REMOTE_FILE.
  8. Save the buffer to the memory card with the FileWrite FB (path /xml/buffer.xml).
  9. On the FTP server (e.g. FileZilla Server, IIS FTP, vsftpd), create the destination directory /EDV/machine_no/ and set write permissions for the configured user.
  10. Download the user program and test with a trigger from the watch table.
  11. Verify on the FTP server that the file appears with the expected size and content.

Step-by-Step: Programmatic XML Build in SCL

  1. Create DB DB_XML_Buffer as above (STRING[50000], DINT length, INT template id).
  2. Create an FC XML_Reset that sets xml_data := '' and xml_len := 0.
  3. Create an FC XML_Append with inputs tag_in : VARIANT and tag_format : INT (0=raw, 1=escape) that calls CONCAT to append the converted tag to the buffer and updates xml_len.
  4. Create an FC XML_Escape that scans an input STRING and replaces < with &lt;, > with &gt;, & with &amp;, " with &quot;, and ' with &apos;.
  5. Create an FC XML_Build that calls XML_Reset, then a sequence of XML_Append calls for each schema element, then closes the root element.
  6. Trigger XML_Build from a part-completion event in the user program.
  7. Save the buffer to a file on the Memory Card with FileWrite, then trigger the FTP push (Method 2) or a TCP push (Method 3 transport) to the server.

Commissioning and Verification

  1. CP-to-server reachability. Open the CP's web interface (https://192.168.1.10) and run the diagnostic ping to the FTP server address. A successful ping confirms the IP route and the ACL.
  2. FTP authentication. Use a Windows FileZilla client with the same user credentials and confirm login from a PC on the PLC subnet. If FileZilla fails, the credentials or the server are wrong; the CP will report the same failure as STATUS 8 (auth) or 10 (connection refused).
  3. First upload. Trigger the FTP upload from the watch table and confirm DONE=TRUE. On the FTP server, check the file modification time and size.
  4. Well-formed XML check. Download the file and open it in a browser or in xmllint --noout file.xml. The browser must render the file as a structured document, not a raw text view.
  5. Variable value check. Cross-check the part number, cycle count, and timestamp in the XML against the corresponding PLC tags in the watch table.
  6. Time synchronisation. Verify the controller's time (CPU Properties > Time of Day) is synchronised via NTP. The CP 1543-1 supports NTP client from firmware V2.0+; configure the NTP server under Properties > Time.
  7. Security policy check. If FTPS is in use, confirm the certificate chain on the server is valid and that the CP's trust store contains the CA. A self-signed server certificate must be imported into the CP's trust store, or the handshake fails with STATUS 0x8A (TLS alert).
  8. Throughput and load. Trigger 100 uploads in a loop and observe the OB1 cycle time. If the cycle time increases by more than 5 ms, consider moving the XML build to a cyclic OB (e.g. OB30 at 1 s) instead of OB1.

Troubleshooting Matrix

Symptom Likely cause Diagnostic Remediation
FTP_CMD STATUS 0x0001, ERROR=FALSE, no DONE CP is still establishing the TCP connection Wait 5 s; check CP web diagnostic Increase wait time, or check subnet routing
FTP_CMD STATUS 0x0008, ERROR=TRUE Connection refused; server down or port blocked Telnet from CP's web diagnostic to port 21 Start FTP service; open port 21 on firewall
FTP_CMD STATUS 0x000A, ERROR=TRUE Authentication failure Try same user from FileZilla Re-enter credentials in TIA Portal and re-download to CP
FTP_CMD STATUS 0x002F, ERROR=TRUE File not found on controller Check /xml/ directory on Memory Card via web Create directory; verify FileWrite committed
FTP_CMD STATUS 0x008A, ERROR=TRUE TLS alert during FTPS handshake Open FTP server log; check certificate Import server CA into CP trust store
File appears on server but is empty (0 bytes) FileWrite did not flush; or wrong file name Check FileWrite.DONE and STATUS Wait for DONE before FTP trigger; verify file name
File appears but XML parser reports malformed Missing closing tag or unescaped special char Open in xmllint, find first error line Add XML_Escape calls; verify CONCAT order
FTP transfer takes >5 s for 50 KB Passive mode + NAT, or low CP firmware Capture Wireshark on server Use active mode with port forwarding; update CP firmware to V2.2+
OPC UA client cannot connect (Bad_ConnectionRejected) Wrong endpoint URL or security policy UA Expert test client Verify URL opc.tcp://192.168.1.10:4840 and certificate trust
OPC UA method call returns Bad_NotImplemented CPU firmware < V2.9 (S7-1500) or < V4.4 (S7-1200) Check CPU firmware version in TIA Portal Update CPU firmware
Memory card full; FileWrite fails Older XML files not deleted Web diagnostic > File system Add DELETE step in user program after successful FTP upload

Selecting the Right Method for the Application

Criterion OPC UA FTP via CP 1543-1 Programmatic OUC Industrial Edge S7 Connector
Hardware cost None (built-in to FW) CP 1543-1 (~$1500) None IE IPC (~$2000+)
Engineering effort Low (configure server) Medium (CP + FB + DB) High (string build + transport) Low (configurator)
Server-side effort High (client writes file) Low (FTP server receives) High (custom server) Low (Edge app pushes)
Real-time latency 100-500 ms 200-2000 ms (FTP control) 50-200 ms (TCP) 1000-5000 ms (polling)
Dynamic XML schema No (fixed variables) Yes (DB content) Yes (DB content) Limited (tag list)
Security TLS + certificate FTPS or plain TLS or plain TLS via OPC UA

For a static XML schema (e.g. one record per part, fixed fields), the FTP route with the CP 1543-1 is the lowest-risk, most maintainable choice. For a dynamic schema (e.g. user-defined data points per machine), the programmatic OUC route gives the most flexibility but requires the most engineering discipline. The OPC UA route is the best fit when a downstream SCADA/MES system is already in place to consume the published variable or call the published method. The Industrial Edge route is the right answer when the customer has already invested in the IE ecosystem.

Can an S7-1200 or S7-1500 write an XML file directly to a Windows network share?

No. The S7-1200/1500 user program has no UNC path API. The supported file transports are FTP/FTPS via a CP 1243-1/CP 1543-1, Open User Communication (TCP) via TCON/TSEND, OPC UA method calls, and file save to the local Memory Card. To land a file on a Windows share, either run an FTP server on the Windows host and push from the CP, or run an OPC UA client on the Windows host that subscribes to the controller's exposed variable and writes the file locally.

Which CP 1543-1 firmware supports the FTP client?

CP 1543-1 (6GK7543-1AX00-0XE0) supports the FTP client from firmware V2.0. Explicit and implicit FTPS are supported from firmware V2.2. The newer CP 1543-1 (6GK7543-1AX10-0XE0) runs firmware V3.0 or later and supports the same FTP/FTPS feature set. SFTP (SSH) is not supported on either module; use FTPS or a third-party gateway if SFTP is required.

Can OPC UA be used to write a file on the remote server?

Indirectly. The S7-1500 firmware V2.9+ exposes the web server directory as an OPC UA FileType object, and a client can create/write files in that directory. The controller does not push the file to a remote server; the client (on the server PC) must move the file from the controller's web server to the final destination. The simpler pattern is to expose the XML as a STRING variable and let a client subscribe and write the file locally.

What is the maximum XML size that can be transferred in a single FTP STORE command?

The CP 1543-1 supports files up to the size of the controller's load memory, which is bounded by the Memory Card size (up to 32 GB on the S7-1500). In practice, the XML payload for process data is well under 1 MB; the file system write, the FTP protocol overhead, and the network transfer all complete in under 5 s for a 1 MB file on a 100 Mbit/s link. For payloads larger than 10 MB, segment the file in the user program and send it in multiple chunks.

Is SFTP supported by the CP 1543-1 or CP 1243-1?

No. Both modules support plain FTP and FTPS (explicit and implicit) but not SFTP over SSH. If the customer's server is SFTP-only, the available options are: deploy an FTP-to-SFTP gateway (e.g. CrushFTP, ProFTPD with mod_sftp), switch the server to FTPS, or use OPC UA over a TLS-secured channel with a client-side file writer on the server PC.

Back to blog