MC_CamIn

MC_CamIn 1:

The function block MC_CamIn activates master-slave coupling with a certain cam plate. In addition it is possible to switch to a new cam plate in coupled state. The switching rules, in particular the time or position, can be specified.

The status flag Axis.Status.CamTableQueued can be used to check whether a cam plate is queued for switchover.

Important :

Further information on coupling with cam plates

ActivationMode (coupling or switching of cam plates)

StartMode

ScalingMode

Inputs

VAR_INPUT 
    Execute :     BOOL;
    MasterOffset : LREAL;
    SlaveOffset : LREAL;
    MasterScaling : LREAL := 1.0;
    SlaveScaling : LREAL := 1.0;
    StartMode : MC_StartMode;
    CamTableID : MC_CAM_ID;
    BufferMode : MC_BufferMode;
    Options : ST_CamInOptions;
END_VAR

Execute

The command is executed with a rising edge at input Execute

MasterOffset

Offset to the master position of the cam plate

SlaveOffset

Offset to the slave position of the cam plate

MasterScaling

Scaling of the master position of the cam plate

SlaveScaling

Scaling of the slaveposition of the cam plate

StartMode

StartMode determines whether the cam plate position is interpreted absolute or relative to the coupling position.
StartMode can be relative or absolute for master (X coordinate) and slave (Y coordinate).

CamTableID

ID of the cam plate used for coupling

BufferMode

currently not implemented

Options

 

Data structure with further coupling and switching options:

ActivationMode

ActivationMode specifies the switching time or position at which cam plate coupling or switchover takes place.
ActivationMode can also be specified when a slave is coupled for the first time.

ActivationPosition

Optional master position at which a cam plate is switched, depending on the ActivationMode.
(not required for first coupling.)
If ActivationMode MC_CAMACTIVATION_ATMASTERCAMPOS is used, the position refers to the non-scaled cam plate. If the position in the application refers to the scaled cam plate, it can be divided by the MasterScaling before the function block is called.

MasterScalingMode :

Optional Scaling mode for the master position of the cam plate

SlaveScalingMode

Optional Scaling mode for the Slave position of the cam plate

InterpolationType

Interpolation type for position tables. Not required for motion functions.

Outputs


VAR_OUTPUT
   InSync           : BOOL;
   Busy             : BOOL;
   Active           : BOOL;
   CommandAborted   : BOOL;
   Error            : BOOL;
   ErrorID          : UDINT;
END_VAR

InSync

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

Busy

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

Active

Active indicates that the command is executed. For cam plate switching Active becomes TRUE, if the coupling command was executed successfully but the cam plate is still queued. If the cam plate is activated depending on the ActivationMode, Active becomes FALSE and InSync is set.

CommandAborted

Becomes TRUE, if the command could not be fully executed. The axis may have become decoupled during the coupling process (simultaneous command execution).

Error

Becomes TRUE, as soon as an error occurs.

ErrorID

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

Inputs/outputs


VAR_IN_OUT
    Master : AXIS_REF;
    Slave : AXIS_REF;
END_VAR

Master

Master axis data structure.

Slave

Slave axis data structure.

The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.