MC_CamIn

PLCopen motion icon

 Function Block - Performs a slave axis move which follows the master axis based on the Cam Table specified by CamTableID.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

On the rising edge, request to queue the move.

Master

AXIS_REF

1 to 256

N/A

No default

Name of a declared instance of the AXIS_REF library function.

Slave

AXIS_REF

1 to 256

N/A

No default

AXIS_REF.AXIS_NUM is the slave axis number.

See AXIS_REF Structure.

MasterOffset

LREAL

No range

User units

No default

Master axis offset.

This input is not used if the StartMode input is set to 1 for Resume Mode.

SlaveOffset

LREAL

No range

User units

No default

Slave axis offset.

This input is not used if the StartMode input is set to 1 for Resume Mode.

MasterScaling

LREAL

No range

User units

No default

Master axis scale factor.

  • This input is not used if the StartMode input is set to 1 for Resume Mode.
  • Scaling must be a positive value greater than 0 (zero).

SlaveScaling

LREAL

No range

User units

No default

Slave axis scale factor.

  • This input is not used if the StartMode input is set to 1 for Resume Mode.
  • Scaling must be a positive value greater than 0 (zero).

StartMode

INT

0 to 1

N/A

No default

Starting mode of the cam profile.

The function block uses values that were in effect during the most recently programmed MC_CamIn move for the slave axis.

0 = Start Mode

  • Input indicates if the axis should start a MC_CamIn move as an initial cam start.

1 = Resume Mode

  • Input indicates if the axis should resume the most recently programmed MC_CamIn move.
  • The inputs MasterOffset, SlaveOffset, MasterScaling, and SlaveScaling are not used.

CamTableID

INT

No range

N/A

No default

Profile ID number.

BufferMode

SINT

N/A

No default

The Buffer mode for CamIn block.

  • MC_BUFFER_MODE_ABORT is used to abort an existing camming, gearing, point-to-point, or velocities move.
  • MC_BUFFER_MODE_BUFFERED is only used when an endpoint is specified with the previous move.
  • See Buffer Modes for more information.

Outputs

Output

Data Type

Range

Unit

Description

InSync

BOOL

FALSE, TRUE

N/A

Indicates the slave axis is in sync with the profile.

Busy

BOOL

FALSE, TRUE

N/A

Indicates this function block is executing.

Active

BOOL

FALSE, TRUE

N/A

Indicates this move is the Active move.

CommandAborted

BOOL

FALSE, TRUE

N/A

Indicates the move was aborted.

Error

BOOL

FALSE, TRUE

N/A

Indicates either:

  • An invalid input was specified.
  • The move was terminated due to an error.

ErrorID

INT

No range

N/A

Indicates the error if the Error output is high.

See PLCopen Function Block ErrorIDs.

EndOfProfile

BOOL

FALSE, TRUE

N/A

Indicates the end of profile has been reached.

  • If the profile is periodic, this output is set to ON for one ladder scan.
  • If the profile is not periodic, the output remains ON while outside the range of the profile.
  • See Periodic or Not Periodic for more information.

Remarks

  • This function block is used to either:
    • Initiate a new MC_CamIn move.
    • Resume a previously programmed MC_CamIn move.
  • See MC_CamStartPos or MC_CamResumePos for more information about positioning the slave axis prior to calling MC_CamIn.
  • See Function Blocks - General Rules about how inputs and outputs work.

Abort Camming

There are two options to stop camming after MC_CamIn has been called:

  • MC_CamOut continues motion at the instantaneous final actual velocity of the slave axis when it is called.
    • Axis motion continues at that final actual velocity.
  • MC_Halt (with buffer mode input = 0) decelerates axis motion to 0 (zero) speed and stop motion.
  • The master / slave relationship between the two axes is ended when MC_CamOut or MC_Halt is called.

Figure 1: MC_CamIn

Usage

The slave axis immediately locks on to the Cam Table profile.

  • The Master Offset is used to shift the profile along the master axis.
  • The Master Scaling defines the range of the profile along the master axis.
  • The Slave Offset is used to shift the profile along the Slave axis.
  • The Slave Scaling defines the range of the profile along the slave axis.

Periodic or Not Periodic

  • If the profile is periodic, when the end of profile is reached, the profile continues at the start of the profile.
    • The EndOfProfile output is ON for 1 ladder scan.
  • If the profile is not periodic, when the end of profile is reached, the slave axis stops and remains at the end of the profile until the master axis returns to within the profile range as defined by MasterScaling.
    • The EndOfProfile output remains ON anytime the master axis is outside of the profile range.

Adjustments Computation is Done

When cam is first started, offsets are adjusted if necessary.

  • If the master is not absolute, then master offset = master offset + starting position.
  • If the slave is not absolute, then slave offset = slave offset + starting position.

At run-time:

  • Master position for profile = master position - master offset.
    • Use master position for profile table to obtain slave profile position.
  • Slave commanded position = slave profile position + slave offset.

Dynamically Change a Cam Profile

MC_CamIn can be used to dynamically change from one cam profile to another.

Care must be taken when doing this to avoid unexpected motion.


  • Tips to dynamically change cam profiles:

    • Verify the first cam’s last position and the replacement cam’s first position are the same.
    • Verify the first cam’s last velocity and the replacement cam’s first velocity do not cause any unexpected motion.
    • Jumps can be eliminated by defining the present cam as Cyclic and defining the replacement cam as an Absolute Master and Slave, as set by the MC_CamTblSelect inputs.
      • This eliminates any possible small error accumulating when the cam is switched.

Examples

These examples use the MC_CamIn Example image showing the cam profile MyProfile:

Example 1

Example 2

Example 3

Figure 2: MC_CamIn Example

Example 1

Example 2

Example 3

FBD Language Example

Not available.

FFLD Language Example

IL Language Example

Not available.

ST Language Example

(* MC_CamIn ST example *)  //Inst_MC_CamIn is an instance of MC_CamIn
Inst_MC_CamIn( CamStartBool, Axis1, Axis2, 0.0, 0.0, 360.0, 360.0, 0, CamTableID, 0 );

See Also