MC_SEW_ConfigSplineInterpolation

With this function block, the user configures a specific segment within a cam profile so that a spline interpolation of a curve point table takes place there. The cam profile is given by CamTableID (an object of type CamDescription) and the number of the segment within the cam profile is given by uiSegmentNr. In addition, a reference to a curve point table (an object of type ST_PointsListSpline) must be transferred to rstPointsListSpline.

The function block should not be called in the task in which the setpoint generation takes place (usually TaskHighPrio). It is recommended for the function block to be called either in a free-running task or a cyclical task with a priority that is lower than the priority of the TaskHighPrio.

VAR_INPUT

Variable name

Data type

Description

Execute

BOOL

Start execution of the function block.

rstPointsListSpline

REFERENCE TO ST_PointsListSpline

Reference to a structure of type ST_PointsListSpline, which contains the points to be interpolated.

CamTableID

MC_CAM_ID

Object of type CamDescription

uiSegmentNo

UINT

Number of the cam segment in which the linear interpolation is to be configured.

eSplineMode

E_SplineMode

Select behavior at the margins:

  • Natural
  • SubSpline
  • NotAKnot
  • FirstDeriv
  • SecondDeriv
  • ThirdDeriv
  • Periodic
  • Combination

stVyMargin

ST_Margin

Margins of the 1st derivative

stAyMargin

ST_Margin

Margins of the 2nd derivative

xUseVAMargin

BOOL

Use margins of the 1st and 2nd derivative.

uiTimeMaxUs

UINT

Maximum processing time of the function block in µs per PLC cycle

The configuration of a spline interpolation is computationally intensive and can lead to a significant increase in the cycle time. Consequently, the user can use the uiTimeMaxUs parameter to specify the time in µs by which the call of the function block may extend the cycle time of the relevant task.

VAR_OUTPUT

Variable name

Data type

Description

Done

BOOL

The configuration was successful.

Busy

BOOL

The configuration is being carried out.

Error

BOOL

An error has occurred in the function block

ErrorID

MC_ErrorId

Error number