MC_ReadCamTableMasterPosition

MC_ReadCamTableMasterPosition 1:

The function block MC_ReadCamTableMasterPosition can be used to calculate the master position for a given slave position. While the slave position for a given master position must be unique, the inverse is not true. In order to limit the number of master output options for the function block, for a given master position (MasterStartPosition) the smaller (MasterLow) and larger master position (MasterHigh) for the slave value is output.

For example, for the cam plate in Fig. 1, for a slave value of 80 and a master start value of 180, the output values are 225 for MasterHigh and 135 for MasterLow. If the cam plate is cyclic, for a master start value of 90 in addition to the MasterHigh of 135 a MasterLow of -135 is calculated. In the linear cam plate case (non-cyclic) only the value MasterHigh is shown as valid in figure 2.

MC_ReadCamTableMasterPosition 2:

Fig. 1

In cyclic cam plates with hub the master position can not only lie in one of the cycles adjacent to the StartMasterpos, but several cycles further, depending on the slave position.

MC_ReadCamTableMasterPosition 3:

Fig. 2

The master position is calculated with numeric algorithms, whose accuracy can be set via the variable MasterAccuracy.

MC_ReadCamTableMasterPosition 4: Inputs

VAR_INPUT
   Execute             : BOOL;
   CamTableID          : MC_CAM_ID;
   SlavePosition       : LREAL; (* absolute slave axis position *)
   MasterOffset        : LREAL; (* E *)
   SlaveOffset         : LREAL; (* E *)
   MasterScaling       : LREAL := 1.0; (* E *)
   SlaveScaling        : LREAL := 1.0; (* E *)
   MasterStartPosition : LREAL; (* Master position to start the iteration from *)
   MasterAccuracy      : LREAL; (* Master iteration accuracy *)
END_VAR

Name

Type

Description

Execute

BOOL

The command is executed with a rising edge at Execute input.

CamTableId

MC_CAM_ID

Table ID

SlavePosition

LREAL

The slave position for which the master position is sought.

MasterOffset

LREAL

Offset to the master position of the cam plate

SlaveOffset

LREAL

Offset to the slave position of the cam plate

MasterScaling

LREAL

Scaling of the master position of the cam plate

SlaveScaling

LREAL

Scaling of the slave position of the cam plate

MasterStartPosition

LREAL

Start position of the master

MasterAccuracy

LREAL

Accuracy for the calculation

MC_ReadCamTableMasterPosition 5: Outputs

VAR_OUTPUT
   Execute    : BOOL;
   Done       : BOOL;
   Busy       : BOOL;
   Active     : BOOL;
   Error      : BOOL;
   ErrorID    : UDINT;
   MasterLow  : ST_CamMasterData; (* position information of the lower bound master position *)
   MasterHigh : ST_CamMasterData; (* position information of the upper bound master position *)
END_VAR

Name

Type

Description

Done

BOOL

Becomes TRUE, if the coupling was successful and the cam plate is active.

Busy

BOOL

The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the command is processed. If Busy becomes FALSE again, the function block is ready for a new order. At the same time one of the outputs, Done or Error, is set.

Error

BOOL

Becomes TRUE, as soon as an error occurs.

ErrorID

UDINT

If the error output is set, this parameter supplies the error number.

MasterLow

ST_CamMasterData

Master position is smaller than the MasterStartPosition in the data structure ST_CamMasterData

MasterHigh

ST_CamMasterData

Master position is greater than the MasterStartPosition in the data structure ST_CamMasterData