Program Management and Execution from External Memory on Siemens SINUMERIK: EXTCALL (840D sl / 828D)

3 August 2026

Mentor CNC Editör Ekibi

What do you do when the program will not fit in the machine?

NC programs are stored in the control, loaded into the NCK working memory (RAM) when needed and executed from there. For small programs this is no trouble at all.

But in die and mould work the geometry program coming out of CAM can reach 100 MB. A file that size can neither be stored in nor executed from the NCK working memory. The answer is to keep the program in external memory and read it in as it runs.

The command that does this is EXTCALL. This page covers the command itself and the program management logic around it.

What this page covers.Separating the technology program from the geometry program, the external memory options, EXTCALL syntax and short path designations, the default path in SD42700 and the search order, the reload memory (FIFO) and its size limit, the jump-command trap in external programs, Reset and POWER ON behaviour, and Siemens’ warning about USB.

How a die program is structured: technology apart, geometry apart

Die programs are usually built in two parts:

  • The main program carries all the technology: tool calls, spindle speeds, zero offset, tolerance setting (CYCLE832), coolant.
  • The subprograms carry nothing but geometry: G90 followed by thousands of coordinate lines.

Tool changes define where the subprograms split. In other words, each tool gets its own geometry file.

; Main program — technology N1 G54 N2 T1 D1 N3 M3 S15000 N4 CYCLE832(0.05,112003) ; roughing: speed first N5 EXTCALL(“CAM_Rough”) ; geometry from external memory N6 T2 D1 N7 M3 S20000 N8 CYCLE832(0.005,112001) ; finishing: accuracy first N9 EXTCALL(“CAM_Finish”) N10 M30

The benefit is not only memory: you can change the technology without touching the geometry. If the speed is not right you change one line in the main program; you never open the three-million-line geometry file.

All the programs should sit in one folder.The source document’s rule is plain: the main program and the subprograms it calls should be kept in a single folder. Otherwise the target locations (the paths) have to be specified explicitly.

What can be used as external memory?

ControlAvailable external memory
840D slLocal drive · Network drive · USB drive
828DUser CF card · Network drive · USB drive

If USB is used, the interface is defined too: on 840D sl, only the USB interfaces on the operator panel front or the TCU; on 828D, only the USB interface on the PPU front.

Siemens’ own warning: do not execute an external subprogram from a USB flash drive.The manual carries this as a NOTICE. The reason: if communication to the USB flash drive is interrupted while the subprogram is running — contact problems, the drive dropping out, being knocked accidentally or withdrawn inadvertently — machining stops immediately and the tool and/or workpiece could be damaged. For production work, prefer the local drive, the CF card or a network drive.

EXTCALL syntax

EXTCALL(“<path/><program name>”)

What goes in the brackets is a constant or variable of type STRING.

  • Path may be absolute or relative, and is optional.
  • Program name is specified without the _N_ prefix.
  • The file extension (MPF, SPF) is optional and can be attached with _ or .. All three forms are valid: "SHAFT", "SHAFT_SPF", "SHAFT.SPF".

Short path designations

DesignationMeaningValid on
LOCAL_DRIVE:Local drive840D sl
CF_CARD:CF card840D sl (interchangeable with LOCAL_DRIVE) and 828D (user CF card)
USB:USB drive on the operator panel front840D sl and 828D

Example

N010 PROC MAIN N020 … N030 EXTCALL(“SP_1”) ; found via the default path in SD42700 N040 EXTCALL(“USB:WKS.DIR/WST1.WPD/SP_2”) ; full path given N050 … N060 M30
No parameters can be passed to an external program.The manual states it directly: when calling an external program, none of these parameters can be transferred to it. The parameter passing you use with PCALL on ordinary subprograms does not work here. If you need to carry a value across, use an R parameter or a GUD.

The default path: SD42700 and the search order

The path to the external program directory can be preset with a setting data:

SD42700 $SC_EXT_PROG_PATH = LOCAL_DRIVE:WKS.DIR/WST1.WPD

With that set, you write only the program name in the main program and the control assembles the full path itself.

This is a setting data, not machine data.Training material sometimes calls it “machine data SD 42700”. It is a setting data — the $SC_ prefix says so: Setting data, Channel-specific. It should not be confused with machine data.

Where does the control look if you give no path?

With a relative path or no path at all, the search runs like this:

  1. If a path is preset in SD42700, the search starts there. The absolute path is formed by linking: the default path in SD42700 + the separator / + the path and program name given in the EXTCALL command.
  2. If it is not found there, the directories of the user memory are searched.

The search ends the first time the subprogram is found. If it is not found at all, program execution is aborted at the EXTCALL line.

With an absolute path there is no search: if the subprogram exists at that path it runs, and if it does not, execution is aborted.

