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:

SMC_XInterpolator.png

InOut:

Scope

Name

Type

Initial

Comment

Inout

X_Axis

AXIS_REF_SM3

X-axis, position of the workpiece

Input

bExecute

BOOL

FALSE

Starts on rising edge.

poqDataIn

POINTER TO SMC_OUTQUEUE

0

The input path queue

dLastWayPos

LREAL

0

This input enables the user to measure the path length which is covered by the interpolator. Output dWayPos is the sum of dLastWayPos and the distance covered within the current cycle. If you set dLastWayPos equal to output dWayPos, dWayPos always will be incremented by the current path section and you will get the total path length.

bAbort

BOOL

FALSE

This input set to TRUE the 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

0

Offset relative to the X-axis position

Output

bDone

BOOL

FALSE

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

FALSE

TRUE, while execution of function block is not finished

bError

BOOL

FALSE

Signals, that an error has occurred within the function block

wErrorID

SMC_ERROR

Error identification

piSetPosition

SMC_POSINFO

piSetPosition contains the cartesian coordinates of the set point as well as the position of the additional axes.

iStatus

SMC_INT_STATUS

The current status of the module.

  • IPO_UNKNOWN (0)

    Internal state, which may not occur after a

    complete run of SMC_Interpo­lator.

  • 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 TRUE as long as the processing of the path has been started, but not yet finished. Otherwise bWorking is FALSE.

iActObjectSourceNo

DINT

Contains entry iSourceLine_No of 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_Tangent will 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 DWORD contains the current switch status of all auxiliary marks between 1 and 32. Bit0 of the DWORD signifies auxiliary mark 1, Bit31 signifies auxiliary mark 32.

dWayPos

LREAL

See input dLastWayPos for a description.