CODESYS Softmotion - How to configure ctrlX CORE and Drives

Long-established Member

This article describes the installation and the basic settings to run Codesys Softmotion on ctrlX CORE with two IndraDrive axis.
The article describes the proceeding with crlX CORE 01V16, but CODESYS Softmotion works with ctrlX CORE 01V12 and 01V14 as well.
Additional information is avaialble in the following documents:

Also some help videos are available:

In case of questions or if you experience any problem you can submit your issue in the Area for CODESYS PLC Add-Ons in the Developer Community.


The following ctrlX CORE apps are required by CODESYS Softmotion:

  • ctrlX PLC
  • EtherCAT Master

For engineering purpose a PC with ctrlX WORKS installation is required. All ctrlX software components need to have version 01V12 or higher.
CODESYS Softmotion and the adaption layer to run CODESYS Softmotion on ctrlX CORE are provided as CODESYS packages in the Collaboration Room.

⚠️ The installation of CODESYS packages requires administrator rights on your Windows PC.

CODESYS Softmotion Installation

The package extraction takes a while. Afterwards you have to confirm the CODESYS license agreement, choose the typical setup and step through the following dialogs with the next button. Close the last dialog with the finish button and close the PLC engineering application. You have to allow the installation process to make changes on your computer. After some waiting time the installation window will open. 


If the Installation progress window does not popup, you will find it in the Windows task bar with the symbol image2022-3-18_10-50-32.png

Installation of ctrlX Softmotion Adaption Package

all the ctrlX PLC Engineering menu Tools->PackageManager. Click on the Install-Button in the appearing dialog and browse to the location where your download of the ctrlX Softmotion Adaption Package is saved. Select “Allow unsigned and self-signed packages and click ok.


Accept the license agreement and select typical installation in the next dialogs.

Configuration of IndraDrive Axis

The example is made with two IndraDrives. Ensure

  • that your drives are configured for EtherCAT SOE communication,
  • that the EtherCAT line is connected correctly and
  • that the power supply of the drives is on.

In this example both drives are rotary axis.

⚠️The modulo handling is completely handled by CODESYS Softmotion. Therefor the drives have to be configured without modulo handling and with the full 32 bit range for the increments. The parameter S-0-0278 must be set to its maximum value, namely 214748.3647. The value is the result of (2^31 - 1) / 10000. 


You can do this by ctrlX DRIVE Engineering. Click in the drive overview dialog on the box Axis mechanics / scaling and set the values like in the graphic below.


I/O Configuration

Connect with your web browser to ctrlX CORE, navigate to the EtherCAT menu and add an EtherCAT Master.


Go to the EtherCAT status page and switch the EtherCAT bus to the state "Init".


Start ctrlX I/O Engineering and define the name of your application and the destination folder on your engineering PC.


Ensure that your drives are configured for EtherCAT SOE communication, the EtherCAT line is connected correctly and the power supply of the drives is on. Then click with the right mouse button on the Ethercatmaster node to open the menu where you can select “Scan for Devices”.


In the scan result you will see the drives which are connected to your ctrlX CORE. Press the button “Insert all newly scanned devices” in the scan result dialog to copy the drives to your project I/O configuration on the left side of the dialog.


Closing the scan dialog with ok will add the drives under the ethercatmaster node in IO Engineering. Download the EtherCAT configuration to your ctrlX CORE via the I/O Engineering menu entry Online => “Transfer fieldbus configuration”.  The successful download is confirmed in the message window of IO Engineering. Finally save the I/O Engineering project and close IO Engineering.

In ctrlX Web UI you can verify the EtherCAT status and change the operation modes. For further proceeding the operation mode OP has to be active. If the drives are not displayed in the slaves list, refresh the web page.


PLC Engineering

tart PLC Engineering from ctrlX CORE Web UI.

Click with the right mouse button on the device tree entry “YourDeviceName (ctrlX CORE)” and “Enable Softmotion” in the popup menu. This will add the “Softmotion General Axis Pool” to the device tree.

Open the menu Project=>Project Settings=>Softmotion and check whether the Softmotion version is set correct.

Open the DataLayer_Realtime configuration by the right mouse click menu "Edit/Online from ctrlX CORE..." of the node.
The real-time data import dialog will open. Select the Source "ethercat_master_instances_ethercat", press the import button and close the dialog.


The following nodes will be added to your device tree:


For each drive you have to add a Softmotion EtherCAT SoE axis by opening the right mouse menu.


Rename both Softmotion axis to the name which you like to see in your PLC program (e.g. axis_1 and axis_2). You can do this via the Properties dialog which you reach via the right mouse menu of the axis nodes. Confirm that you want to adapt all references in the project.



For both IndraDrive Datalayer nodes you have to check the configuration the I/O mapping. You can do this by double-clicking on the IndraDrive real time data layer node and go then to the tab page DataLayerNode I/O Mapping. The mode should be “Always update variables” and “Use parent device setting” .


Additionally you have to check the setting of the bus cycle task. Double-click on the drive node. Go to the tab page “SM_Drive_EtherCAT_SoE_Standard: I/O Mapping” and set the Bus cycle task to “Use parent bus cycle setting”.


Your Main task shall be triggered by an external event which is synchronized with the EtherCAT communication. Open the Main Task property dialog by double-click and set the following properties:

  • Priority : 20
  • Type: External
  • External Event: TASK_EXTERNAL_EVENT_07
  • Enable watchdog
  • Set watchdog time to 2 msec


Configure ctrlX Scheduler

Until ctrlX 01V14 the event TASK_EXTERNAL_EVENT_07 for triggering the PLC Main task is created automatically by default.

Since ctrlX 01V16 the setup of the event is user-defined. Open the the dialog Settings->Scheduler in the ctrlX web UI and execute the following steps

  • Set the control state to Service by using the switch at the top of the page
  • Add a new callable to the task ctrXAutomation by clicking on the "+" symbol in the related line.


Make the follwing settings in the Add callable dialog

  • Set the type of the callable to plc-external-event.
  • Set the run index to 5000 (you should enter a run index which is higher than the run index of the EtherCAT master callable to ensure that the PLC task is executed after the EtherCAT communication).
  • Delete in the Arguments field all arguments other than TASK_EXTERNAL_EVENT_007 (you have to configure the same event as configured for the PLC task in PLC Engineering previously).


Write your PLC Motion Program

Now you can create your PLC motion program using the PLCopen motion function blocks.


The Company 

CODESYS, the leading manufacturer-independent IEC 61131-3 software, offers comprehensive solutions for device manufacturers, users and operators. Based on the CODESYS Development System and the associated runtime system CODESYS Control, Bosch Rexroth has been successfully offering CODESYS programmable controllers and the engineering tool “IndraWorks" since 2003.


Must Read