MC_GearIn
This function block commands a ratio between the velocity of the slave and master axis.
Syntax
Definition:
FUNCTION_BLOCK MC_GearIn
VAR_INPUT
Master : Type_Master1D;
Slave : Reference To AXIS_REF;
Execute : BOOL;
RatioNumerator : LREAL;
RatioDenominator : UDINT;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
BufferMode : EBufferMode;
ReactionToMasterError : EReactionToMasterError;
ReactionToSlaveError : EReactionToSlaveError;
END_VAR
VAR_OUTPUT
InGear : BOOL;
Busy : BOOL;
Active : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorId : UDINT;
MasterHasError : BOOL;
END_VAR
Inputs
Name | Type | Default | Description |
|---|---|---|---|
Master | Type_Master1D |
| Reference to the master axis |
Slave | Reference To AXIS_REF |
| Reference to the slave axis |
Execute | BOOL |
| Trigger the command with rising edge. |
RatioNumerator | LREAL | 1.0 | Gear ratio numerator |
RatioDenominator | UDINT | 1 | Gear ratio denominator |
Acceleration | LREAL | #Default | Maximum slave acceleration ([PosUnit]/s^2, positive) |
Deceleration | LREAL | #Default | Maximum slave deceleration ([PosUnit]/s^2, positive) |
Jerk | LREAL | #Default | Maximum slave jerk ([PosUnit]/s^3, positive) |
BufferMode | EBufferMode | Aborting | Chronological sequence of the command |
ReactionToMasterError | EReactionToMasterError | TriggerSlaveError | Reaction if an error occurs in the master while this command is active. |
ReactionToSlaveError | EReactionToSlaveError | TriggerMasterError | Reaction if an error occurs in the slave while this command is active. |
Outputs
Name | Type | Description |
|---|---|---|
InGear | BOOL | Synchronization established |
Busy | BOOL | Function block is not finished and new output values are to be expected. |
Active | BOOL | Function block has active control on the axis. |
CommandAborted | BOOL | Command is aborted by another command. |
Error | BOOL | Error occurred within function block. |
ErrorId | UDINT | Error identifier |
MasterHasError | BOOL | Master is in error state. |
Further information
The Acceleration and Deceleration inputs must be set to the same value. Furthermore, coupling is only possible when the slave axis is at a standstill.
Additional information on ReactionToSlaveError and ReactionToMasterError
As a general rule, if there is an error on the slave axis:
- Slave axis: The coupling is released, and the response depends on the error type.
- Master Axis: The master axis reports an error and either follows the MC's stop ramp or continues its current motion without being affected.
If there is an error on the master axis:
- Master axis: The response depends on the type of error.
- Slave axis: The slave axis reports an error and follows either the MC's stop ramp or the master axis's setpoints.
Detailed information is provided in the Error behavior chapter.
Version information
- TwinCAT Standard >= v3.1.4026.23.1
- TF5500 MC3 Base >= v4.0.6