Skip to content

PLCopen Motion

Commercial

Included in the public demo Compare editions

Use MC function blocks to command simulated single axes, straight Cartesian paths and robots. MotionGroup and its child MotionAxis components configure the PLC’s motion task. The task writes position signals; drive behaviours such as Drive_FollowPosition consume those signals. It never directly moves a Drive.

The implemented subset follows PLCopen Motion Control Part 1 v2.0 and Part 4, with the limits described below. A group of kind Robot couples the motion task to a RobotIK and commands its joints from the TCP pose (see Robots).

From MC function block to moving drive An MC function block in the PLC program commands the motion task of a MotionGroup through its handle variable. The motion task calculates an S-curve profile from velocity, acceleration, deceleration and jerk and writes one position set-point signal in millimetres per MotionAxis X, Y and Z. A drive behaviour such as Drive_FollowPosition reads the set-point and moves the drive. An optional feedback signal per axis returns the actual position to readers such as MC_GroupReadActualPosition. From MC function block to moving drive PLC program MC_GroupEnable MC_MoveLinearAbsolute handle variable motion Motion task MotionGroup Program + Variable S-curve profile from V · A · D · Jerk Axis X · Setpoint mm Axis Y · Setpoint mm Axis Z · Setpoint mm Drive_FollowPosition reads the set-point Drive moves the model Feedback signal per axis (optional, mm) → MC_GroupReadActualPosition without feedback, readers use the simulated set-position
The PLC never moves a drive directly: the motion task writes position set-point signals, and the drive's own behaviour follows them. Live or forced set-points are never overwritten.
MotionGroup propertyType / unitDefault
Kindenum Cartesian / RobotCartesian
KinematicsComponentReference to a RobotIK (Robot only)empty
JointVelocitynumber, deg/s (Robot only)120
JointAccelerationnumber, deg/s² (Robot only)600
JointJerknumber, deg/s³ (Robot only)6000
IgnoreJointDynamicsOnLinboolean (Robot only)false
AngularVelocitynumber, deg/s (Robot only)180
WorldFrameComponentReference to a node (Robot only, in development)empty
PoseConventionenum YUpEulerXYZ / ZUpEulerZYX (Robot only, in development)YUpEulerXYZ
ProgramComponentReference to owning PLCProgramunbound; required
Variablestring, program handle variable nameempty; required
Velocitynumber, mm/s500
Accelerationnumber, mm/s²5000
Decelerationnumber, mm/s²5000
Jerknumber, mm/s³100000

Profile defaults must be finite and strictly positive. Add MotionAxis components to child nodes; nested groups own their own descendants.

MotionAxis propertyType / unitDefault
Namestring; unique X, Y or Z (Cartesian), J1..Jn (Robot)empty; required
SetpointPLCOutputFloat signal slot, in the axis unitunbound; required
FeedbackPLCInputFloat signal slot, in the axis unitunbound; optional
Min / Maxnumber, logical mm-1000000 / 1000000
Offsetnumber, mm0
Signenum 1 / -11
Variablestring, optional AXIS_REF handle of this axisempty
Unitenum mm / degmm

Min and Max must be finite with Min < Max. Cartesian axes use Unit = mm, robot axes Unit = deg; a wrong unit is reported and blocks the deploy. For a Robot group Min, Max and Offset are hidden and not used: the drive limits of the RobotIK apply. The signal value is Offset + Sign × logical position; feedback uses the inverse. Without Feedback, readers use the simulated set-position. A configured invalid feedback produces an error.

The inspector uses the standard reference picker, signal slot rows, selects and number/string editors. Runtime position and command state are read-only. Redeploy after changing motion configuration. The newer fields (Kind, Kinematics, the joint dynamics, MotionAxis Variable and Unit) are taken over at deploy: a change shows “Takes effect on the next PLC deploy” and never affects a move that is running.

A MotionGroup selected in the editor: the inspector shows Kind, Variable, the profile defaults with their units and the owning Program, and the hierarchy lists its three MotionAxis child nodes

  1. Add a PLCProgram and a MotionGroup.
  2. Add one to three child MotionAxis nodes, configure coordinate names and bounds, and bind each Setpoint to a PLCOutputFloat position signal.
  3. Configure each drive’s position-following behaviour to consume the matching signal.
  4. Enter the program below. Set MotionGroup.Program to that PLCProgram and Variable to motion.
  5. Deploy, then Run in continuous simulation. Raise Start after enablement.
PROGRAM Positioning
VAR
motion : AXES_GROUP_REF;
enable : MC_GroupEnable;
move : MC_MoveLinearAbsolute;
END_VAR
VAR_EXTERNAL Start : BOOL; END_VAR
enable(AxesGroup := motion, Execute := TRUE);
move(AxesGroup := motion, Execute := enable.Done AND Start,
PositionX := 100.0, PositionY := 50.0, PositionZ := 0.0);
END_PROGRAM

Zero profile inputs select group defaults. Hold Start through completion, then release and raise it for another move. Use AXIS_REF and Axis for a group containing exactly one MotionAxis. Handles belong only in PROGRAM VAR, are required on every MC call and cannot be assigned, calculated or passed through user POUs.

To check the profile on a running machine, open Axis forces for the mechanism and switch to Motor torque. Jerk-limited moves show smooth, repeating peaks without spikes:

The Axis forces window for a delta robot driven by MC_MoveLinearAbsolute: motor torque of the three rail joints over 10 s, smooth repeating peaks of about 0.2 N·m and their peak and RMS figures

Single axisPurpose
MC_PowerLevel-sensitive logical enable; Status/Valid
MC_ResetClear a resolved fault at standstill
MC_ReadActualPositionEnable → Valid/Busy/Position
MC_MoveAbsoluteAbsolute Position
MC_MoveRelativeSigned Distance from position at activation
MC_MoveVelocityContinuous Velocity; InVelocity when speed is reached
MC_HaltInterruptible controlled stop
MC_StopControlled stop with held-Execute interlock
Group (Cartesian or Robot)Purpose
MC_AddAxisToGroupAdd an axis handle to the group before enabling it
MC_GroupEnable / MC_GroupDisableEnable coordination / immediately cancel and hold
MC_GroupResetClear a resolved fault at standstill
MC_MoveLinearAbsoluteStraight move to Position (array) or PositionX/Y/Z (Cartesian only); optional transition to the previous move
MC_MoveDirectAbsolutePoint-to-point move to Position; all axes arrive together; optional transition to the previous move
MC_GroupHaltControlled stop that locks nothing and can be replaced by the next move
MC_GroupStopControlled stop with held-Execute interlock
MC_GroupReadActualPosition / MC_GroupReadPositionEnable → Valid/Busy/Position[0..5] and PositionX/Y/Z

Execute commands trigger on a rising edge; falling Execute does not cancel the motion. Call instances cyclically to observe completion. Positional moves expose Done, Busy, Active, CommandAborted, Error and ErrorID. Stop has no Active port; MoveVelocity has InVelocity instead of Done. Readers use Enable, Valid and Busy, plus Error/ErrorID.

Positions and enums. Position is an ARRAY[0..5] OF LREAL, set element by element (move.Position[2] := 400.0;). A MC_MoveLinearAbsolute instance uses either Position or PositionX/Y/Z, never both. CoordSystem takes MC_COORD_SYSTEM.ACS (0) or MC_COORD_SYSTEM.MCS (1, default); BufferMode takes the bare constants mcAborting/mcBuffered or the qualified enum MC_BUFFER_MODE. MC_MoveDirectAbsolute takes Velocity, Acceleration, Deceleration and Jerk in percent of the group’s nominal dynamics (0 means 100 %).

Only the first call of one MC instance per scan evaluates inputs; later calls return cached values. Use separate instances for scan-order arbitration. Direction constants are mcPositiveDirection (1), mcShortestWay (2), mcNegativeDirection (3) and mcCurrentDirection (4). Absolute linear moves accept but ignore a valid Direction; MoveVelocity rejects shortest-way. Zero Velocity selects the default, not a stop.

Axis states are Disabled, Standby, DiscreteMotion, ContinuousMotion, Stopping and ErrorStop. Group states are GroupDisabled, GroupStandby, GroupMoving, GroupStopping and GroupErrorStop. Enable reaches standby; completed moves return to standby; faults require reset after the cause clears.

Axis states and the blocks that change them MC_Power moves an axis from Disabled to Standby. From Standby, MC_MoveAbsolute or MC_MoveRelative start DiscreteMotion, MC_MoveVelocity starts ContinuousMotion and MC_Stop leads to Stopping. A completed discrete move, or standstill after MC_Stop with Execute released, returns to Standby. A fault leads to ErrorStop from any state; MC_Reset returns to Standby once the cause is cleared. Power off returns to Disabled from any state. Groups follow the same pattern with the group states and group blocks. Axis states and the blocks that change them Disabled power off returns here from any state MC_Power Standby DiscreteMotion MC_MoveAbsolute/Relative ContinuousMotion MC_MoveVelocity Stopping MC_Stop Done, or standstill after MC_Stop with Execute = FALSE ErrorStop a fault leads here from any state MC_Reset Groups follow the same pattern: GroupDisabled, GroupStandby, GroupMoving, GroupStopping and GroupErrorStop, with MC_GroupEnable, MC_MoveLinearAbsolute, MC_GroupStop and MC_GroupReset.
Execute starts a command on its rising edge. MC_Stop holds the axis in Stopping until it is at standstill and Execute is released; MC_Halt stops under control but can be interrupted by the next move.

Set the group Kind to Robot, assign the robot’s RobotIK to Kinematics and add one MotionAxis per joint named J1 to Jn (the index in the RobotIK axis list) with Unit deg. Bind each Setpoint to the signal that the joint’s drive follows. The group then commands the robot from poses instead of single coordinates.

From a TCP pose to the robot's joints An MC block in the PLC program passes a tool pose to the MotionGroup of kind Robot. The group solves the inverse kinematics of the referenced RobotIK every simulation step and writes one joint set-point signal in degrees per MotionAxis J1 to Jn. The drive behaviour of each joint follows its set-point signal and moves the robot. From a TCP pose to the robot's joints PLC program MC_MoveDirectAbsolute MC_MoveLinearAbsolute Position[0..5], mm and deg MotionGroup · Robot Kinematics → RobotIK inverse kinematics each step nearest solution MotionAxis J1..Jn Setpoint signals in degrees Drive_Follow Position moves the joint The group only observes the robot's axes: a running IKPath or another owner gives ErrorID 16#8005.
The group solves the kinematics and writes joint set-points as signals; the joint drives follow them like any other set-point.
PROGRAM Pick
VAR
arm : AXES_GROUP_REF;
enable : MC_GroupEnable;
toPick : MC_MoveDirectAbsolute;
lift : MC_MoveLinearAbsolute;
END_VAR
VAR_EXTERNAL Start : BOOL; END_VAR
toPick.Position[0] := 300.0; toPick.Position[1] := -250.0; toPick.Position[2] := 400.0;
toPick.Position[3] := 180.0; toPick.Position[4] := 0.0; toPick.Position[5] := 90.0;
lift.Position[0] := 300.0; lift.Position[1] := -250.0; lift.Position[2] := 500.0;
lift.Position[3] := 180.0; lift.Position[4] := 0.0; lift.Position[5] := 90.0;
enable(AxesGroup := arm, Execute := TRUE);
toPick(AxesGroup := arm, Execute := enable.Done AND Start, CoordSystem := MC_COORD_SYSTEM.MCS);
lift(AxesGroup := arm, Execute := toPick.Done);
END_PROGRAM

