← Zinan Yang · lab

Unofficial notes · SIMATIC S7-1500T · Technology version V10.0 · STEP 7 V21

The Motion Interpreter

With the SIMATIC Motion Interpreter of the S7-1500T CPU you create motion jobs for individual axes and kinematics with up to 6 interpolating axes. The Interpreter executes a series of serial instructions — that sequence is called an Interpreter program.

In contrast to cyclic programming in STEP 7, you do not program step-enabling conditions or ‘job done’ queries — the Interpreter sequences the work itself.

Personal study notes — not a Siemens publication. The manuals on Siemens Industry Online Support are authoritative.

pick & place cycle · TCP trail
6interpolating kinematics axes
30kinematics jobs in the job sequence (fixed)
10–100jobs prepared (MaxNumberOfCommands, configurable, default cap 100)
20mapped technology objects
100entries in the Interpreter mapping table
300 / 100 / 100clipboard BOOL / DINT / LREAL tags

Architecture

Three technology objects

The Interpreter is implemented as a technology object and is controlled from the user program. Click any block below to read what it does.

TO_InterpreterProgram holds the MCL program TO_InterpreterMapping declares what MCL may reach User program cyclic OB MC_LoadProgram MC_RunProgram MC_StopProgram Status evaluation TO_Interpreter Program preparation MC_LookAhead OB Sequential program execution MC_Interpolator OB TO_Kinematics up to 6 interpolating axes motion jobs executed Mapped axes Speed · Positioning · Synchronous MC_Interpolator (cyclic)

The key concept

Two clocks: preparation and execution

The single thing that separates MCL from cyclic SCL. The Interpreter runs a look-ahead: jobs are prepared in the MC_LookAhead OB, acyclically and in advance, and then processed in the MC_Interpolator OB. A job executes with the parameters it had AT PREPARATION TIME, not at execution time.

insert preHalt() at job 8
insert waitEvent() at job 8
Preparation
Execution
kinematics job non-kinematics job (writeVar / waitEvent, etc.)
LevelOfPreparedCommands0%
Prepared / executed0 / 0
Kinematics prepared (of 30)0 / 30
Elapsed0.0 s

Worked example from the manual: preparation of a motion sequence takes 1.5 s. Wait time 0.0 starts after 1.5 s; wait time 1.0 starts after 1.0 s; wait time 2.0 starts after 1.5 s. Current setting starts after 1.5 s.

When does my line actually run?

x := 5; assigns during PREPARATION · writeVar(x, 5); writes during EXECUTION. Reading a tag returns its value at preparation time.

Executed WITH preparation

setAxisDynsetAxisDynMaxsetDynsetDynMaxsetPlanesetCircDirssetDynAdaptsetOriDynsetOriDynMaxsetPtpDynsetCssetBlendDistsetBlendFactorsetBlendsetTranssetLcsetTurnJointsetOvrpreHalt

Executed AT execution

writeVarwaitEventwaitTimesetControlledByInterpreterpowerOnpowerOffhomemoveposRelposAbstorqueLimitOntorqueLimitOfflinAbslinRelcircAbscircRelptpAbsptpRelptpAxAbsptpAxRelptpJtAbsptpJtReldefOcsdefToolsetTooltrackIndefWsZonedefKinZonesetWsZoneActivesetWsZoneInactivesetKinZoneActivesetKinZoneInactive
$IPR.Clipboard.CbDint[1] := 5;              // set to 5 during preparation
$IPR.Clipboard.CbDint[2] := 5;              // set to 5 during preparation
$IPR.Clipboard.CbDint[100] := 3;            // set to 3 during preparation
writeVar( $IPR.Clipboard.CbDint[100], 10 ); // set from 3 to 10 during execution
$IPR.Clipboard.CbDint[1] := $IPR.Clipboard.CbDint[100];  // set to 3 during preparation
writeVar( $IPR.Clipboard.CbDint[1], $IPR.Clipboard.CbDint[100] ); // writes 3 — the
                                            // preparation-time value
preHalt( );                                 // interrupt preparation here
writeVar( $IPR.Clipboard.CbDint[2], $IPR.Clipboard.CbDint[100] ); // now writes 10

Centrepiece

MCL path simulator

Step or scrub through three real MCL programs and watch the TCP path build up, coloured by velocity. The source line executing right now is highlighted, TIA-monitoring style.

Z
0
gripper idle
0.0 / 0.0s

program 100% × TO 50% = 50% velocity · 50% accel

In MCL, blending is defined in the PRECEDING job — the opposite of the Motion Control instructions.

Reference

Instruction explorer

Every MCL instruction, grouped by family. Search, filter, or click a tile for its description and when it runs.

Bit-string instructions, mathematical functions and conversions are also supported. Max 10 programmable synchronous actions.

Workflow

How to use it

A real, ordered procedure — from mechanics to the first monitored run.

Add the positioning-axis TOs, activate simulation on each if you are running without hardware, assign the drive interface, then add the TO_Kinematics and set its type (the Getting Started basic example uses “Cartesian portal 3D” with three positioning axes) and its interconnections and geometry.

Tip from the manual: adding a PROFIdrive device such as a SINAMICS S210 and configuring IRT improves behaviour under PLCSIM Advanced.

Basic parameters > Connected kinematics — or pick the kinematics in the “Add technology object” dialog, or drag the Interpreter onto the kinematics in the project tree. One Interpreter binds to exactly one kinematics TO.

Interpreter job sequence — max jobs prepared, <TO>.Parameter.MaxNumberOfCommands, 10–100.

Program preparation > Maximum wait time — <TO>.Parameter.StartTimeout, 0.0–2.0 s.

Program preparation > Start value program override — <TO>.Parameter.ProgramOverride, 1–100 %.

Clipboard — start values for CbBool[1..300], CbDint[1..100], CbLreal[1..100].

Mapping > Mapping of technology objects: name in interpreter program + the TO. Mapping > Mapping of variables: name + data block variable (+ Read only where required).

In the Getting Started project this is where the gripper signals live — a “BasicMappingDB” DB whose BOOLs are mapped one-for-one.

Open its programming editor, pick the Interpreter and the Mapping in the two drop-downs at the top, and write the program. The editor has configuration dialogs for instruction parameters, bookmarks, and a 3D visualisation of the kinematics.

The program is interpreted at runtime — it is not compiled in TIA Portal.

Add MC_LoadProgram, MC_RunProgram and MC_StopProgram to the main OB from the instruction browser and wire their instance interfaces. Rising edge on Execute starts each job.

Compile and download to the CPU or a PLCSIM Advanced instance (enable simulation support in the project settings). Drive Execute from a watch table.

Switch on “Monitoring on/off” and “Monitor program execution” in the programming editor — the active line is highlighted in orange; for a loaded but not yet started program that highlight sits on PROGRAM main. Record the TCP with the Kinematics trace under the kinematics TO.

MC_LoadProgram

Interpreter (TO_Interpreter) · Execute (BOOL, rising edge)
Mode (DINT, default 1): 1 = load the Interpreter program into the Interpreter TO (the program is then disabled for changes) · 0 = unload
Program (STRING): name of the Interpreter program TO, e.g. 'InterpreterProgram_1' (Mode 1 only)
ProgramSource (DINT, default 1): 1 = Interpreter program technology object · 2 = reserved
Mapping (STRING): name of the Interpreter mapping TO, e.g. 'InterpreterMapping_1' (optional)
MappingSource (DINT, default 1): 1 = Interpreter mapping technology object · 2,3 = reserved
Out: Done · Busy · CommandAborted · Error · ErrorID (WORD)
Requirement: no Motion Control job active at the Interpreter (<TO>.StatusWord.X0 = FALSE).

MC_RunProgram

Interpreter · Execute. Out: Done · Busy · Active · CommandAborted · Error · ErrorID.
You may issue Run while loading is still in progress (X9 Loading) — execution starts as soon as X10 Loaded is set.
Done = TRUE means the program ran AND has been prepared for another run.

MC_StopProgram

Interpreter · Execute · Mode (DINT, default 0):
0 = stop single axis/kinematics with maximum dynamics
1 = stop with the dynamics of the motion job being interrupted
2 = stop after the current motion job or the current motion sequence
Out: Done · Busy · CommandAborted · Error · ErrorID.
MC_StopProgram aborts an active MC_LoadProgram or MC_RunProgram job.

Diagnostics

StatusWord decoder

Click a bit to see what it means, or replay the handshake below and watch the bits light as it advances.

StatusWord

Select a bit to see its meaning.

ErrorWord

WarningWord

<TO>.ErrorDetail.LineNumber — line number of the error
<TO>.ErrorDetail.ErrorInfo — further error information
<TO>.ProgramName — name of the loaded Interpreter program
<TO>.MappingName — name of the loaded Interpreter mapping
<TO>.StatusInterpreter.ProgramMode — current program mode

Handshake

Branch: MC_StopProgram can move the sequence to X7 Stopping and then X8 Interrupted at any point after loading.

Field notes

Engineer’s notes

The things that bite.

Assignment vs writeVar.

x := value takes effect during PREPARATION; writeVar(x, value) takes effect during EXECUTION. Reading a tag in the Interpreter program returns the value valid at the time of PREPARATION.

Blending is declared in the preceding job.

Unlike the Motion Control instructions, an MCL motion job carries the blending for the transition INTO the next job.

Program override multiplies.

It works in addition to the technology objects’ own overrides: program override 50 % with a kinematics velocity override of 50 % gives 25 % resulting velocity override, and 50 % for acceleration and deceleration. Changes do not affect jobs already prepared. Range 1–100 %.

The 30-kinematics-job ceiling is fixed.

The job sequence holds at most 30 kinematics motion jobs whatever <TO_Kinematics>.MotionQueue.MaxNumberOfCommands says.

Unload before you load.

To load a different or modified program, unload the current one first (MC_LoadProgram Mode 0). After CPU STOP or POWER OFF you must reload.

move() never finishes by itself.

For motion jobs that do not end automatically, ControlledByInterpreter clears as soon as the TO reaches the specified state — so MC_StopProgram will not cancel them unless you used setControlledByInterpreter().

Debug mode changes the rules. warning

In “Debug” program mode, MC_StopProgram and MC_Reset with Restart = TRUE are NOT executed for the Interpreter TO, the program runs with a delay and works with preparation-time values, and the dynamics and path can differ from “Automatic” mode. The user program keeps running in parallel and can move other axes. Debug mode exists as of technology version V9.0; V8.0 had “Automatic” only.

Read-only mappings must be declared.

If the mapped DB variable has the “Read only” property, the Read only check box must be set for that entry in the mapping.

User-defined data types of identical structure are not supported.

Only the listed TO_Struct_Ipr_* / TO_Struct_Kinematics_* types map in the Interpreter mapping.

It needs a licence.

A runtime licence is required per technology CPU: SIMATIC Motion Interpreter basic, 6ES7823-0SJ00-1AA0. You can test the functions with SIMATIC S7-PLCSIM or S7-PLCSIM Advanced.