These functions are compatible with EtherCAT. When you configure the axes Mode to Cyclic a Unitronics EtherCAT master module acts as a motion controller, generating the motion profile and controlling the drives in order to implement Multi-Axes functions such as Camming and Gear.
Multi-Axis Function Blocks enable a synchronized relationship exists between two or more axes. The synchronization can be related to time or position. Often this relationship is between a master axis and one or more slave axes. A master axis can be a virtual axis.
From the state diagram point of view, the multi-axis Function Blocks related to Camming and Gearing can be looked at as a master axis in one state (for instance: MC_MoveContinuous) and the slave axis in a specific synchronized state, called ‘SychronizedMotion’.
Buffer Mode
Buffer Mode is relevant only for Cyclic or Virtual Axis. Relevant diagrams from the PLCopen documention are included at the bottom of this topic.
GearIn couples a master axis and a slave axis, with a given gear factor between the velocity of the master axis and of the slave axis.
The slave axis synchronously follows the master axis movement (velocity synchronicity).
The inputs Gear Ratio Numerator and Gear Ratio Denominator enable you to set a specific gear ratio for the movement of the slave axis.
![]() |
|
|
Parameter Name |
Purpose |
A |
Master Axis |
Select the Master Axis |
B |
Slave Axis |
Select the Slave Axis |
C |
Execute |
Rising Edge Triggers FB |
D |
Continuous Update |
If set, input parameters are evaluated at each cycle |
E |
Gear Ratio Numerator |
Gear Ratio Numerator |
F |
Gear Ratio Denominator |
Gear Ratio Denominator |
G |
Acceleration |
Maximum Acceleration during the time difference ‘Start-
|
H |
Jerk |
Value of the ‘Jerk’ [u/s3]. (always positive). |
I |
Buffer Mode |
Buffer Mode is relevant only for Cyclic or Virtual Axis. Note that all buffered commands will be aborted if the applicable axis moves to the state ‘ErrorStop’. Any subsequent commands will be rejected. Buffer values |
J |
In Gear |
Turns ON when set value equals commanded value |
K |
Busy |
Bit: when ON, the FB has control over the Axis |
L |
Active |
FB is currently controlling the axis |
M |
Command Aborted |
Bit: When ON, the FB has been aborted by another command |
N |
Error bit |
Turns ON when an error occurs within the function block |
O |
Error ID |
The value indicates the error code. |
The following figures from PLCopen shows the relationship between the axes with Buffer Modes set to 0.
GearOut disengages the Slave axis from the Master axis.
![]() |
|
|
Parameter Name |
Purpose |
A |
Slave Axis |
Select the Slave Axis |
B |
Execute |
Start disengaging process at the rising edge |
C |
Done |
Turns ON when disengaging is completed |
D |
Busy |
Bit: when ON, the FB has control over the Axis |
E |
Error bit |
Turns ON when an error occurs within the function block |
F |
Error ID |
The value indicates the error code. |
GearInPos commands a gear ratio between the position of the slave and master axes from the synchronization point onwards.
![]() |
|
|
Parameter Name |
Purpose |
A |
Master Axis |
Select the Master Axis |
B |
Slave Axis |
Select the Slave Axis |
C |
Execute |
Rising Edge starts gearing process |
D |
Gear Ratio Numerator |
Gear Ratio Numerator |
E |
Gear Ratio Denominator |
Gear Ratio Denominator |
F |
Master Sync Position |
The position of the master in the CAM profile where the slave is in-sync with the master. (if the ‘MasterSyncPosition’ does not exist, at the first point of the CAM profile the master and slave are synchronized.) |
G |
SlaveSyncPosition |
Slave Position at which the axes are running in sync |
H |
SyncMode |
Defines the way to synchronize mcSIowDown - Synchronize on current slave belt cycle mcCatchUp - Synchronize on next slave belt cycle |
I |
MasterStartDistance |
Master Distance for gear in procedure (when the Slave axis is started to get into synchronization) |
J |
Velocity |
Maximum Velocity during the time difference ‘StartSync’ |
K |
Acceleration |
Maximum Acceleration during the time difference ‘Start- |
L |
Jerk |
Maximum Jerk during the time difference 'StartSync' and 'InSync' Relevant only if axis motion profile is set as S-Curve |
M |
Buffer Mode |
Buffer Mode is relevant only for Cyclic or Virtual Axis. Note that all buffered commands will be aborted if the applicable axis moves to the state ‘ErrorStop’. Any subsequent commands will be rejected. Buffer values |
N |
Start Sync |
Commanded gearing starts |
O |
InSync |
Is ON when set value equals commanded value (is calculated |
P |
Busy |
Bit: when ON, the FB has control over the Axis |
Q |
Active |
FB is currently controlling the axis |
R |
Command Aborted |
Bit: When ON, the FB has been aborted by another command |
S |
Error bit |
Turns ON when an error occurs within the function block |
T |
Error ID |
The value indicates the error code. |
The following figure shows the PLCopen Timing Diagram of MC_GearInPos.
The next image shows an example of the difference between ‘SyncModes’ ‘SlowDown’ (green) and ‘CatchUp’ (red) with different initial velocities of the slave.
The next image shows an example of MC_GearInPos where the initial velocity of the slave is in the same direction of the master.
This Function Block combines the motion of 2 axes into a third axis with selectable combination method. Basically it is a calculation of a new position setpoint based on the 2 position setpoints of the input axes.
This FB is reflected in the state diagram like a synchronized motion type. As application example one can work with a separate profile synchronized to an object on a moving belt, or a rotating knife with flexible covered distance to be cut.
![]() |
To stop the motion, the FB has to be interrupted by another FB issuing a new command |
|
Parameter Name |
Purpose |
A |
Master Axis 1 |
Select the first Master Axis |
B |
Master Axis 2 |
Select the secondMaster Axis |
C |
Slave Axis |
Select the Slave Axis |
D |
Execute |
Rising Edge Triggers FB |
E |
Continuous Update |
If set, input parameters are evaluated at each cycle |
F |
CombineMode |
Defines the type of combination applied to AxisOut : |
G |
Gear Ratio Numerator M1 |
Gear Ratio Numerator Numerator for the gear factor for master axis 1 towards the |
H |
Gear Ratio Denominator M1 |
Gear Ratio Denominator for the gear factor for master axis 1 |
I |
Gear Ratio Numerator M2 |
Gear Ratio Numerator Numerator for the gear factor for master axis 2 towards the |
J |
Gear Ratio Denominator M2 |
Gear Ratio Denominator for the gear factor for master axis 2 |
K |
Buffer Mode |
Buffer Mode is relevant only for Cyclic or Virtual Axis. Note that all buffered commands will be aborted if the applicable axis moves to the state ‘ErrorStop’. Any subsequent commands will be rejected. Buffer values |
L |
InSync |
ON if the set value = the commanded value. |
M |
Busy |
Bit: when ON, the FB has control over the Axis |
N |
Active |
FB is currently controlling the axis |
O |
Command Aborted |
Bit: When ON, the FB has been aborted by another command |
P |
Error bit |
Turns ON when an error occurs within the function block |
Q |
Error ID |
The value indicates the error code. |
MC_CombineAxes can generate special synchronized movements that are not possible or complex to generate in other ways. In the following example, a CAM FB and the result of a Gear FB are both synchronized to a conveyor master, are added to generate a virtual master for a MC_GearInPos function of the final axis that will execute the movement.
The particular application of this example could be a machine to deposit the icecream waving layers on top of the icecream base travelling through the freezer line in icecream factory. The dosing axis has to synchronize with a waving manner to the conveyor carrying the icecream base block. And it has to do this in a particular starting position and wave phase to achieve the expected result (therefore the GearInPos). With the CAM FB one can define different wave patterns easily (like the one longer in the top of icecream).
The nest image shows the corresponding timing diagram for MC_CombineAxes example.
This information is an excerpt from PLCopen Safety Part 1 version 2.01, which may be downloaded in its entirety from: https://plcopen.org/downloads
A mechanical cam is a rotating or sliding piece in a mechanical linkage used especially in transforming rotary motion into linear motion or vice versa. It is often a part of a rotating wheel (e.g. an eccentric wheel) or shaft (e.g. a cylinder with an irregular shape) that strikes a lever at one or more points on its circular path. The cam can be a simple tooth, as is used to deliver pulses of power to a steam hammer, for example, or an eccentric disc or other shape that produces a smooth reciprocating (back and forth) motion in the follower, which is a lever making contact with the cam.As such a cam creates a link between a master and one or more slaves in a position / position mode (see figure hereunder).
With motors and drives one can create the same position / position relationship but in this case via a so-called Cam table listing the positions. So the relationship is converted to software and control.
Basically, one can differentiate between two types of Camming for both modulo and linear (or finite) master axes:
Camming may be done with several combined cam tables which are executed sequentially, like a ramp-in, a production cycle, and a ramp-out. Between the different cam curves may be a gap (wait for trigger) in the execution. However, one could the buffered mode or use the output ‘EndOfProfile’ to start the next profile.
CAM table
Camming is done with one table (two dimensional – describing master and slave positions together) or two tables - for master and slave positions separately. The table should be strictly monotonic rising or falling, going both reverse and forward with the master.
It is allowed and possible to change tables while CAM is running and to change elements in the table while the CAM is running.
The generation and filling of the CAM table (master, slave) is performed by an external tool, which is supplier specific. The coupling of the FB MC_CamIn to the table is also supplier-specific.
Value presentation types
Master and slave axes may have different presentations:
CAM Function Blocks
The advantages of having different Function Blocks for the camming functionality are a more transparent program execution flow and better performance in execution.
To create CAM tables in UniLogic:
UniLogic automatically assigns index numbers to each CAM table. You use these index numbers to identify the table in MC CamTableSelect.
Select a CAM recipe, and from the Recipe tab, select Show CAM Table Plot.
Use the Configuration tool to adjust the view.
Selects the CAM tables by setting the connections to the relevant tables.
![]() |
A virtual axis can be used as master axis
|
|
Parameter Name |
Purpose |
A |
Master Axis |
Select the Master Axis |
B |
Slave Axis |
Select the Slave Axis |
C |
CAM Table Index |
CAM table index |
D |
Execute |
Rising Edge triggers FB |
E |
Periodic |
1 = periodic, 0 = non periodic (single-shot) |
F |
Master Absolute |
1 = absolute; 0 = relative coordinates |
G |
Slave Absolute |
1 = absolute; 0 = relative coordinates |
H |
Done |
Pre-selection done |
I |
Busy |
Bit: when ON, the FB has control over the Axis |
J |
Error bit |
Turns ON when an error occurs within the function block |
K |
Error ID |
The value indicates the error code. |
L |
CamTableID |
Identifier of CAM Table to be used in the MC_CamIn FB |
The Function CamIn engages the Cam.
![]() |
|
|
Parameter Name |
Purpose |
A |
Master Axis |
Select the Master Axis |
B |
Slave Axis |
Select the Slave Axis |
C |
Execute |
Rising Edge triggers FB |
D |
Master Offset |
Offset of the master shaft to cam |
E |
Slave Offset |
Offset of slave table. |
F |
Master Scaling |
Factor for the master profile (default = 1.0). |
G |
Slave Scaling |
Factor for the slave profile (default = 1.0). |
H |
Master Start Distance |
The master distance for the slave to start to synchronize to |
I |
Master Sync Position |
The position of the master in the CAM profile where the slave is in-sync with the master, |
J |
CamTableID |
Identifier of CAM Table to be used, linked to output of |
K |
Buffer Mode |
Buffer Mode is relevant only for Cyclic or Virtual Axis. Note that all buffered commands will be aborted if the applicable axis moves to the state ‘ErrorStop’. Any subsequent commands will be rejected. Buffer values |
L |
InSync |
Is ON if the set value = the commanded value. |
M |
Busy |
Bit: when ON, the FB has control over the Axis |
N |
Active |
FB is currently controlling the axis |
O |
CommandAborted |
FB is aborted by another command |
P |
Error bit |
Turns ON when an error occurs within the function block |
Q |
Error ID |
The value indicates the error code. |
The CamOut function disengages the Slave axis from the Master axis immediately.
![]() |
|
|
Parameter Name |
Purpose |
A |
Slave Axis |
Select the Slave Axis |
B |
Execute |
Rising Edge Triggers FB |
C |
Done |
Disengaging complete |
D |
Busy |
Bit: when ON, the FB has control over the Axis |
E |
Error bit |
Turns ON when an error occurs within the function block |
F |
Error ID |
The value indicates the error code. |
When you configure your application for EtherCAT motion and set an axis to Mode: Cyclic, when the Axis Struct Status parameter indicates Error Stop (bit 7 in the bit array), the Error Stop ID number is written to the Error ID parameter of the MC functions in your program.
You can store the error ID number from an MC function into the Ladder element Get Cyclic Mode Error Description, in order to write the error description into an ASCII tag.
Using the Ladder element Get Cyclic Mode Error Description you can load the ASCII description into the linked ASCII string tag.
Note that all status and error codes are stored into the Error ID parameter of MC functions, not only the cyclic mode errors - however, only the cyclic mode errors will be transferred into the Get Cyclic Mode Error Description function.
The following examples and diagrams are examples excerpted from PLCopen documentation.
The Buffer Mode default value is 0. This is non-buffered mode, which acts immediately, even if this interrupts another motion.
Any other value starts buffer mode. This waits till the previous FB completes motion.
Note that all buffered commands will be aborted if the applicable axis moves to the state ‘ErrorStop’. Any subsequent commands will be rejected.
Buffer values
0: Aborting
1: Buffered
2: Blending low
3: Blending previous
4: Blending next
5: Blending high
Example 1: Standard behaviour of 2 following absolute movements
Basic example with two MC_MoveAbsolute on same axis:
Timing diagram for example above without interference between FB1 and FB2 (‘Aborting’ Mode)
Example 2: ‘Aborting’ motion
Timing diagram for example above with FB2 interrupting FB1 (‘Aborting’ Mode)
Example 3: ‘Buffered’ motion
Timing diagram for example above in ‘Buffered’ Mode
(Stopping to velocity 0 and starting FB2 at that point without delay)
Example 4: ‘BlendingLow’ motion
Timing diagram for example above with mode ‘BlendingLow’
(Using lowest velocity (=velocity 2) from final position of FB1 until final position of FB2)
With the blending (and other FBs working on the same axis at the same time (like MC_MoveAdditive)), the system has
to combine the different values working on the axis before giving the positions to the relevant axis
Example 5: ‘BlendingPrevious’ motion
Timing diagram for example above with mode ‘Merging1’
(Uses velocity FB1 at final position FB1)
Example 6: ‘BlendingNext’ motion
Timing diagram for example above with mode ‘BlendingNext’ motion
With a 2nd FB following MC_MoveVelocity all blending modes should work like blending previous or create an error.
Example 7: ‘BlendingHigh’ motion
Timing diagram for example above with mode ‘BlendingHigh’ motion