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.

../../../../../../_images/plcopen.png
  • 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

../../../../../../_images/MC_GearInPos_Ex1.png
Different examples of MC_GearInPos

../../../../../../_images/MC_GearInPos_Ex2.png ../../../../../../_images/MC_GearInPos_Ex3.png ../../../../../../_images/MC_GearInPos_Ex4.png
InOut:

Scope

Name

Type

Comment

Input

Execute

BOOL

Starts the function block at rising edge

RatioNumerator

DINT

Gear ratio numerator, new value is updated only with rising edge of Execute input, not while still waiting to start

RatioDenominator

DINT

Gear ratio denominator, new value is updated only with rising edge of Execute input, not while still waiting to start

MasterValueSource

MC_Source

Decide to use the actual position or reference position of master axis

MasterSyncPosition

LREAL

The 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)

SlaveSyncPosition

LREAL

Slave Position at which the axes are running in sync

SyncMode

INT

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

MasterStartDistance

LREAL

The master distance for the slave to start to synchronize to the master. Start synchronizing when the master passes MasterSyncPosition - MasterStartDistance.Range:<>0

BufferMode

MC_BufferMode

Not supported, default mcABORTING used

Output

StartSync

BOOL

Synchronization was started

InSync

BOOL

Commanded gearing completed and synchronization position passed

Busy

BOOL

The function block is not finished

Active

BOOL

Indicates that the function block has control on the axis

CommandAborted

BOOL

Command is aborted by another command from other PLCopen function block

Error

BOOL

Signals that error has occurred within function block

ErrorID

ERROR_ID

Error identification. For error details refer to Enumeration ERROR_ID

Inout

Master

Axis_Ref

Reference to master axis

Slave

Axis_Ref

Reference to slave axis