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_Axis- AXIS_REF_SM3- X-axis, position of the workpiece - Input - bExecute- BOOL- Starts on rising edge. - poqDataIn- POINTER TO SMC_OUTQUEUE - The input path queue - dLastWayPos- LREAL- This input enables the user to measure the path length which is covered by the interpolator. Output - dWayPosis the sum of- dLastWayPosand the distance covered within the current cycle. If you set- dLastWayPosequal to output- dWayPos,- dWayPosalways will be incremented by the current path section and you will get the total path length.- bAbort- BOOL- This input set to - TRUEthe processing of an outline will be aborted.- eDirection- MC_Direction- positive - This input determines, whether the workpiece is moved in positive (positive) or negative (negative) direction along the X-axis. Other values are not allowed. - dXOffset- LREAL- Offset relative to the X-axis position - Output - bDone- BOOL- 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.- bBusy- BOOL- TRUE, while execution of function block is not finished- bError- BOOL- Signals, that an error has occurred within the function block - wErrorID- SMC_ERROR- Error identification - piSetPosition- piSetPositioncontains the cartesian coordinates of the set point as well as the position of the additional axes.- iStatus- The current status of the module. - IPO_UNKNOWN(0)Internal state, which may not occur after a
- complete run of SMC_Interpolator. 
 
- IPO_ACCEL(2) : accelerating.
- IPO_CONSTANT(3) : running with constant velocity.
- IPO_DECEL(4) : braking
- IPO_FINISHED(5) : Processing of is finished.
 - bWorking- BOOL- This output is set to - TRUEas long as the processing of the path has been started, but not yet finished. Otherwise- bWorkingis- FALSE.- iActObjectSourceNo- DINT- Contains entry - iSourceLine_Noof the active SMC_GEOINFO object of the input path. Set to “-1”, if not working (any longer) (- bWorking = FALSE).- dVel- LREAL- This variable contains the current path velocity. - vecActTangent- SMC_VECTOR3D- The path tangent in point - piSetPosition. In case of- dVel = 0,- vecAct_Tangentwill contain zeros only.- iLastSwitch- INT- This 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. - dwSwitches- DWORD- This - DWORDcontains the current switch status of all auxiliary marks between 1 and 32. Bit0 of the- DWORDsignifies auxiliary mark 1, Bit31 signifies auxiliary mark 32.- dWayPos- LREAL- See input - dLastWayPosfor a description.
Structure: