XGB EtherCAT CAM Data Creation and Using XPM_CAM or XPM_CAMO
XEM CPU supports up to 8 different CAM blocks using various CAM profiles. The CAM blocks are created in XG-PM software. The XPM_CAM and XPM_CAMO function blocks are used to execute any created CAM blocks.
-
A User CAM operation is available and is accessed as CAM block number 9.
-
A maximum of 2048 points can be generated per CAM block. An error will appear if a block will have too many points.
-
A CAM block supports one master axis and one sub-axis.
-
XPM_ECON and XPM_SVON must be executed before any motion.
Function Block | Description in XG5000 | Function |
---|---|---|
XPM_CAM | CAM run | Execute a predefined CAM block with the slave axis according to the movement of the master axis. |
XPM_CAMO | CAM run with master offset | Execute a predefined CAM block with the slave axis after the master axis moved the distance defined as the offset. |

XPM_CAM is used for executing a CAM block of a sub-axis. MST_AXIS should have the same unit configuration as the CAM block. The axis that uses the XPM_CAM function block is considered the sub-axis.
Element Name | Element Type | Description |
---|---|---|
REQ | Input | Edge detected request to execute the function block. |
BASE | Input | Base number of the motion controller. Set to 0. |
SLOT | Input | Slot number of the motion controller. Set to the slot number of the XBF-PN04B or XBF-PN08B module. |
AXIS | Input | Axis number to control. XBF-PN04B:1~4, XBF-PN08B:1~8 |
MST_AXIS | Input | Master axis number. XBF-PN04B:1~4, XBF-PN08B:1~8 and must not be the axis executing the XPM_CAM. |
CAM_BLK | Input | CAM block number to execute. XBF-PN04B:1~4, XBF-PN08B:1~8. 9 allows the execution of a USER CAM Operation. |
DONE | Output | Status that function block is done. |
STAT | Output | Current status of the function block. Non-zero numbers will be an error or warning. |

XPM_CAMO is used for executing a CAM block of a sub-axis with an added master offset position. MST_AXIS should have the same unit configuration as the CAM block. The axis that uses the XPM_CAMO function block is considered the sub-axis.
Element Name | Element Type | Description |
---|---|---|
REQ | Input | Edge detected request to execute the function block. |
BASE | Input | Base number of the motion controller.Set to 0. |
SLOT | Input | Slot number of the motion controller. Set to the slot number of the XBF-PN04B or XBF-PN08B module. |
AXIS | Input | Axis number to control. XBF-PN04B:1~4, XBF-PN08B:1~8 |
MST_AXIS | Input | Master axis number. XBF-PN04B:1~4, XBF-PN08B:1~8 and must not be the axis executing the XPM_CAMO. |
CAM_BLK | Input | CAM block number to execute. XBF-PN04B:1~4, XBF-PN08B:1~8. 9 allows the execution of a USER CAM Operation. |
MST_OFFSET | Input | Set the master’s offset position. |
DONE | Output | Status that function block is done. |
STAT | Output | Current status of the function block.Non-zero numbers will be an error or warning. |

The XG-PM software is used to create CAM blocks 1 through 8.
Step | Action |
---|---|
1 |
Open the XG5000 project for the application. Go to Tools menu èPosition Control to open XG-PM software.
|
2 |
Open the XG-PM project or Connect to PLC and select ProjectèOpen from PLC.
|
3 |
Open the CAM Data file in the workspace.
|
CAM Block Screen Layout
CAM Profile Screen Layout

Step | Action |
---|---|
1 |
Choose a CAM block number to configure.
|
2 |
Configure the CAM block mode settings.
|
3 |
Configure Main and Sub axis parameters.
|
4 |
Enter CAM block data. Make sure block data matches restrictions of CAM block configuration.
|
5 |
Press Setup complete button to calculate the CAM Profile.
|
6 |
Save the project. Connect to the CPU and write the project to the CPU. Note: If connecting XG5000 and XG-PM at the same time, make sure to connect XG5000 first. XG5000 will give error messages if it is connected last. |

This example is in scan program LP636_XPM_CAM_Example in OnlineHelp_ECAT_Example. In this example Axis 1 is the master axis and Axis 2 is the sub-axis.
-
When the ‘Run_Example’ variable is true, Axis 1 will do an absolute move to position 1500 pulses at 500 pulses/sec and Axis2 will execute an XPM_CAM function block.
-
Axis 2’s XPM_CAM is setup to execute CAM block 1.
-
Home Axes before setting ‘Run_Example ‘ to true.
-
CAM Block 1 is in XG_PM program LP533_CAMExample_XGPM.xpj
CAM Block 1
XPM_CAM LD Code
XPM_CAM XG-PM Trend Compared to CAM Profile

This example is in scan program LP636_XPM_CAMO_Example in OnlineHelp_ECAT_Example. In this example Axis 1 is the master axis and Axis 2 is the sub-axis.
-
When the ‘Run_Example’ variable is true, Axis 1 will do an absolute move to position 1500 pulses at 500 pulses/sec and Axis2 will execute an XPM_CAMO function block.
-
Axis 2’s XPM_CAMO is setup to execute CAM block 1.
-
Home Axes before setting ‘Run_Example ‘ to true.
-
CAM Block 1 is in XG_PM program LP533_CAMExample_XGPM.xpj
CAM Block 1
XPM_CAMO LD Code
XPM_CAMO XG-PM Trend Compared to CAM Profile
LP636