FUNCTION_BLOCK FINAL SMC_Interpolator2Dir
This function block is similar to function block SMC_Interpolator , regarding function and allocation of inputs and outputs, but it is able to interpolate a path also in the opposite direction.
Reverse interpolation:
If dOverride has a negative value, SMC_Interpolator2Dir interpolates in the opposize direction. For example, if this input is assigned to an analog velocity input of a hand wheel, you can move forward and backward with the desired velocity.
The use of the function block depends on the following preconditions:
If input bStartAtEnd is TRUE, the path has to be stored
completely in structure poqDataIn.
If the path does not fit completely, you can define how many elements
of the queue are reserved for moving backward. (SMC_QueueSetReservedEntries)
For example, if you want to move 10 elements backwards, you must reserve
13 (10 + 3) elements (three elements are reserved as a safety buffer).
The queue needs to be large enough, because the reserved
elements are no longer available for the look ahead.
The use of SMC_Interpolator2Dir requires the additional call
of SMC_Interpolator2Dir_SlowTask in a task with lower priority.
InOut:
Scope |
Name |
Type |
Initial |
Comment |
Input |
bExecute |
BOOL |
FALSE |
|
poqDataIn |
POINTER TO SMC_OUTQUEUE |
0 |
||
bSlow_Stop |
BOOL |
FALSE |
||
bEmergency_Stop |
BOOL |
FALSE |
||
bWaitAtNextStop |
BOOL |
FALSE |
||
dOverride |
LREAL |
1 |
||
iVelMode |
TRAPEZOID |
|||
dwIpoTime |
DWORD |
0 |
||
dLastWayPos |
LREAL |
0 |
||
bAbort |
BOOL |
FALSE |
||
bSingleStep |
BOOL |
FALSE |
||
bAcknM |
BOOL |
FALSE |
||
bQuick_Stop |
BOOL |
FALSE |
||
dQuickDeceleration |
LREAL |
0 |
||
dJerkMax |
LREAL |
The magnitude of the maximum allowed jerk, only used for quadratic velocity mode, in which case it must be positive. Cannot change while the interpolator is running. |
||
dQuickStopJerk |
LREAL |
The magnitude of the jerk used for a quick stop if the quadratic velocity mode is used. (The maximum of this value and dJerkMax is used) |
||
bStartAtEnd |
BOOL |
|||
bSuppressSystemMFunctions |
BOOL |
If this option is set, then the output wM will not be set for internal M-functions created by G75 or G4 commands. |
||
Output |
bEndOfPath |
BOOL |
FALSE |
|
bBusy |
BOOL |
FALSE |
||
bError |
BOOL |
FALSE |
||
wErrorID |
SMC_ERROR |
SMC_NO_ERROR |
||
piSetPosition |
||||
iStatus |
IPO_INIT |
|||
bWorking |
BOOL |
FALSE |
||
iActObjectSourceNo |
DINT |
-1 |
||
dVel |
LREAL |
0 |
||
vecActTangent |
SMC_VECTOR3D |
|||
iLastSwitch |
INT |
0 |
||
dwSwitches |
DWORD |
0 |
||
dWayPos |
LREAL |
|||
nDirection |
||||
wM |
WORD |