SINUMERIK 840D USB Subprogram Import: ARC Archive Workflow

David Krause15 min read
Other TopicSiemensTutorial / 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

On legacy SINUMERIK 840D Powerline controls equipped with RS-232 serial import, an operator could feed the controller a single concatenated NC program containing a main program block plus every subprogram, separated by Sinumerik 2-line program headers. The 840D Powerline HMI recognised the header lines (%_N_NAME_SPF followed by ;$PATH=/_N_WKS_DIR/_N_xxxxx_WPD) and wrote each subprogram block to its own file in the appropriate workpiece directory automatically. The same workflow on a current SINUMERIK 840D sl (Solution Line) with a USB stick only exposes Copy and Paste in the System data area. There is no auto-split. As a result, very long toolpath programs that exceed the buffer cannot be transferred as a single archive, and any change to a subprogram requires manual editing on the controller.

The root cause is a deliberate change in the HMI data-import model: RS-232 input ran a streamed Read In parser that interpreted header tokens in real time, while the 840D sl USB path is a flat file copy that bypasses the parser. The fix is to wrap the concatenated program in a Sinumerik .ARC archive and use the Read In function, which restores the parser behaviour for the archive as a whole.

Note: The .ARC method described here is the same archive format produced by the HMI's Read Out function. It is the canonical mechanism for moving multi-file program sets between controls, between DNC servers and the control, and between machine commissioning engineers and shop floor.

2. SINUMERIK 840D Hardware Generations and Import Interfaces

Sinumerik 840D has been delivered in three major hardware generations. The import method you use must match the active HMI software on the NCU/PCU.

Generation Typical HMI Import Interfaces Archive Behaviour
840D Powerline HMI Advanced (Win95/2000) RS-232 (X2), CF card, Ethernet (option) RS-232 stream parser auto-splits on 2-line headers
840D sl (early) HMI Advanced on PCU 50.3 USB, CF card, Ethernet (X130) Read In parses .ARC archive only
840D sl (current) SINUMERIK Operate on PCU 50.5 / NCU 730/750 USB, CFast, Ethernet, network shares Read In parses .ARC archive only

The firmware version installed on the NCU and the HMI software version on the PCU together determine which menus are visible. SINUMERIK Operate V4.7 and later on 840D sl use the unified System → Read In/Out dialog. HMI Advanced (V7.x and earlier on PCU 50.3) uses a separate Services menu. Both expose the .ARC path; the difference is cosmetic.

Refer to the Siemens Industry Online Support portal for the SINUMERIK 840D sl documentation set, specifically the Programming Manual, Work Preparation Programming Manual, and Operator's Guide (HMI Operate / HMI Advanced) for the active software version on your machine.

3. NC Program File System Architecture

Every file on a SINUMERIK NC resides in a fixed directory under the active global part-program memory (NC active memory for NCK-resident files, local drive for PCU-resident files). The base directories you will use for toolpath subprograms are:

Directory Token Default File Type Purpose
/_N_MPF_DIR/ .MPF Main part programs (workpiece-level)
/_N_SPF_DIR/ .SPF Global subprograms (machine-wide)
/_N_WKS_DIR/ .WPD Workpiece directories containing one or more .MPF/.SPF
/_N_CMA_DIR/ .CMA Manufacturer cycles (Siemens-supplied)
/_N_CUS_DIR/ .CUS User cycles (machine builder)
/_N_DEF_DIR/ .DEF Global variable / macro definitions

Each file begins with a mandatory two-line header. The first line identifies the file, the second line assigns it to a workpiece directory (or leaves it in the system default if omitted).

3.1 Header Syntax

;%_N_SHAFT_MPF
;$PATH=/_N_WKS_DIR/_N_SHAFT_WPD

Breaking this down line by line:

  • ; — Required leading semicolon (comment marker).
  • %_N_ — Fixed prefix for Sinumerik program identification.
  • SHAFT — Program name (1 to 24 characters, must start with a letter, no spaces, no special characters beyond underscore).
  • _MPF — File-type suffix. _MPF for main programs, _SPF for subprograms, _CUS for user cycles, _DEF for definitions, _INI for initialisation files.
  • ;$PATH=/_N_WKS_DIR/_N_SHAFT_WPD — Second header line; assigns this file to the workpiece directory SHAFT.WPD. If the WPD does not exist, it is created during Read In.