Two files with the same name?Because the search stops at the first match, a file on the SD42700 path takes precedence over one in user memory. That is the classic reason behind “the file I edited is not the one running” — an old copy comes first in the search order.

The reload memory (FIFO) — the limit most people miss

Executing an external subprogram requires a reload memory. The program is read into it in chunks, processed, and makes way for the next chunk.

  • Default size: 30 KB.
  • It can be changed only by the machine manufacturer, via MD18360 MM_EXT_PROG_BUFFER_SIZE.
  • External subprograms executed in parallel need a separate reload memory each.
The jump-command trap.If an external subprogram contains jump commands — GOTOF, GOTOB, CASE, FOR, LOOP, WHILE, REPEAT, IF, ELSE, ENDIF — then the jump destinations must lie within the reload memory. A loop that jumps outside that 30 KB window will not work in an external program. Die geometry is usually plain coordinate lines so this rarely bites, but the moment you try to call a subprogram containing loops with EXTCALL, this is the wall you hit first.
ShopMill / ShopTurn programs cannot be run externally.Because the contour descriptions are added at the end of the file, ShopMill and ShopTurn programs must be stored completely in the read-only memory.

What happens on Reset, end of program and POWER ON?

  • Reset and POWER ON interrupt external subprogram calls and delete the associated load memory.
  • However, a program selected for “Execution from external source” stays selected for it after a reset or end of program. The behaviour is no different from internally selected programs, as long as the external program memory is still available.

In practice: pressing Reset resets the read position of the external program. To get back to where you were you need a block search — and with EXTCALL programs that has its own twist: the real interruption point is not in the main program but inside the called subprogram.

Common mistakes

Running production die work from a USB stick

Siemens explicitly advises against it. If the connection drops, machining stops on the spot.

Scattering the main program and subprograms across folders

If they are not in the same folder the path must be written out; if it is not, execution is aborted at the EXTCALL line.

Not deleting the old copy

The search stops at the first match. An old file on the SD42700 path beats the up-to-date one in user memory.

Trying to pass parameters to an external subprogram

It is not possible. Use an R parameter or a GUD to carry values.

Calling a subprogram containing loops with EXTCALL

It will not work if the jump destinations fall outside the reload memory.

Trying to edit a CF card program from the panel on an 828D

Programs executed from external memory cannot be edited on the panel. If the program is larger than the NCK memory it has to be edited externally, on a PC for example.

Writing the _N_ prefix in the program name

In EXTCALL the program name is written without the _N_ prefix.

Frequently asked questions

What is the difference between EXTCALL and a normal subprogram call?

A normal subprogram sits in NCK memory and can take parameters. A program called with EXTCALL is in external memory, is read in chunks and cannot take parameters.

Do I have to write the extension?

No, it is optional. "SHAFT", "SHAFT_SPF" and "SHAFT.SPF" are all valid.

Can I enlarge the reload memory?

Not yourself. MD18360 MM_EXT_PROG_BUFFER_SIZE is changed only by the machine manufacturer.

What happens if I pull the USB drive while the program is running?

Machining stops immediately and the tool or workpiece may be damaged. That is exactly why Siemens recommends not using a USB flash drive to execute an external subprogram.

How do I get back to where I was in an external program?

With a block search. But note: the real interruption point is not in the main program, it is inside the called subprogram; the search pointer asks for both levels. The practical route is to select the interruption point as the target.

Does this apply to an 828D as well?

The EXTCALL syntax, SD42700 and the no-parameter rule are the same on both. The difference is in the external memory options: 840D sl uses a local drive, 828D uses the user CF card, and the short path designations follow accordingly.

Mentor CNC note: Running a program from external memory means data is being read continuously while machining. Losing that connection stops machining instantly and can damage the tool and the part. For critical work prefer the local drive or the CF card, and do not use a USB flash drive for production. Changing setting data and machine data requires the right access level, and a backup should be taken first. This page is for training and does not replace the machine builder’s manual.

Sources

  • Siemens AG — SINUMERIK 840D sl / 828D Job Planning, Programming Manual, 01/2015, document no. 6FC5398-2BP40-5BA2: Section 2.24.3.10 Execute external subprogram — 840D sl (pp.190–192) and 2.24.3.11 — 828D (p.193): syntax, short path designations, SD42700 $SC_EXT_PROG_PATH, search order, reload memory and MD18360, the jump-command restriction, the ShopMill/ShopTurn note, Reset/POWER ON behaviour and the USB notice
  • Siemens AG — SINUMERIK Advanced CNC Operation and Programming, 05/2010: Section 2.8 Program data transfer and program management (the 100 MB geometry program problem, external memory hardware options), 2.10 Program structure for die making (technology/geometry split, the main program example with CYCLE832 and EXTCALL, the rule that all programs should be in one folder)