3.6.07 MC_GearIn
Set the gear ratio between the slave axis and the main axis, perform the electronic gear operation.
Instruction format
| Instruction | MC_GearIn (FB) | |
| Name | Disconnect gear function block | |
| Graphical performance | ST performance | |
![]()
| MC_GearIn( Master: =, Slave: =, Execute: =, RatioNumerator: =, RatioDenominator: =, Acceleration: =, Deceleration: =, Jerk: =, BufferMode: =, InGear=>, Busy=>, Active=>, CommandAborted=>, Error=>, ErrorID=>); | |
Related variables
| Input and output variables | Name | Data type | Effective range | Initial value | Description |
| Master | Master axis | AXIS_REF_SM3 | - | - | Mapped to an axis, i.e. an instance of AXIS_REF_SM3 |
| Slave | Slave axis | AXIS_REF_SM3 | - | - | Mapped to an axis, i.e. an instance of AXIS_REF_SM3 |
| Input variables | Name | Data type | Effective range | Initial value | Description |
| Execute | Execution | BOOL | [FALSE, TRUE] | FALSE | Rising edge signal execution instruction |
| RatioNumerator | Gear ratio molecule | DINT | 1 | Gear ratio molecule | |
| RatioDenominator | Gear ratio denominator | UDINT | 1 | Gear ratio denominator | |
| Acceleration | Acceleration | LREAL | - | Specified acceleration | |
| Deceleration | Deceleration | LREAL | - | Specified deceleration | |
| Jerk | Jerk | LREAL | - | Jerk | |
| BufferMode | Cache mode selection | MC_BUFFIR_MODE | 0 to 5 | 0 | Specify the action when multiple instances start a motion instruction 0: Abort 1: Wait 2: Blend at low speed 3: Blend at previous speed 4: Blend at the next speed 5: Blend at high speed |
| Output variables | Name | Data type | Effective range | Initial value | Description |
| InGear | Gear ratio reached | BOOL | [FALSE, TRUE] | FALSE | TRUE, target velocity is reached from axis |
| Busy | Execution flag | BOOL | [FALSE, TRUE] | FALSE | TRUE, the instruction is being executed |
| Active | Control | BOOL | [FALSE, TRUE] | FALSE | TRUE when controlling |
| CommandAborted | Abort | BOOL | [FALSE, TRUE] | FALSE | TRUE, interrupted by other control instructions |
| Error | Error | BOOL | [FALSE, TRUE] | FALSE | When an error occurs, set to TRUE |
| ErrorID | Error ID | SMC_ERROR | Refer to SMC_ERROR | 0 | When an error occurs, the error ID is output. |
Function description
- Specify an action target axis by Slave .Specifying RatioNumerator, RatioDenominator, Acceleration, and Deceleration, and performing gear operation;
- The instruction position, the feedback position, and the latest instruction position can be specified for the Master (master axis);
- Execute rising edge starts electronic gear action;
- After starting the operation, the Slave axis takes the speed obtained by multiplying the Master axis speed by the gear ratio as the target speed, and performs acceleration and deceleration operation;
- To uncouple the electronic gear after executing GearOut instruction must be passed;
- This instruction is a speed electronic gear function, and the loss of synchronization distance caused during acceleration will not be automatically compensated;
- When Busy signal is TRUE during instruction execution, if the target speed of the slave axis does not reach the new rising edge of Execute will not affect it;
- When the Busy signal is TRUE during instruction execution, if the target speed of the slave axis reaches this time, the new rising edge of Execute will not affect it;
- The target velocity is reached, InGear is TRUE, after which Slave axis movement=master axis movement*RatioNumerator/RatioDenominator;
- If the master axis speed changes in real time, carefully use this instruction.
Precautions
Please do not use the MC_SetPosition instruction during the execution of the instruction to avoid accidents caused by rapid operation of the motor;
When you want to use MC_SetPosition insturction for Master, disengage the relationship between the spindle and the slave axes and execute the instruction.
Sequence diagram
Busy becomes TRUE at the same time as Execute is started. Active becomes TRUE in the next cycle. When the target speed is reached, InGear (gear ratio reached) becomes TRUE.
When this instruction is aborted with another instruction, CommandAborted becomes TRUE and Busy, Active, InGear becomes FALSE.
To end the electronic gear action halfway, use MC_GearOut or MC_Stop instruction.

(1) This instruction starts in other instruction execution
Start this instruction for the currently executing instruction, which can be switched or cached to this instruction.
The action at launch of multiple instances of this instruction is specified by BufferMode.
| Buffer mode selection | Description |
| Aborting | Immediately abort the currently executing instruction and switch to this instruction. When the operation direction of the axis is reversed due to the instruction switching, the operation direction of the axis is reversed according to "operation at the time of reverse" in the axis parameter. |
| Buffered | The function block is started immediately after the last instruction motion is terminated. No blending is done here. When the end condition (Done, InVelocity, InEndVelocity, InGear, InSync, EndOfProfile, etc.) is reached, the new motion starts at the speed of the previous motion. If the previous motion was MC_MoveAbsolute or MC_MoveRelative, the new motion starts at still. |
(2) Other instructions in execution of this instruction are enabled
Multiple instances of execution of instructions in an interrupted manner from the slave axis can be initiated.
At this time, the gear operation is stopped, and the operation started by a plurality of instances is started.
The instruction cannot be launched in multiple instances without interrupting.