Subprogram headers are identical except for the suffix:

;%_N_DRILL_SPF
;$PATH=/_N_WKS_DIR/_N_SHAFT_WPD

3.2 Program Terminators

  • M30 — End of main program with reset. Optional second M30 marks physical end of file on some controls.
  • M17 — End of subroutine, returns to caller.
  • RET — Equivalent to M17 in newer SINUMERIK Operate syntax.

4. Why the Legacy RS-232 Path Auto-Split Programs

The 840D Powerline RS-232 input was implemented as a streaming protocol. As bytes arrived from the serial port, the HMI's input handler tokenised the data, and whenever it saw a header line of the form %;%_N_NAME_TYP it would close the previously open file, open a new file at the path declared by the next ;$PATH= line, and begin writing. The end of the data stream produced a final close. This is why a single concatenated input file with all subprograms at the bottom of the main program, each preceded by its own 2-line header, ended up as a clean set of separate files in the HMI program manager.

There was no need for an .ARC wrapper. The format was line-oriented ASCII with the Sinumerik header syntax acting as the delimiter. Many CAM post processors written for the Powerline era exploited this behaviour by emitting a single combined output stream.

5. Why USB Copy/Paste on 840D sl Does Not Auto-Split

On 840D sl with SINUMERIK Operate (and on HMI Advanced on PCU 50.3), the USB stick is mounted as a passive mass-storage device. The HMI exposes two distinct operations:

  1. Copy / Paste — A literal byte-for-byte file copy. The control sees one file regardless of how many program blocks it contains. If you copy a concatenated SHAFT.MPF containing four embedded subprograms, the controller stores one file with the entire concatenation. None of the headers are honoured; the file is treated as a single main program and will fail to compile when the CALL DRILL instruction cannot resolve DRILL.SPF.
  2. Read In (Read in Archive) — An archive-restore operation that opens the file, detects the archive signature, and reconstructs the original file tree by parsing the embedded 2-line headers. This is the operation the RS-232 path used to perform implicitly.

The behaviour gap is therefore not a missing feature, it is a different transport. The .ARC archive is the explicit transport that carries the splitting metadata.

6. Solution: Use the .ARC Archive Format with Read In

An .ARC file is the binary or ASCII archive format produced natively by the HMI's Read Out function. It is functionally a sequence of header-prefixed program blocks, optionally compressed, that the Read In function parses and decomposes into the file tree the archive represents. The same format can be constructed off-line by a CAM post processor, an FTP/SFTP server, or a USB stick containing a previously read-out archive.

6.1 Creating an .ARC Archive Directly from a Post Processor

The minimum structure of an .ARC archive is the concatenation of files in the order they should be restored, each preceded by its 2-line header and followed by the next file's header. The order matters: main program first, then the subprograms it calls. A minimal archive containing a main program and two subprograms looks like the following.

;;HEADER;;
;;HMI_VERSION: 04.07.04.00;;
;;FILE_LIST: BEGIN
;;FILE: _N_MPF_DIR/_N_SHAFT_MPF;;
;;$PATH=/_N_WKS_DIR/_N_SHAFT_WPD
;
; Program: SHAFT.MPF
;
N10 G54 G17 G90 G94
N20 T1 D1 M6
N30 S3000 M3
N40 G0 X0 Y0 Z100
N50 CALL "DRILL"
N60 CALL "POCKET"
N70 G0 Z100 M5
N80 M30

;;FILE: _N_SPF_DIR/_N_DRILL_SPF;;
;;$PATH=/_N_WKS_DIR/_N_SHAFT_WPD
;
; Subprogram: DRILL.SPF
;
N10 G0 X20 Y20
N20 Z2
N30 G1 Z-5 F100
N40 G0 Z2
N50 M17

;;FILE: _N_SPF_DIR/_N_POCKET_SPF;;
;;$PATH=/_N_WKS_DIR/_N_SHAFT_WPD
;
; Subprogram: POCKET.SPF
;
N10 G0 X40 Y40
N20 Z2
N30 G1 Z-3 F80
N40 G1 X60
N50 G1 Y60
N60 G1 X40
N70 G1 Y40
N80 G0 Z2
N90 M17