With CoordSystem = MCS (the default), Position[0..2] is the local X, Y, Z position in millimetres and Position[3..5] the local rotation as Euler angles X, Y, Z in degrees (order XYZ) of a node that hangs directly below the RobotIK node and sits on the tool point. These are exactly the numbers the Inspector shows for such a node (the Inspector shows metres; multiply by 1000). Moving, turning or uniformly scaling the robot base does not change them. To read the pose of a mark elsewhere in the scene, use MC_GroupReadPosition or the read-only line Pose in robot frame on the RobotIK.

CoordSystem = ACS takes the joint values J1 to Jn in degrees. MC_MoveDirectAbsolute moves point to point in either system; MC_MoveLinearAbsolute on a Robot group needs the array form, and with ACS the joint target is converted to a pose and approached on a straight line. MC_GroupHalt brakes along the path without locking, MC_GroupStop locks until Execute falls.

World coordinate system and pose convention (in development)

Section titled “World coordinate system and pose convention (in development)”

These two settings are a development feature: they are not yet available in released builds. Without them a Robot group behaves exactly as described above.

WCS. Assign a node of the scene to WorldFrame on the Robot group with the reference picker. Then CoordSystem := MC_COORD_SYSTEM.WCS (2) is accepted by MC_MoveLinearAbsolute, MC_MoveDirectAbsolute, MC_GroupReadPosition and MC_GroupReadActualPosition, and the pose is measured in the frame of that node. Without WorldFrame, WCS is the same as MCS. Only the position and rotation of the node count; its scale must be uniform and positive. A non-uniform or negative scale, or a WorldFrame that was deleted, answers 16#8010 and names the cause in Problems. The frame is read when a command is accepted, so a moved WorldFrame applies to the next command. WCS exists only for Robot groups; Cartesian groups and the systems FCS and TCS answer 16#8010.

PoseConvention sets how the six pose numbers of the group are written, in every coordinate system: in the move inputs, in MC_SetCoordinateTransform, in the position reads and in the published robot points.

PoseConventionValuesAxes
YUpEulerXYZ (default)X, Y, Z in mm, Euler X, Y, Z in degreesthe robot’s own frame, Y up (see Pose contract)
ZUpEulerZYXX, Y, Z in mm, A, B, C in degrees, rotation Z, then Y, then Xthe axes of the robot program export

