SMC_InPosition (FB)¶
FUNCTION_BLOCK SMC_InPosition
This function block monitors the offset between the nominal and actual positions of an axis (drag error). This tests whether the drag error lies within a specified value range for over a defined period of time (position window).
When using logical axes, it is possible with the function block to compare a real and a logical axis.
This tests whether the logical axis, which is the mapping of a real axis compensated by communication time,
is close to the values of the real axis. Instead of the deviation between the nominal and actual positions,
the deviation of the actual position of the logical axis is used as the nominal position of the real axis.
The function block SMC_InPosition
can be used for this test under the following conditions:
The motion type must be identical (limited/modulo).
In the case of “modulo”, the position period must be the same.
Identical offsets must be defined (e.g., set by
MC_SetPosition
).
If these conditions are not satisfied, then the compared positions will probably never match and therefore there is no point in using the FB. In this case, an error is not issued.
- InOut:
Scope
Name
Type
Comment
Inout
Axis
Input
bEnable
BOOL
TRUE
: Starts execution of the function block.fPosWindow
LREAL
The drive is inside the position window, if fPosWindow >= Distance(actual position, set position) [u].
fPosTime
LREAL
Time that the FB has to stay inside the position window before
bInPosition
is set [s].fTimeOut
LREAL
If the time since enabling the FB is larger than this value and
bInPosition
is not set,bTimeOut
is set; this mechanism is deactivated, iffTimeOut
= 0.Output
bInPosition
BOOL
TRUE
: Parameter is available.bBusy
BOOL
TRUE
: Execution of the function block is not finished yet.bTimeOut
BOOL
TRUE
: Error has occurred within the function block.