;;FILE_LIST: END;;
;;END_HEADER;;
Critical: The ;;$PATH= line in the ;;FILE: section of the .ARC envelope is what the Read In parser uses to write the file to the correct workpiece directory. The ;;FILE: path and the path inside the file body must agree. A mismatch causes Read In to deposit the file in the wrong location and the main program's CALL will fail at run time with Subprogram not found.

6.2 HMI Navigation on SINUMERIK Operate

  1. Insert the USB stick (or CFast card) containing the .ARC file into the front panel of the TCU/PCU.
  2. From the main menu, select System → Read In/Out (or System → Services → Read In/Out on HMI Advanced).
  3. Select the source: USB (front panel) or Network (X130 / CFast).
  4. Navigate the directory tree to the .ARC file. The file extension must be .ARC; if it is not, the menu will only offer Copy/Paste.
  5. Select the .ARC file and press Read In.
  6. The control opens a confirmation dialog listing the files contained in the archive. Tick All and confirm with OK.
  7. Wait for the progress bar to complete. A typical 5 MB archive with twenty subprograms resolves in under 30 seconds.

6.3 HMI Navigation on HMI Advanced (PCU 50.3, Older 840D sl)

  1. Insert USB stick.
  2. Press the Services hard key (or Menu Select → Services).
  3. Select Data In/Out → Archive Read In.
  4. Navigate to the .ARC file on the USB stick.
  5. Press Start. The archive contents are listed; confirm and continue.

6.4 Why the Extension Must Be .ARC

The HMI uses the file extension as a routing hint. .MPF and .SPF files route to Copy/Paste. .ARC routes to Read In (archive parser). .WPD on some 840D sl builds routes to directory transfer (see Section 8). Renaming your output to .ARC is therefore not cosmetic, it changes which menu branch handles the file.

7. Post Processor Configuration for .ARC Emission

The CAM post processor must be configured to emit the Sinumerik 2-line header for every output file, then concatenate all files in the correct order with the archive envelope. If your post processor supports Sinumerik natively (Mastercam Sinumerik post, Fusion 360 Sinumerik post, CATIA NC Sinumerik post, etc.), look for the following settings:

Parameter (typical name) Value Effect
Output filename extension .ARC Routes to Read In on HMI
Subprogram output mode Inline (concatenated) or Separate Inline avoids extra transfers; Separate requires manual WPD
Header line 1 format %;%_N_{NAME}_{TYP} Identifier line; required for parser
Header line 2 format ;$PATH=/_N_WKS_DIR/_N_{JOB}_WPD WPD assignment; required for split
Main program terminator M30 End of main program
Subprogram terminator M17 or RET End of subprogram

7.1 Sample Post Processor Snippet (Generic Sinumerik Post, Pseudocode)

; ---- Begin archive envelope ----
WRITE(";;HEADER;;")
WRITE(";;HMI_VERSION: 04.07.04.00;;")
WRITE(";;FILE_LIST: BEGIN")

; ---- Main program ----
WRITE(";;FILE: _N_MPF_DIR/_N_$JOB_NAME_MPF;;")
WRITE(";$PATH=/_N_WKS_DIR/_N_$JOB_NAME_WPD")
WRITE(";%_N_$JOB_NAME_MPF")
WRITE(";$PATH=/_N_WKS_DIR/_N_$JOB_NAME_WPD")
EMIT_MAIN_PROGRAM_BODY()
WRITE("M30")

; ---- Subprograms ----
FOREACH SUB IN SUBPROGRAMS:
    WRITE(";;FILE: _N_SPF_DIR/_N_$SUB.NAME_SPF;;")
    WRITE(";$PATH=/_N_WKS_DIR/_N_$JOB_NAME_WPD")
    WRITE(";%_N_$SUB.NAME_SPF")
    WRITE(";$PATH=/_N_WKS_DIR/_N_$JOB_NAME_WPD")
    EMIT_SUBPROGRAM_BODY(SUB)
    WRITE("M17")
END FOREACH

