MC_CamIn (FB)¶
FUNCTION_BLOCK MC_CamIn
Executes a given cam table.
Note
MC_CamIn should be called after the motion FB controlling
the Master axis has been called.  Otherwise, the Slave axis
will lag behind the Master axis.
- InOut:
- Scope - Name - Type - Initial - Comment - Inout - Master- Reference to master axis. Master need not be stationary. - Slave- Reference to slave axis - Input - Execute- BOOL- Rising edge: Starts the execution of the function block. - MasterOffset- LREAL- Offset on master table in master cam table units. - SlaveOffset- LREAL- Offset on slave table in slave axis units. - Mechanical analogy to the slave offset is a cam plate, which is welded with additional constant layer thickness. Therefore slave positions have a constant offset. The offset can be interpreted as an axis offset of the master axis on the assumption that the slave cam is linearly guided. - MasterScaling- LREAL- 1 - Scaling factor for master profile. Must not be 0. - SlaveScaling- LREAL- 1 - Scaling factor for slave profile. Must not be 0. - MasterStartDistance- LREAL- The master distance (in master cam table units) from the - MasterSyncPositionwhere the slave axis starts synchronization. Only used in- StartModeramp_in_dist.- If - MasterStartDistanceis 0 (or negative), then the slave movement is started immediately, provided that the master is not in standstill. If BufferMode <> Aborting, then the MasterStartDistance must be 0 (or negative).- MasterSyncPosition- LREAL- The master position in the cam table where the slave axis has to be synchronized to the master. Must be a valid position in the cam table, otherwise the error SMC_CI_MASTER_SYNC_POSITION_OUT_OF_SCALE will be reported. Only used in - StartModeramp_in_dist.- AvoidReversal- BOOL- FALSE: Signals that the reversal of the slave is physically possible and acceptable.- TRUE: Signals that a reversal of the modulo slave has to be avoided, e.g. because it is physically impossible or might lead to damage.It works only with modulo slave axes.If a reversal cannot be avoided, the axis is stopped with an error.Only used in- StartModeramp_in_dist.- Behavior: - If the slave axis is a modulo axis and the master velocity (times the slope of the cam table at theMasterSyncPosition) is not oppositeto the slave velocity, thenMC_CamIntries to avoid a reversal of the slave.It tries to “stretch” the slave movement by increasing the distance the slave travels by up to 5 slave periods.If this “stretching” is not successful, i.e. does not avoid a reversal, an error is reported.
- If the slave velocity is opposite to the master velocity times the slope of the cam table at theMasterSyncPosition,an error is reported.
- If the slave axis is not a modulo axis, an error is reported on the rising edge of the Execute input. 
 - StartMode- absolute - Start mode - Possible values: - absolute, relative: The - Slavewill immediately be- InSyncand follow the trajectory defined by cam table and- Master. Depending on the current state of the- Slave, this can lead to a jump in position, velocity, and/or acceleration. If the StartMode is absolute, the value of- SlaveAbsoluteset by MC_CamTableSelect will be used. If the StartMode is relative, relative coordinates will be used for the slave position, effectively overwriting of the value of- SlaveAbsolute.
- ramp_in, ramp_in_pos, ramp_in_neg: The - Slavewill synchronize to the cam as fast as possible using the configured- VelocityDiff,- Acceleration,- Deceleration, and- Jerk. If the- Slaveis a modulo axis, ramp_in_pos and ramp_in_neg define the direction for ramping in. For a finite- Slave, all three StartModes behave the same.
- ramp_in_dist: The - Slavewill synchronize to the cam so that it follows the trajectory defined by cam table and- Masteras soon as the- Masterreaches the- MasterSyncPosition. Synchronization will start when the- Masteris within the- MasterStartDistanceof the- MasterSyncPosition.
 - Please note that the ramping-in StartModes only have an effect on a rising edge of input Execute. If the cam table is changed by modifying input - CamTableID, no ramping-in is performed.- CamTableID- Identification of the cam table. The input is connected with the output of MC_CamTableSelect. - While camming is active, this input can be used to change cam tables on the fly without a new rising edge on - Execute. Compared to restarting camming with a rising edge on- Execute, there are a few differences:- If ramping with - StartModeramp_in, ramp_in_pos, or ramp_in_neg is active, it is not aborted.
- Even if the - StartModeis ramp_in, ramp_in_pos, or ramp_in_neg, no new ramping in is initiated.
- If - EndOfProfilehas been set in the same cycle, the new cam table is automatically offset so that no gap occurs between the two tables.
 - Please note that when using distance based ramping in ( - StartModeramp_in_dist), the error- SMC_CI_CAM_CHANGED_DURING_RAMP_IN_DISTis returned if the- CamTableIDchanges while ramping in is still active.- BufferMode- MC_BUFFER_MODE- Defines the chronological sequence of the FB relative to the previous block. Only the BufferModes - Aborting,- Bufferedand- BlendingPreviousare supported.- BlendingPreviousmeans that the configured velocity (including the direction) of the previous movement is used as the blending velocity, even if this movement has the opposite direction. If the function block is Busy, then only BufferMode=Aborting is allowed.- VelocityDiff- LREAL- Maximum velocity difference in u/s for ``StartMode``s ramp_in, ramp_in_pos, and ramp_in_neg. - Acceleration- LREAL- Acceleration in u/s² for ``StartMode``s ramp_in, ramp_in_pos, and ramp_in_neg. - Deceleration- LREAL- Deceleration in u/s² for ``StartMode``s ramp_in, ramp_in_pos, and ramp_in_neg. - Jerk- LREAL- Jerk in u/s³ for ``StartMode``s ramp_in, ramp_in_pos, and ramp_in_neg. - TappetHysteresis- LREAL- Size of the hysteresis for tappets in u. A positive value means that the tappet cannot fire immediately after it has fired. The master position first needs to move away from the tappet by more than the value given for - TappetHysteresis.- For example, if the master is an encoder, the master position may oscillate by a few increments around the tappet position. Without a hysteresis, the tappet may fire all the time. - Output - InSync- BOOL- Indicates that the - Slavefollows the cam profile.- Busy- BOOL- Execution of the function block has not finished. - Active- BOOL- Indicates that the FB has control on the axis - CommandAborted- BOOL- Command has been aborted by another command - Error- BOOL- Signals that an error has occured within the function block. - ErrorID- SMC_ERROR- Error identification - EndOfProfile- BOOL- Indicates that the - Masterhas reached a border of the cam table. (This can be either the start or the end of the cam table, depending on the- Masterdirection.)- For periodic cams, the output is set for one cycle for each new period. - For non-periodic cams, the output stays TRUE while the - Masteris outside the cam range. The- Slavewill remain in synchronized_motion. If the- Slaveis not in standstill when- EndOfProfileis reached, another movement must be commanded that takes control of the- Slave. MC_CamIn does not stop the- Slaveon- EndOfProfile.- A buffered movement that has been commanded after this movement is started as soon as - EndOfProfileis set. This behavior is the same for periodic and non-periodic cams.- Note: With - StartModeramp_in, ramp_in_pos, or ramp_in_neg and depending on the configured- VelocityDiff,- Acceleration,- Deceleration, and- Jerk, it is possible that the- Masterreaches- EndOfProfilebefore the slave is- InSync.- Tappets- SMC_TappetData- Tappets: Has to be evaluated by SMC_GetTappetValue function blocks. 
