Back to top

Sample KAS Fault Handling code and project has been created for KAS applications that utilize the AKD2G drive. Differences in parameter names and functionality between the AKD and AKD2G led to the new code being created.

The following shows parts of the project starter template (project .kas link below) in which the Program FaultMonitorAKD2G and Subprogram MCFB_AKD2G_Fault are included. The .kas project is for a Dual Axis AKD2G drive. This code can be modified for a single axis AKD2G drive by removing the parts that correspond to the second axis.

In past servo applications I have used the Servo designated forward and reverse travel limit switch configuration to stop any motor jog movement that exceeds a safe position.  I'm configuring my PDMM limit switch set up and have observed that if I trigger a limit switch, then jog in the direction the limit switch has been configured to stop the drive responds correctly and prevents further movement in that direction.

The KAS IDE help has an extensive section on EtherCAT error handling. 

Method 1: Add CPS.Control Object 3000 to the PDO mappings



Then map the Object to a Dictionary variable in the project. Example below shows mapping  CPS.Controls to a PLC variable named CPSControl


  1. The attached kUDFB named MLFB_AKDFAULT_5 will report up to 5 errors when called with an AKD servo axis using PipeNetwork Motion.

The following code shows calling the kUDFB then reading the  present drive faults of 2 different AKD drives:

The outputs to a function block call can also be looked at in the IDE watch window:




When debugging a program in KAS, you may run into a situation where there is a division by zero. These errors can be challenging to locate. The solution is to have an exception routine for this condition. Adding a breakpoint in your exception handler will show you the location of the division in the program source code.

Valid for S300, S400, S600, S700

Display Meaning Possible causes  Measures S300/S700 Measures S400/S600


Valid for S300, S400, S600, S700

Display Meaning Possible cause Measure S300/S700 Measure S400/S600


Valid for S300, S400, S600, S700

Valid for S300, S400, S600, S700