; ---- Close envelope ----
WRITE(";;FILE_LIST: END;;")
WRITE(";;END_HEADER;;")
Verification step after post change: Open the .ARC file in a text editor and confirm the order is header → main → sub1 → sub2 → ... → end header, with no blank lines between the ;;FILE_LIST: END marker and the closing ;;END_HEADER. Some legacy posts omit the inner ;;FILE: wrapper and rely on the HMI to read a flat concatenated stream; this works on Powerline but is fragile on 840D sl. Use the explicit envelope shown above.

8. Alternative: Transfer a Pre-Built WPD Directory

If your post processor is already configured to emit one file per program and place them in a .WPD directory, the 840D sl HMI can import the entire directory tree in one operation. The HMI Read In function accepts a directory just as it accepts an archive; it walks the tree and writes each file according to its internal $PATH or to the directory itself if the file's $PATH matches the WPD.

8.1 USB Directory Layout for a SHAFT Job

USB:/SHAFT/
        SHAFT.MPF      (first line: ;%_N_SHAFT_MPF / second line: ;$PATH=/_N_WKS_DIR/_N_SHAFT_WPD)
        DRILL.SPF      (first line: ;%_N_DRILL_SPF / second line: ;$PATH=/_N_WKS_DIR/_N_SHAFT_WPD)
        POCKET.SPF     (first line: ;%_N_POCKET_SPF / second line: ;$PATH=/_N_WKS_DIR/_N_SHAFT_WPD)

8.2 HMI Procedure

  1. Insert the USB stick.
  2. Navigate to System → Read In/Out → USB.
  3. Select the SHAFT/ folder (highlight it, not the files inside).
  4. Press Read In. The control creates /_N_WKS_DIR/_N_SHAFT_WPD/ and writes each file into it according to its header.

This method is most useful when the CAM system writes each subprogram as a separate file and the operator does not want to maintain a custom .ARC builder. The trade-off is that the operator must select a folder, not a file; if a file is selected individually, only that one file is transferred and the WPD is not necessarily created.

9. Alternative: Network Share Import over Ethernet

For production environments where USB is impractical (or where DNC machines outnumber USB sticks), configure the 840D sl's X130 Ethernet port to mount an SMB or NFS share. SINUMERIK Operate V4.5 and later supports network shares natively in the Read In/Out source list. The transfer method is identical to the USB case: point at the .ARC file on the share, press Read In.

Setting Typical Value
NCU Ethernet port X130 (front)
Default IP 192.168.214.1 (service) or DHCP from shop network
Share protocol SMB / CIFS (Windows shares) or NFS (Linux DNC)
Read In source Network in System → Read In/Out

This is the cleanest long-term solution because it eliminates the operator copying individual files, which is the exact failure mode the original operator was concerned about. The DNC system writes the .ARC file; the operator presses one button to read it in.

10. Verification Procedure

After Read In completes, perform the following checks before running the part:

  1. Open Program Manager in the WPD area: Workpieces → SHAFT. Confirm SHAFT.MPF, DRILL.SPF, and POCKET.SPF are all present.
  2. Open SHAFT.MPF. The display should show the main program block only — not the concatenated subprograms. If you see all subprograms concatenated in one file, Read In treated the input as a single file (the .ARC envelope was malformed; see Section 13).
  3. Open each .SPF and confirm the content matches the CAM output.
  4. Press NC Start with the tool clear of the part. Observe whether the spindle ramps to programmed RPM and the CALL instructions resolve. If the control raises alarm 14011 "Channel %1 block %2 subroutine %3 not available" or alarm 12080 "Channel %1 subroutine %2 not found", the subprogram file is missing or in the wrong directory.
  5. Run a dry-run (dry-run / rapid traverse / no coolant) to confirm path is correct before committing to a cut.

11. Common Errors and Resolutions

