MC_GearInPos (FB)
FUNCTION_BLOCK MC_GearInPos
This function block commands a gear ratio between the position of the slave and master axes from the synchronization point onwards.
Any previous motion is continued until master crosses “MasterSyncPosition – MasterStartDistance” in the correct direction (according to the sign of MasterStartDistance).
At that point in time the output StartSync is set. When a “Stop” command is executed on the “Slave” axis before the synchronization has happened, it inhibits the synchronization and the function block issues “CommandAborted”.
If the MasterStartDistance is not specified, the system itself could calculate the set point for StartSync based on the other relevant inputs
If the value of MasterSyncPosition or SlaveSyncPosition is greater than the range of modulo, the actual effective value will be wrapped to modulo range,the final sync position needs to be calculated together with MasterStartDistance.
- Example of GearInPos timing diagram
- Different examples of MC_GearInPos
- InOut:
Scope
Name
Type
Comment
Input
ExecuteBOOLStarts the function block at rising edge
RatioNumeratorDINTGear ratio numerator, new value is updated only with rising edge of Execute input, not while still waiting to start
RatioDenominatorDINTGear ratio denominator, new value is updated only with rising edge of Execute input, not while still waiting to start
MasterValueSourceDecide to use the actual position or reference position of master axis
MasterSyncPositionLREALThe position of the master in the path where the group is insync with the master. (If the ‘MasterSyncPosition’ does not exist, at the first point of the path the master and slave are synchronized)
SlaveSyncPositionLREALSlave Position at which the axes are running in sync
SyncModeINT- Synchronization direction is determined by the sign of MasterStartDistance
SyncMode = 0 Combined with the actual slave position, the synchronization direction may be opposite to MasterStartDistance
SyncMode <> 0 Sync in matching direction with MasterStartDistance, the synchronization direction consistent MasterStartDistance (with respect to actual slave position) to avoid reverse slave direction
MasterStartDistanceLREALThe master distance for the slave to start to synchronize to the master. Start synchronizing when the master passes MasterSyncPosition - MasterStartDistance.Range:<>0
BufferModeNot supported, default mcABORTING used
Output
StartSyncBOOLSynchronization was started
InSyncBOOLCommanded gearing completed and synchronization position passed
BusyBOOLThe function block is not finished
ActiveBOOLIndicates that the function block has control on the axis
CommandAbortedBOOLCommand is aborted by another command from other PLCopen function block
ErrorBOOLSignals that error has occurred within function block
ErrorIDError identification. For error details refer to Enumeration ERROR_ID
Inout
MasterReference to master axis
SlaveReference to slave axis