Integrating the axis driver template

The template is integrated using a CODESYS script. The script is installed with the axis driver template. To integrate the template, proceed as follows:

  1. Open the context menu of the "Application" object in the device tree.
  2. Select the menu item [Scripting] > [Scripts] > [T] > [Template_PLCopen_AxisDriver.py].
    • If there is no axis driver template in the project yet (no folder with the name "AxisDriver"), then the latest version installed on the computer is imported when the script is started.
    • The "Axis driver template" dialog is displayed. The dialog lists all logical devices that can be used with the axis driver template.
  3. Select the appropriate axis driver type for the axes. The following axis drivers are available in the template:

Axis driver type

Description

AxisDriverBasic

Basic functions of an axis, such as enable axis and acknowledge fault as well as the output of actual values such as ActualVelocity, ActualPosition, etc. This axis driver type does not contain any motion commands. Use this axis driver type if you want to execute the motion commands in the program directly via PLCopen function blocks.

AxisDriverPositioning

In addition to AxisDriverBasic, this axis driver type includes operating modes for jogging, speed control, referencing, and positioning.

AxisDriverGearing

In addition to AxisDriverPositioning, this axis driver type contains the operating modes for synchronous operation.

AxisDriverCamming

In addition to AxisDriverGearing, this axis driver type contains the operating modes for the cams.

  1. Click [Create axis driver instances].

 

The following actions are performed by the script:

  • A folder with the name "AxisDriver interfaces" is created.
  • In this folder, a program named "PRG_AxisDriver" is created by creating an instance of the selected axis driver and a block call with the respective name of the logical device for each logical device.
  • A global variable list with the name "GVL_AxisDriver" is created. An ARRAY of the type ST_AxisInterface is created here. The size of the array corresponds to the number of instances of axis drivers.
  • The created "PRG_AxisDriver" program is added to the TaskHighPrio.

 

  1. If you use the axis driver "AxisDriverGearing" or "AxisDriverCamming", you must still enter the corresponding master axis (name of the logical device of the master axis) in the "PRG_AxisDriver".
    • The axis driver template is now ready to run.