Symptom Likely Cause Resolution
USB menu only shows Copy/Paste, no Read In option File extension is not .ARC, or the USB stick is not recognised as bootable mass storage Rename the file to SHAFT.ARC. Reinsert the USB stick. If still no Read In, try a different FAT32-formatted stick.
Read In completes but the main program contains all subprograms concatenated The .ARC envelope markers (;;FILE_LIST: BEGIN etc.) are missing or malformed; the parser fell back to a flat file write Re-emit the .ARC from the post processor with explicit envelope markers. Do not rely on raw header lines alone on 840D sl.
Alarm 14011 "subroutine not available" at runtime Subprogram file is in the wrong directory (e.g., /_N_SPF_DIR/ instead of /_N_WKS_DIR/_N_SHAFT_WPD/) Verify each ;;$PATH= line in the archive. The path after the WPD assignment must match the WPD where the main program was deposited.
Alarm 12080 "subroutine not found" at runtime CALL statement uses the wrong name; case sensitivity on SINUMERIK Operate is strict Match the program name in the %_N_NAME_SPF header to the string in CALL "NAME" exactly, including case.
Read In fails with "archive corrupted" USB stick was ejected during write, or the .ARC file is not a plain text concatenated file Regenerate the .ARC on the CAM workstation. Verify the file is a plain ASCII concatenation; do not zip or tar it before transfer.
Operator accidentally copies a single subprogram file Workflow relies on per-file copy/paste from USB; subprogram ends up in a different WPD Switch to .ARC or WPD-folder transfer as described in Sections 6 and 8. Block USB Copy/Paste access if the control's access level permits.

12. Recommended Workflow Summary

For shop floors with multiple 840D controls and a DNC server, the recommended workflow that mimics the legacy RS-232 single-file behaviour is:

  1. Configure the CAM post processor to emit a Sinumerik .ARC archive with the proper envelope and 2-line headers for every program and subprogram.
  2. Have the DNC server drop the .ARC into a known share (SMB or NFS) or onto a USB stick used for that job.
  3. On the operator panel, navigate to System → Read In/Out → USB or Network, select the .ARC, and press Read In.
  4. Verify the program set in the WPD; run a dry cycle; release for production.

For shops that cannot modify the post processor, the WPD-folder method (Section 8) is the next best option: emit a directory named after the job, place all program files inside, and transfer the directory as a single Read In operation. This avoids the per-file copy/paste risk that the original operator identified as a safety concern.

Both methods reproduce the original Powerline RS-232 single-file behaviour: one transfer operation refreshes the main program and all its subprograms, and the operator cannot accidentally desynchronise the subprogram set.

Why does my 840D sl USB import only offer Copy/Paste instead of splitting programs?

The USB port on 840D sl is mounted as passive mass storage and the HMI exposes it through a file copy dialog. Auto-splitting only happens when the HMI's Read In (archive parser) function processes the file, which requires the .ARC extension. Rename your concatenated program to .ARC and the Read In option will appear.

Can I still use RS-232 import on a 840D sl to get the legacy auto-split behaviour?

No. The 840D sl PCU 50.3 / PCU 50.5 does not include a usable RS-232 streaming import path with header parsing. Use the .ARC archive Read In path, the WPD folder transfer path, or the Ethernet network share path instead. All three are supported in SINUMERIK Operate V4.5 and later.

What is the difference between an .ARC file and a .WPD folder?

An .ARC file is a single concatenated archive (with envelope markers) that the Read In parser decomposes into multiple files. A .WPD folder is a directory containing separate program files; Read In copies the whole directory and writes the files according to each file's $PATH header. Both produce the same end result, but .ARC keeps the program set as one file during transfer (closest to the legacy behaviour) while .WPD is easier to construct manually.

How do I configure my CAM post to emit a Sinumerik .ARC archive?

Enable Sinumerik output mode in the post, set the output file extension to .ARC, and configure the post to emit the two-line header %;%_N_NAME_TYP and ;$PATH=/_N_WKS_DIR/_N_JOB_WPD for every program and subprogram. Wrap the entire output in the envelope markers ;;HEADER;;, ;;FILE_LIST: BEGIN, ;;FILE_LIST: END;;, ;;END_HEADER;; with a ;;FILE: line preceding each program body. Order: main program first, then subprograms in call order.

Will this method work on 840D sl with HMI Advanced and SINUMERIK Operate?

Yes. Both HMI variants expose the Read In function on the same archive format. On HMI Advanced (PCU 50.3), the path is Services → Data In/Out → Archive Read In. On SINUMERIK Operate (PCU 50.5 or NCU 730/750 with TCU), the path is System → Read In/Out. The .ARC envelope is identical.

Back to blog