MC_GearIn
The function block MC_GearIn activates a linear master-slave coupling (gear coupling). The function block accepts a fixed gear ratio in numerator/denominator format.
The slave axis can be coupled to the master axis at standstill. With this function block it is not possible to synchronize to a moving master axis. The flying saw function blocks MC_GearInVelo or MC_GearInPos can be used for this purpose.
The slave axis can be decoupled with the function block MC_GearOut. If the slave is decoupled while it is moving, then it retains its velocity and can be halted using MC_Stop or MC_Halt.
Alternatively, the function block MC_GearInDyn with dynamically changeable gear ratio is available.
Inputs
VAR_INPUT
Execute : BOOL;
RatioNumerator : LREAL;
RatioDenominator : UINT;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
BufferMode : MC_BufferMode;
Options : ST_GearInOptions;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | The command is executed with a rising edge. |
RatioNumerator | LREAL | Gear ratio numerator. Alternatively, the gear ratio can be specified in the numerator as a floating point value, if the denominator is 1. |
RatioDenominator | UINT | Gear ratio denominator |
Acceleration | LREAL | Acceleration (≥0). (Currently not implemented) |
Deceleration | LREAL | Deceleration (≥0). (Currently not implemented) |
Jerk | LREAL | Jerk (≥0). (Currently not implemented) |
BufferMode | MC_BufferMode | Currently not implemented |
Options | ST_GearInOptions | Currently not implemented |
For a 1:4 ratio the RatioNumerator must be 1, the RatioDenominator must be 4. Alternatively, the RatioDenominator may be 1, and the gear ratio can be specified as floating point number 0.25 under RatioNumerator. The RatioNumerator may be negative.
Inputs/outputs
VAR_IN_OUT
Master : AXIS_REF;
Slave : AXIS_REF;
END_VAR
Name | Type | Description |
---|---|---|
Master | AXIS_REF | Axis data structure of the master |
Slave | AXIS_REF | Axis data structure of the slave |
The axis data structure of type AXIS_REF addresses an axis unambiguously within the system. Among other parameters it contains the current axis status, including position, velocity or error state.
Outputs
VAR_OUTPUT
InGear : BOOL;
Busy : BOOL;
Active : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorID : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
InGear | BOOL | TRUE if the coupling was successful. |
Busy | BOOL | TRUE as soon as the command is started with "Execute" and as long as the command is processed. If "Busy" is FALSE, the function block is ready for a new order. At the same time, one of the outputs "InGear", "CommandAborted" or "Error" is set. |
Active | BOOL | Indicates that the command is executed. (Currently Active = Busy) |
CommandAborted | BOOL | TRUE if the command could not be executed completely. The axis may have become decoupled during the coupling process (simultaneous command execution). |
Error | BOOL | TRUE, if an error occurs. |
ErrorID | UDINT | If the error output is set, this parameter supplies the error number. |
Requirements
Development environment | Target system type | PLC libraries to include |
---|---|---|
TwinCAT v3.0.0 | PC or CX (x86 or x64) | Tc2_MC2 |