IF_CamReferenceGenerator - Calculate (Method)

Overview

Type:

Method

Available as of:

V1.0.0.0

Versions:

Current version

Task

Calculation of reference values of externally defined cam jobs

Description

This method is called up in the real-time cycle of the SoMotionGenerator. The position of the master object is transferred to the method via input i_lrX.

From this master position, the external cam function block has to calculate a slave position and make it available at output q_lrY.

Optionally, the first and second derivative of the external cam can be given out at the outputs q_lrM and q_lrK. These are required by the function FC_CamCompute() in order to deliver complete results.

By setting the output q_xReady, the SoMotionGenerator can be informed that the cam job has been completed and the next job in the queue can be activated. This cancel criterion is combined with the cancel criterion OR selected via the parameter ST_Cam.etMode. Thus, the default cancel criterions are also made available for external cams.

By means of the return value of the method, the SoMotionGenerator can be notified about any errors that may have occurred. If this is the case, these are made available by means of the parameter etCurentJobResult of the structure ST_RealtimeChannel.

Interface

Input

Data type

Description

i_xFirstCall

BOOL

Bit which is = TRUE for the first call-up of the cam job and = FALSE for all further cam jobs. Can be used for precalculations.

i_lrX

LREAL

Logical master position. Is made available by the SoMotionGenerator.

Unit: length units

Output

Data type

Description

q_etDiag

GD.ET_Diag

General, library-independent statement on the diagnostic.

A value unequal GD.ET_Diag.Ok equates an error message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = GD.ET_Diag.Ok -> Status message

q_etDiag <> GD.ET_Diag.Ok -> Error message

q_lrY

LREAL

Calculated slave position.

Unit: length units

q_lrM

LREAL

First derivative of the slave position. This output is optional.

q_lrK

LREAL

Second derivative of the slave position. This output is optional.

q_xReady

BOOL

TRUE := Job processing is finished.

FALSE := Job processing is still active.