With ZUpEulerZYX a point carries the same numbers in the PLC program as in the robot program that the export writes for the same point, for example the X, Y, Z, A, B, C of a KUKA E6POS. At B = ±90° A and C turn about the same axis; the group then reports C = 0 and the whole turn in A. Joint values (ACS) and the rail value at index 6 (mm) are never converted.

  • The solution nearest to the current joint position is always used; there is no configuration or turn data.
  • Only rotary axes; a chain with a linear axis is refused with a diagnostic.
  • OrientationMode supports only mcLinear (0): the orientation turns the shortest way, evenly along the line.
  • A linear move is checked when it becomes active: samples at most 10 mm and 2° apart, at most 2000 (20 m). An unsolvable sample ends the command with 16#800F before anything moves. At run time a joint jump of more than 30° per step stops the group with 16#800F; recover with MC_GroupReset.
  • The tool rotation is limited by AngularVelocity; point-to-point moves use JointVelocity, JointAcceleration and JointJerk as 100 %.
  • A linear move keeps the tool limits (Velocity, Acceleration, Jerk, AngularVelocity) and, from realvirtual WEB 6.9.0, also the joint limits JointVelocity, JointAcceleration and JointJerk. Close to a singularity (for example a nearly stretched wrist) the tool therefore slows down instead of the joints exceeding their limits, and some moves without blending take longer than in earlier versions. Keep linear moves away from singular poses; use a point-to-point move to pass through.
  • IgnoreJointDynamicsOnLin (off by default) restores the earlier behaviour: plain linear moves then use only the tool limits, and the joints can exceed their limits close to a singularity. The switch takes effect on the next PLC deploy.
  • Blending between moves works as described under Blending between moves. Only ACS and MCS; the robot IK solver must be loaded (otherwise MC_GroupEnable answers 16#800D).

Add a MotionAxis named E1 to the group. Set Unit to mm and bind Setpoint to the signal that drives the rail drive. Add an ExternalAxis component that links the rail drive to the group’s RobotIK. Place the E1 axis on the rail drive’s node or below it, otherwise the group refuses the configuration. The six robot joints remain rotary.

For MC_MoveDirectAbsolute and MC_MoveLinearAbsolute, use Position with ARRAY[0..6] OF LREAL. Indices 0 to 5 hold the Cartesian pose in MCS or the joint angles in ACS. Index 6 holds the rail value in mm. Your Cartesian pose is relative to F0, the robot base in its zero position on the rail; the moving base is F0 translated by e along the rail direction, so a target in F0 stays fixed as the rail moves.

Fixed pose frame and moving robot base F0 is the robot base at rail value zero. The base at rail value e is translated along the rail direction. The target stays at the same position in F0 while the base moves. F0 stays fixed while the base moves F0 base at e = 0 fixed target in F0 e along the rail direction base(e) = translated F0
The rail changes the robot base position; it does not move the target frame.

Both move blocks accept ExternalAxisMode of type MC_EXTERNAL_AXIS_MODE:

  • MC_EXTERNAL_AXIS_MODE.Fixed (0, default) uses the rail value you supply.
  • MC_EXTERNAL_AXIS_MODE.Auto (1) chooses the target rail value once when the move starts. Auto requires the Cartesian coordinate system MCS. Robots with a spherical wrist or UR geometry use their closed-form solution.

The following forms apply to a group with E1:

Position valuesExternalAxisModeMCSACS
6 (ARRAY[0..5] OF LREAL)Fixed (default)16#800416#8004
6constant MC_EXTERNAL_AXIS_MODE.AutoAllowed: pose in F016#8004
6variable, even if its value is Auto16#800416#8004
7 (ARRAY[0..6] OF LREAL)Fixed (default)Allowed: pose in F0, rail in mmAllowed: J1..J6 in degrees, rail in mm
7AutoAllowed: pose in F0, index 6 ignored16#8004

A variable mode requires seven values and follows its current Fixed/Auto value. Without E1, seven values or Auto returns 16#8004; six values with Fixed keep the usual robot pose contract. Form checks run at deploy, with 16#8004 as the runtime fallback. ExternalAxisMode is an extension to the PLCopen interface.

Auto uses these fields on RobotIK:

FieldUnitMeaning
ExternalAxisTravelWeight1/mPenalizes rail travel from the previous rail value.
ExternalAxisJointReserveWeightnonePenalizes joint positions close to their limits.
ExternalAxisOffsetWeight1/mPenalizes deviation from the preferred offset along the rail.
ExternalAxisPreferredOffsetmmSets the preferred base offset relative to the target along the rail; 0 puts the base level with the target.

The PLC copies these weights and the preferred offset at deploy; a change takes effect on the next PLC deploy.

Limits apply to each axis in its own unit: degrees for the joints and mm for E1. The rail uses the drive’s LowerLimit and UpperLimit. Its TargetSpeed must be positive. Acceleration limits rail acceleration only with UseAcceleration. Jerk limits rail jerk only with UseAcceleration, SmoothAcceleration and Jerk greater than 0. These drive settings take effect on deploy. During a linear move, the tool tip’s path in F0 also limits path speed. A rail value outside the limits at the target or a path point returns 16#8011. Auto returns 16#8012 when it finds no rail value for the target.

MC_GroupReadPosition and its alias MC_GroupReadActualPosition return seven values. Bind Position to ARRAY[0..6] OF LREAL. Index 6 is the rail value in mm in both ACS and MCS.

Blending works with E1 as on a group without a rail. Set BufferMode to mcBlendingPrevious (or another blending mode) and TransitionMode to mcTMCornerDistance on the following move; LIN-LIN, LIN-PTP, PTP-LIN and PTP-PTP corners are blended. In the corner zone the rail is the seventh channel of the corner:

  • On a LIN-LIN corner the rail moves along the same curve parameter as the tool tip, so its position and its speed pass through the zone without a step.
  • On a corner with a PTP move the rail is part of the joint curve and is treated in mm like a joint.
  • The rail keeps its own speed, acceleration and jerk from the rail drive inside the zone.
  • On a PTP move the corner distance (TransitionParameter) counts in the unit of the leading channel, the axis or rail with the longest move time: in mm when the rail leads, in degrees when a joint leads. On a LIN move it is always mm of the tool path. A rail-only move with a corner distance of 20 starts its corner 20 mm before the target (at most half the move).

A move with a pure rail travel or a pure rotation of the tool has no corner; the group stops at that point as before and reports the reason in Problems (motion-blend-rejected). A DES snapshot of this group is refused with plc-motion-external-axis.

Set the group’s Program to this PLCProgram and Variable to group. Choose a target within the configured robot and rail limits. Raise Start after enabling and hold it until completion. Release it before requesting another move.

PROGRAM RailPositioning
VAR
group : AXES_GROUP_REF;
enable : MC_GroupEnable;
move : MC_MoveDirectAbsolute;
Position : ARRAY[0..6] OF LREAL;
END_VAR
VAR_EXTERNAL Start : BOOL; END_VAR
Position[0] := 300.0;
Position[1] := -250.0;
Position[2] := 400.0;
Position[3] := 180.0;
Position[4] := 0.0;
Position[5] := 90.0;
Position[6] := 500.0;
enable(AxesGroup := group, Execute := TRUE);
move(AxesGroup := group, Execute := enable.Done AND Start,
Position := Position, CoordSystem := MC_COORD_SYSTEM.MCS,
ExternalAxisMode := MC_EXTERNAL_AXIS_MODE.Fixed);
END_PROGRAM

The RobotOnTrack demo uses a UR10e on a 3 m rail to visit two stations.

The RobotOnTrack demo: a UR10e on an orange carriage on a 3 m rail, with a grey table and a blue workpiece beside the rail at each end of the travel

These excerpts use its poses in F0 (mm and Euler XYZ degrees). Set the group’s Program to the example program and Variable to arm; power and add J1..J6 and E1 with MC_Power and MC_AddAxisToGroup, as in the demo, before enabling the group. Raise Start for one sequence and keep it high until completion; release it to rearm.

Move to station A with PTP Fixed, then lift on a straight line in F0 while the rail moves from 400 to 800 mm.

PROGRAM TrackFixed
VAR
arm : AXES_GROUP_REF;
enable : MC_GroupEnable;
atA : MC_MoveDirectAbsolute;
lift : MC_MoveLinearAbsolute;
pAtA, pLiftA : ARRAY[0..6] OF LREAL;
END_VAR
VAR_EXTERNAL Start : BOOL; END_VAR
pAtA[0] := -400.0; pAtA[1] := 400.0; pAtA[2] := 550.0;
pAtA[3] := 90.0; pAtA[4] := 0.0; pAtA[5] := 0.0; pAtA[6] := 400.0;
pLiftA[0] := -400.0; pLiftA[1] := 650.0; pLiftA[2] := 550.0;
pLiftA[3] := 90.0; pLiftA[4] := 0.0; pLiftA[5] := 0.0; pLiftA[6] := 800.0;
enable(AxesGroup := arm, Execute := TRUE);
atA(AxesGroup := arm, Execute := enable.Done AND Start, Position := pAtA,
CoordSystem := MC_COORD_SYSTEM.MCS, ExternalAxisMode := MC_EXTERNAL_AXIS_MODE.Fixed);
lift(AxesGroup := arm, Execute := Start AND atA.Done, Position := pLiftA,
CoordSystem := MC_COORD_SYSTEM.MCS, ExternalAxisMode := MC_EXTERNAL_AXIS_MODE.Fixed,
Velocity := 150.0, Acceleration := 500.0, Deceleration := 500.0, Jerk := 5000.0);
END_PROGRAM

Use PTP Auto to approach station B and LIN Auto to descend; each move chooses its target rail value once when it becomes active.

PROGRAM TrackAuto
VAR
arm : AXES_GROUP_REF;
enable : MC_GroupEnable;
aboveB : MC_MoveDirectAbsolute;
downB : MC_MoveLinearAbsolute;
pAboveB, pAtB : ARRAY[0..6] OF LREAL;
END_VAR
VAR_EXTERNAL Start : BOOL; END_VAR
pAboveB[0] := -2600.0; pAboveB[1] := 650.0; pAboveB[2] := 550.0;
pAboveB[3] := 90.0; pAboveB[4] := 0.0; pAboveB[5] := 0.0; pAboveB[6] := 0.0;
pAtB[0] := -2600.0; pAtB[1] := 400.0; pAtB[2] := 550.0;
pAtB[3] := 90.0; pAtB[4] := 0.0; pAtB[5] := 0.0; pAtB[6] := 0.0;
enable(AxesGroup := arm, Execute := TRUE);
aboveB(AxesGroup := arm, Execute := enable.Done AND Start, Position := pAboveB,
CoordSystem := MC_COORD_SYSTEM.MCS, ExternalAxisMode := MC_EXTERNAL_AXIS_MODE.Auto);
downB(AxesGroup := arm, Execute := Start AND aboveB.Done, Position := pAtB,
CoordSystem := MC_COORD_SYSTEM.MCS, ExternalAxisMode := MC_EXTERNAL_AXIS_MODE.Auto,
Velocity := 150.0, Acceleration := 500.0, Deceleration := 500.0, Jerk := 5000.0);
END_PROGRAM

At rest at station B, read all seven values, freeze the measured rail value in pLiftB[6], and use Fixed for the following lift.

PROGRAM TrackReadAndLift
VAR
arm : AXES_GROUP_REF;
enable : MC_GroupEnable;
readPosition : MC_GroupReadPosition;
liftB : MC_MoveLinearAbsolute;
pRead, pLiftB : ARRAY[0..6] OF LREAL;
captured : BOOL;
END_VAR
VAR_EXTERNAL Start : BOOL; END_VAR
pLiftB[0] := -2600.0; pLiftB[1] := 650.0; pLiftB[2] := 550.0;
pLiftB[3] := 90.0; pLiftB[4] := 0.0; pLiftB[5] := 0.0;
enable(AxesGroup := arm, Execute := TRUE);
readPosition(AxesGroup := arm, Enable := enable.Done,
CoordSystem := MC_COORD_SYSTEM.MCS, Position => pRead);
IF NOT Start THEN captured := FALSE; END_IF;
IF Start AND readPosition.Valid AND NOT captured THEN
pLiftB[6] := pRead[6]; captured := TRUE;
END_IF;
liftB(AxesGroup := arm, Execute := Start AND captured, Position := pLiftB,
CoordSystem := MC_COORD_SYSTEM.MCS, ExternalAxisMode := MC_EXTERNAL_AXIS_MODE.Fixed,
Velocity := 150.0, Acceleration := 500.0, Deceleration := 500.0, Jerk := 5000.0);
END_PROGRAM

IKTarget stores ExternalAxisMode (Fixed/Auto) and ExternalAxisPos (mm). The inspector shows these fields only when the target’s robot has an ExternalAxis; changing the mode to Auto does not solve immediately. Solve the target or edit it with the gizmo to update its solution. Community plays stored joint and rail values without a solver; solving in Fixed or Auto needs the Commercial edition. If you add a rail to an existing path, review each target: its default rail value is 0 mm.

Add MotionTarget to the node carrying an IKTarget. Pick a Robot MotionGroup in Group, then enter the declared ST global name in Variable (case insensitive). The suggested name comes from the point label; it is only a suggestion and is never entered automatically. Binding changes are document edits and can be undone.

Use Copy ST declaration and declare the point in a PLCLibrary GVL:

VAR_GLOBAL
P_Pick : ARRAY[0..5] OF LREAL;
END_VAR

The values are X, Y, Z in mm and Euler X, Y, Z in degrees relative to the group’s WorkObject. Without WorkObject they are in MCS; with a rail, MCS is the fixed rail frame F0. For a robot on a rail declare ARRAY[0..6]; index 6 is the point’s ExternalAxisPos in mm. Array length must match the group’s axis count.

Pass the array to ordinary PLCopen motion:

move(AxesGroup := arm, Execute := start,
Position := P_Pick, CoordSystem := 3);

In development, CoordSystem on the MotionTarget chooses the system the point is written in: PCS (default, as described here), MCS or WCS (the group’s WorldFrame, or MCS without one). The numbers follow the group’s PoseConvention (see World coordinate system and pose convention). Command the point in the same system.

Use PCS (CoordSystem := 3) with WorkObject and MCS without it. A program-set MC_SetCoordinateTransform deliberately adds another offset: point X=100 plus transform X=50 commands X=150, while the authored point and its IK path remain at X=100.

Moving the point publishes the new values for the next scan. Undo restores the old values. Reset and deploy replay the current point before the first scan. Moving a point and its WorkObject together preserves the point’s relative values, so the published array does not change. Its stored joint angles (AxisPos) are not solved again when only a parent such as the WorkObject moves: a point-to-point IK path then still drives to the old joint pose while the PLC program reads the new position. Move the point itself once (or teach it again) to update its joint angles. Moving the whole robot together with its points changes neither.

There is no exclusivity: the program and other identified writers may write the array. The last writer wins; the next point change publishes again. The array elements are visible as ordinary GVL signals, for example P_Pick[0].

For pallet or rack slots, one MotionTarget can stand for a whole grid of points. Set CountX, CountY and CountZ (1 to 64 each, together at most 64 points) and Pitch, the spacing in mm along the point node’s own X, Y and Z axes. The node itself is the first point; every grid point keeps its orientation (and, on a rail, its ExternalAxisPos). The pitch is physical mm: it does not change when the point or its parent is scaled. While the point is selected, the grid points appear as small markers in the 3D view, and the Inspector shows the table size, for example 12 points, table ARRAY[0..71] OF LREAL. A count above 64 points in total is refused before the change is made.

The variable is then one flat table with 6 values per point (7 with a rail):

VAR_GLOBAL
P_Slots : ARRAY[0..71] OF LREAL; (* 12 points x 6 values, point k at 6*k *)
END_VAR

Point k = ix + CountX * (iy + CountY * iz): X runs fastest, Z is the layer. Point k occupies the elements 6*k to 6*k+5. The Position of a move still takes one point, so copy point k into a local array first. This is plain IEC 61131-3, the same loop you write for any position table:

VAR
pos : ARRAY[0..5] OF LREAL;
i, k : INT;
END_VAR
FOR i := 0 TO 5 DO
pos[i] := P_Slots[6 * k + i];
END_FOR;
move(AxesGroup := arm, Execute := start, Position := pos, CoordSystem := 3);

With a rail use ARRAY[0..6], FOR i := 0 TO 6 and P_Slots[7 * k + i]. Copy ST declaration writes the right table size and this loop as a comment. With all counts at 1 the point is a single point, exactly as above. The reachability check tests every grid point and names an unreachable one by its index k and (ix, iy, iz). The ST export writes the whole table as the start value.

The Export ST action on a PLC program in the Inspector downloads one IEC 61131-3 Structured Text file (.st) for a real controller. This is a development feature and not yet available in released builds. The file contains, in this order:

  1. a header comment with origin, date, the motion groups with their PoseConvention, WorkObject and WorldFrame, the exported points with their coordinate system, and the warnings;
  2. the program’s own code. It is never rewritten: the only change is the start value of each robot point declared in the program’s own VAR_GLOBAL, set to the pose the simulation currently publishes (P_Pick : ARRAY[0..5] OF LREAL := [..];, mm and degrees in the group’s PoseConvention, seven values with a rail);
  3. every PLC library GVL that declares an exported robot point: its text unchanged except for the start values of those points, wrapped in NAMESPACE <GVL name> ... END_NAMESPACE (with qualified_only as the library declares it). Library GVLs without an exported point are not included;
  4. after that, RV_WORK_OBJECT and RV_WORLD_FRAME as VAR_GLOBAL CONSTANT ARRAY[0..5] OF LREAL: the WorkObject and WorldFrame relative to the robot base (MCS), only when they are set.

Only the realvirtual ST compiler reads the whole file as one source; NAMESPACE is a realvirtual extension, not strict IEC 61131-3. For a CODESYS or TwinCAT project, split the file into the project’s objects: the program into a program object, the text between NAMESPACE and END_NAMESPACE into a GVL object with that name, and the frame block into a GVL (it is data). CODESYS and TwinCAT do not accept VAR_GLOBAL after END_PROGRAM in a program object.

Read the warnings before you hand the file on. The export never makes a silent assumption; it warns about points without a valid binding (not exported), realvirtual-specific names such as RV_* variables, GET_PARAM or MU_*, also inside an included library (with line), a rail (the controller must know axis E1), a MC_SetCoordinateTransform set at runtime (not part of the start values), start values it replaced, and a program that does not compile on its own in realvirtual (for example because it uses a PLC library). The export is no CODESYS project; use the CODESYS export for that. Agents use web_query("plc.program.export", {"programPath": "<program>"}), which answers { fileName, text, warnings } and changes nothing in the model.

Problems names missing variables, wrong types or lengths, duplicate point bindings, missing groups or kinematics, contradictory IKPath robot assignments and unsupported Cartesian/tracking groups. A standalone point gets its robot from Group. An existing IKPath assignment is never silently replaced.

A Drive_FollowPosition bound to an axis of the robot keeps driving that axis while an IK path, ik.robot.goTo or a Jog moves the robot: the follower’s setpoint overwrites the robot motion on that axis. Drive a robot axis either through a follower or through robot motion, not both at once. Robot ownership already prevents ST and IK paths from taking control simultaneously.

By default a move ends at standstill before the next one starts. MC_MoveLinearAbsolute and MC_MoveDirectAbsolute can instead pass a corner without stopping: the group leaves the first move shortly before its end, follows a smooth curve and joins the second move. realvirtual WEB runs locally, so the curve is planned on your machine with no cloud service and your data stays with you.

A corner with and without a transition A move runs along a straight line to the programmed corner C and continues on a second line at an angle. Without a transition the group stops at C. With a transition the group leaves the first line at point A, a distance d before C, follows a smooth curve and joins the second line at point B, the same distance d after C, without stopping. A corner with and without a transition stops at C (no transition) passes the corner (transition) predecessor successor A curve starts B curve ends d C: programmed corner, end of the predecessor d = TransitionParameter[0], the same distance on both lines. The speed in the curve follows TransitionVelocity.
The group leaves the first line at A, follows a smooth curve and joins the second line at B, the distance d on either side of the corner C.

The three inputs belong to the second move (the successor) and describe the transition from the first move into it:

InputValuesMeaning
TransitionVelocityMC_TRANSITION_VELOCITY: mcTVZero 0, mcTVLow 1, mcTVPrevious 2, mcTVNext 3, mcTVHigh 4Speed in the curve. mcTVZero (default) stops at the corner as before. 1 uses the lower of the two move velocities, 2 that of the first move, 3 that of the second, 4 the higher one. Modes 1 to 4 only act up to the slower of the two programmed velocities: the programmed velocity of a move is always a hard limit (PLCopen-compliant), so the curve never runs faster than either move
TransitionModeMC_TRANSITION_MODE: mcTMNone 0 (default) or mcTMCornerDistance 3Only these two modes execute; mcTMStartVelocity, mcTMConstantVelocity and mcTMMaxCornerDeviation give 16#8004
TransitionParameterARRAY[0..3] OF LREAL[0] is the corner distance d: millimetres on a linear move, degrees of the leading joint on a point-to-point move, millimetres on the linear move of a mixed pair. [1..3] are reserved and must be 0

A transition needs BufferMode = mcBuffered, TransitionVelocity other than 0, TransitionMode = mcTMCornerDistance and a successor that is commanded while the first move is still running. With mcAborting, or with the inputs at their defaults, the first move brakes as before. The reference point is fixed to the start of the second move. A value of 0 or less for d, a TransitionVelocity outside 0 to 4 or a nonzero TransitionParameter[1..3] returns 16#8004.

PROGRAM Corner
VAR
arm : AXES_GROUP_REF;
enable : MC_GroupEnable;
first, second : MC_MoveLinearAbsolute;
corner : ARRAY[0..3] OF LREAL;
END_VAR
VAR_EXTERNAL Start : BOOL; END_VAR
first.Position[0] := 300.0; first.Position[1] := -250.0; first.Position[2] := 400.0;
first.Position[3] := 180.0; first.Position[4] := 0.0; first.Position[5] := 90.0;
second.Position[0] := 500.0; second.Position[1] := -250.0; second.Position[2] := 400.0;
second.Position[3] := 180.0; second.Position[4] := 0.0; second.Position[5] := 90.0;
corner[0] := 40.0;
enable(AxesGroup := arm, Execute := TRUE);
first(AxesGroup := arm, Execute := enable.Done AND Start);
second(AxesGroup := arm, Execute := enable.Done AND Start,
BufferMode := MC_BUFFER_MODE.mcBuffered,
TransitionVelocity := MC_TRANSITION_VELOCITY.mcTVLow,
TransitionMode := MC_TRANSITION_MODE.mcTMCornerDistance,
TransitionParameter := corner);
END_PROGRAM
  • Linear to linear, point-to-point to point-to-point and mixed pairs, on robot groups and on Cartesian groups.
  • The corner distance is limited to half the length of the shorter of the two moves. The Problems panel then shows the info motion-blend-distance-capped.
  • The speed in the curve is never higher than the limits allow: the joint limits along the curve, AngularVelocity and the speed from which the second move can still stop at its end.
  • Stop, Halt, an Aborting command or a fault inside the curve brake along the path.

When blending is enabled, a transition between a linear move and a joint move carries the tool through the corner without slowing to a crawl. The programmed target points stay the same. A stop requested during a transition respects the robot’s joint limits and can therefore take slightly longer than requested. A sequence of corners without a straight piece between them keeps the same speed at the shared point; the first curve is lowered if it has not started yet and that is not slower than stopping at the second corner. If that is not possible, the group stops at the second corner and the Problems panel shows the info motion-blend-rejected: the following transition is slower than the one before it and the one before it cannot be slowed down to match.

No transition arises, and the group stops at the corner exactly as without blending, when

  • the second move is commanded too late, for example in the scan in which the first move already reaches the corner,
  • the curve cannot be driven within the limits,
  • the check of the second move uses up its budget or the second move is unreachable,
  • the group is already braking, or the pair has no curve (a pure rotation, a move of length zero),
  • a move is longer than 20 m (2000 samples).
  • In a sequence of corners without a straight piece between them, the following transition is slower than the one before it and the first curve can no longer be lowered (reason chain-speed).

The Problems panel then shows the info motion-blend-rejected with the reason, once per program run. Both hints are reported at the end of the scan. The second move is checked over its stopping distance when it is accepted and step by step ahead of the motion. If that check fails before the curve starts, the transition is dropped and the second move ends with 16#800F when it starts; once the curve has started, the group stops with 16#800F and brakes inside the checked part.

  • Linear moves keep the joint limits unless IgnoreJointDynamicsOnLin is on (see Limits of robot motion). At a transition the joint limits hold in the sense “not worse than without a transition”; close to a singularity the joint jerk can lie slightly above its limit.
  • A MC_GroupStop or MC_GroupHalt shortly before a blended corner stays within the tool speed limit: the group brakes on the programmed straight line with your Deceleration and does not enter the cancelled curve; the buffered next move is aborted. If that braking would run past the end of the line, the group brakes harder, up to the robot’s limits, or keeps the running profile to the end of the line. The Problems panel then shows motion-lin-stop-at-limit.
  • Since realvirtual WEB 6.9.0 each piece of a corner uses its own approach limits, so blended corners are usually faster than stopping at them. Known limitation: a point-to-point, linear, point-to-point, linear chain without a straight piece between the corners is about 7 % slower with blending than with stopping, and in some other cases blending is still slower than stopping at the corner. A fix is planned.
  • Only mcTMCornerDistance exists. The obsolete mcBlendingLow to mcBlendingHigh buffer modes stay rejected with 16#8007; use TransitionVelocity instead.

The targets of a robot program exist only as numbers in Structured Text. To see where they are, use Motion targets in the overlay menu of the 3D view while the simulation runs. The entry is offered when the model contains a robot group, and it is on by default. If you switch it off or on yourself, your choice is kept.

The UR10e chocolate packing cell with Motion targets switched on: axis crosses at the pick nest and above the carton slots, the labels toAbovePick PTP, upPick LIN and downPick LIN at the active and waiting targets, and the blue TCP trail with its rounded corners between the pick nest and the carton

  • Markers: every target the robot group has accepted appears as a small coordinate triad at its pose (X red, Y green, Z blue), drawn at a constant size on screen, with a ring that faces the camera. A solid ring marks the active target, a dashed ring a waiting one. Targets the robot has already reached stay visible but faint, so the taught points of a cycle build up as the program runs.
  • Labels: the target the robot is moving to and the targets waiting in the buffer carry a label with the name of the function block instance and the motion type, for example toAboveSlot PTP or downSlot LIN. Labels sit beside the triad. A target that failed or was aborted keeps its label and turns red. Reached targets show the marker only.
  • Same pose, several commands: commands that address the same pose share one marker.
  • TCP trail: a line shows the path of the tool centre point over the last eight seconds of simulation time, which makes approach moves and blended corners visible.

The overlay shows the programmed point. With blending the path passes near that point without reaching it, and the trail shows the difference.

The overlay only reads. It changes neither the program nor the targets, works for robot groups only, and pauses while the model runs as discrete-event simulation. After restoring a snapshot, labels of moves that were already running are empty until the program commands them again.

An AI assistant reads the same list with web_query("motion.group.targets", {}).

A group has exactly one owning PLCProgram occurrence. Many FB instances can share its handle, but one handle cannot bind two groups. Missing/duplicate bindings and competing program/group or group/group set-point writers refuse deployment with Problems entries.

Live controller values override local motion; the task writes nothing to live-bound or forced set-points. Authority loss suspends the group until authority returns and it is reset. Reconnect resynchronises without replaying commands. External operation/jog must enter the PLC as signals.

Runner Stop, scan error, COLD redeploy and group removal brake and hold under local authority. Simulation/PLC Reset is immediate, even while paused, and clears motion before the viewer resets drives. Power off/GroupDisable cancel immediately; use Stop first for a controlled stop.

You can change the ST code and deploy it again while the simulation runs. A deploy restarts the function blocks, so a start signal that is still TRUE would look like a new rising edge. To keep the robot or axis from moving on its own, a move block ignores a held Execute = TRUE after such a deploy. It starts again after Execute has been FALSE once and then goes TRUE.

  • Which blocks wait: MC_MoveAbsolute, MC_MoveRelative, MC_MoveVelocity, MC_MoveLinearAbsolute and MC_MoveDirectAbsolute.
  • Which blocks act at once: MC_Stop, MC_Halt, MC_GroupStop and MC_GroupHalt (a held stop keeps holding), and the administrative blocks MC_GroupEnable, MC_GroupDisable, MC_AddAxisToGroup, MC_GroupReset and MC_Reset.
  • What you see: the block reports no error and its outputs stay FALSE. The Problems panel shows the info plc-motion-execute-held-at-deploy with the name of the waiting block. The entry disappears after the falling edge.

A cold start still works as before: when the simulation starts or is reset, a held Execute = TRUE counts as a rising edge, so a program with a permanently wired Execute := TRUE runs. The same holds for the first deploy of a new program into the running simulation and for the Reset button of the PLC editor. Pause and resume, Stop and Run of the program, and a deploy that failed and was corrected do not lift the protection.

ErrorIDMeaning
16#8001Invalid binding
16#8002Disabled
16#8003Axis bounds exceeded
16#8004Invalid parameters
16#8005Owner/writer conflict
16#8006Forced/external authority
16#8007Invalid BufferMode/Direction
16#8008State/interlock refusal
16#8009Invalid feedback
16#800AProfile provider failure
16#800BAxis of another group added
16#800CAxis added twice, or group enabled before all axes were added and powered
16#800DRobot kinematics unavailable (reference missing, solver not loaded, no solver budget)
16#800EPoint-to-point target unreachable
16#800FLinear path not solvable or jump guard hit
16#8010Coordinate system not supported, or its frame (WorkObject, WorldFrame) is unusable: missing, scaled unevenly or deleted
16#8011Rail value outside the rail drive limits at the target or a point on the path
16#8012Auto finds no rail value for the target
16#8013The mounted robot was removed; the group waits for its replacement. Running moves end as aborted, new commands are refused until then
16#8014In development, only with RequireReachableTargets: the reachability check of the group’s motion targets failed or is unavailable

These are realvirtual-specific positive DINT values. Parameter errors reject that request without disturbing healthy motion. Kernel faults latch ErrorStop/GroupErrorStop.

Use this subset for Cartesian handling, positioning, single-axis speed control and robots with rotary axes. The coordinate systems are ACS, MCS and PCS (WCS for Robot groups in development); homing and synchronisation are absent, and moves are blended only with the corner distance transition. Acceleration/deceleration share the conservative limit min(A,D). Every replacement brakes first, including a collinear move. Done reports profile completion, with no hardware settling monitor. An unavailable protected profile core uses a warned trapezoid fallback without a jerk guarantee.

PLCopen motion runs in both simulation kinds. In DES the moves advance on a fixed motion cycle, and the program scans only when something it reads changes.

Continuous simulationDES (event-driven)
MC_ blocksRun; the motion task advances the profile every simulation stepRun; a fixed motion cycle (the Cycle Time of the DES manager) advances the profile while a move is running
When a command startsIn the same simulation step, right after the scan that issued itAt the following motion cycle point, up to one cycle later
When the program scansEvery stepWhen a command’s status or InVelocity changes, and on its other triggers (signal change, timer, own change). A program that reads a position with MC_ReadActualPosition or MC_GroupReadActualPosition also scans when that axis moves
Idle modelScans every stepNo motion cycle events while no move is running
DES checkNot applicableMC_ blocks cause no finding. D5 remains only for a motion program started without the DES motion cycle
SnapshotsNot applicableA move that is running when you save continues identically after the restore
End position and timingReferenceThe same profile, started on the motion cycle grid. Do not expect the same timestamps as in continuous simulation

A snapshot is refused, with the reason shown before it is saved, in two short situations: a move was started before the DES run began (let it finish), or a motion task is still braking after its program or group was removed (try again after about a second).

Robot groups run in DES as well: MC_MoveDirectAbsolute and linear moves use the same motion cycle, and a snapshot taken during a robot move continues identically after the restore. The IK solver must be loaded when you restore.

With a limited number of live IK solves, a model that contains both a PLC-controlled robot group and an IK path cannot be saved as a snapshot. The snapshot menu shows the reason before saving, and loading such a snapshot is refused without changing the running simulation. With an unlimited solver budget, or with only PLC robot groups or only IK paths in the model, snapshots work.