This function block allows you to control an axis by a custom algorithm that calculates cyclic set position, velocity, and acceleration of the axis.
The function block created by you in order to program a motion profile has to extend FB_CustomJobBase of the MotionInterface library. Then the function block is provided at the input CustomJob.
Input |
Data type |
Description |
---|---|---|
Master |
Axis_Ref |
Reference to the axis for which the function block is to be executed. Can be left unassigned if the custom job (provided at input CustomJob) does not use a master axis. If an axis is assigned, the callback to the user function block to define the motion profile gets the movement values of the master axis. Otherwise, the movement values of the master axis are given as zero. |
Axis |
Axis_Ref |
Reference to the axis for which the function block is to be executed. |
Execute |
BOOL |
Value range: FALSE, TRUE. Default value: FALSE. A rising edge of the input Execute starts the function block. The function block continues execution and the output Busy is set to TRUE. This function block can be restarted while it is executed. The target values are overwritten by the new values at the point in time the rising edge occurs. |
BufferMode |
The target values (position, velocity, acceleration) of the axis are overwritten by the new values in the motion task cycle when the function block gets active on the axis. Default value: Aborting Buffer mode. Possible values:
See MC_Buffer_Mode for a description of the values. |
|
OperationMode |
Operating mode for function block Default value: Position |
|
CustomJob |
MOIN.FB_CustomJobBase |
An instance of a user-created function block type which must be derived from FB_CustomJobBase. The function block instance can be parameterized with additional parameters (for example,. target position, velocity, acceleration, jerk, etc.) according to the requirements of the algorithm used by the custom job. Override the following methods:
Do not override the other methods of this function block. |
Output |
Data type |
Description |
---|---|---|
InSteadyState |
BOOL |
Value range: FALSE, TRUE. Default value: FALSE, as reported by the custom job
|
Busy |
BOOL |
Value range: FALSE, TRUE. Default value: FALSE, as reported by the custom job
|
Active |
BOOL |
Value range: FALSE, TRUE. Default value: FALSE.
|
CommandAborted |
BOOL |
Value range: FALSE, TRUE. Default value: FALSE.
|
Error |
BOOL |
Value range: FALSE, TRUE. Default value: FALSE.
|
ErrorID |
This enumeration provides diagnostics information. |
If you use the function block MC_SetPosition with a function block MC_CustomJob, this can result in position jumps if you do not consider the offset position in your position calculation.
WARNING | |
---|---|
To avoid any potential position jumps, base the calculation of the axis position for the next cycle on the last physical position (as per Axis.lrPosition) of the axis, or otherwise verify that the offset position is correctly considered in your position calculation.
If you use the function block MC_CustomJob with a modulo axis, the position generated via the method CalculateMovement is modulo-corrected if a modulo overflow occurs. This correction is based on saving the modulo offset in MC_CustomJob. This implies that if the calculation is based on the last reference position (as per Axis.lrPosition), the position for the next cycle drifts by the magnitude of the modulo jump.
WARNING | |
---|---|
If an axis is provided for the input Master, the new target values or reference values for the master axis for the running real-time cycle are calculated before MC_CustomJob is triggered. Therefore, the custom job implementation gets up-to-date (newly calculated from the real-time cycle) values from the master axis when it is called to calculate its values for the subordinate axis.
If the operating mode is set to Velocity via the input OperationMode and if the drive is not able to operate in the operating mode Cyclic Synchronous Velocity, the function block MC_CustomJob detects an error. The axis is not affected.