Tasks of the mapping functions
Code generation places the mapping to the interfaces in the free-wheeling task because in most cases, the user program is also processed within the free-wheeling task (e.g. in the User_PRG.MAIN action). Keep in mind that for cyclical tasks (e.g. in profile generation) all information written from the free-wheeling task to the interfaces (e.g. Interface_AuxiliaryAxis) is processed asynchronously and, as a result, in a potentially inconsistent manner.
In certain cases, however, it may be important to control the system synchronously to the cyclical task from the user program (e.g. during an on-the-fly changeover). The corresponding control actions of the user program must then be processed in the cyclical task (e.g. in the User_PRG.HIGHPRIO action). Furthermore, the mapping functions of the status signals or control signals processed within the cyclical task must also be called from within the cyclical task, i.e. the corresponding calls must be shifted from the SEW_PRG.MAIN action to the SEW_PRG.HIGHPRIO action.