SMC_XInterpolator (FB)¶
FUNCTION_BLOCK SMC_XInterpolator
SMC_XInterpolator realizes a mixture of CAM and CNC.
Imagine you want to cut a specified form (described by G-code) out
of a workpiece`. The workpiece is moved - by another process -
(e.g. along the X-axis) and the other axes (Y, Z, etc.)
should be controlled according to the current position of the
workpiece (X) and the target given by the path outline.
The motion of the workpiece always follows the X-direction (other cases can be mapped on this by a rotation).
Example
If the XInterpolator is active, it will search the position on the
path that matches the current x-position and it will copy the corresponding
path-point in piSetPosition. The input path must have a unique position
for each x-coordinate. For example, the following path is valid:
- InOut:
Scope
Name
Type
Initial
Comment
Inout
X_AxisAXIS_REF_SM3X-axis, position of the workpiece
Input
bExecuteBOOLFALSE
Starts on rising edge.
poqDataInPOINTER TO SMC_OUTQUEUE
0
The input path queue
dLastWayPosLREAL0
This input enables the user to measure the path length which is covered by the interpolator. Output
dWayPosis the sum ofdLastWayPosand the distance covered within the current cycle. If you setdLastWayPosequal to outputdWayPos,dWayPosalways will be incremented by the current path section and you will get the total path length.bAbortBOOLFALSE
This input set to
TRUEthe processing of an outline will be aborted.eDirectionMC_Directionpositive
This input determines, whether the workpiece is moved in positive (positive) or negative (negative) direction along the X-axis. Other values are not allowed.
dXOffsetLREAL0
Offset relative to the X-axis position
Output
bDoneBOOLFALSE
This variable is be set to
TRUE, after the input path has been processed completely. The function block will perform no further actions until a reset will be executed.bBusyBOOLFALSE
TRUE, while execution of function block is not finishedbErrorBOOLFALSE
Signals, that an error has occurred within the function block
wErrorIDSMC_ERRORError identification
piSetPositionpiSetPositioncontains the cartesian coordinates of the set point as well as the position of the additional axes.iStatusThe current status of the module.
IPO_UNKNOWN(0)Internal state, which may not occur after acomplete run of SMC_Interpolator.
IPO_ACCEL(2) : accelerating.IPO_CONSTANT(3) : running with constant velocity.IPO_DECEL(4) : brakingIPO_FINISHED(5) : Processing of is finished.
bWorkingBOOLThis output is set to
TRUEas long as the processing of the path has been started, but not yet finished. OtherwisebWorkingisFALSE.iActObjectSourceNoDINTContains entry
iSourceLine_Noof the active SMC_GEOINFO object of the input path. Set to “-1”, if not working (any longer) (bWorking = FALSE).dVelLREALThis variable contains the current path velocity.
vecActTangentSMC_VECTOR3DThe path tangent in point
piSetPosition. In case ofdVel = 0,vecAct_Tangentwill contain zeros only.iLastSwitchINTThis variable contains the number of the last auxiliary mark passed. If within one cycle multiple auxiliary marks shall be passed, always only the last one will be dumped.
dwSwitchesDWORDThis
DWORDcontains the current switch status of all auxiliary marks between 1 and 32. Bit0 of theDWORDsignifies auxiliary mark 1, Bit31 signifies auxiliary mark 32.dWayPosLREALSee input
dLastWayPosfor a description.
Structure: