SetAxisGearInPos

Commands a gear ratio between the position of the slave and master axes from the synchronization point onwards.

Syntax

KsCommandStatus SetAxisGearInPos(
     int Master,
     int Slave,
     BOOL Permanent,
     double Ratio,
     McSource MasterValueSource,
     double MasterSyncPosition,
     double SlaveSyncPosition,
     McSyncMode SyncMode,
     double MasterStartDistance,
     double Velocity,
     double Acceleration,
     double Deceleration,
     double Jerk,
     McBufferMode BufferMode
);

Parameters

Master [in]: the index of the master axis. Indexes are zero based. Aliases affect this parameter.

Slave [in]: the index of the slave axis. Indexes are zero based. Aliases affect this parameter.

Permanent [in]: determines whether the gear state is preserved after the motor is disabled.

TRUE: the gear state is preserved even if the motor is disabled. For example, if the master axis is enabled, the slave axis will be enabled. If an error has occurred on the master, it occurred on the slave too.

FALSE: the gear state won't be preserved after the motor is disabled.

Ratio [in]: the gear ratio. For example, if the ratio is 3:2, the slave moves three units and master moves two.

MasterValueSource [in]: defines the source for synchronization. See the McSource type.

MasterSyncPosition [in]: the master's position where the slave is in sync with the master.

SlaveSyncPosition [in]: the slave's position where the slave is in sync with the master.

SyncMode [in]: defines the way to synchronize. See the McSyncMode type.

MasterStartDistance [in]: the distance for the master to travel to synchronize with the slave (when the slave axis is started to get into synchronization).

Velocity [in]: the maximum velocity during the synchronization phase.

Acceleration [in]: the maximum acceleration during the synchronization phase.

Deceleration [in]: the maximum deceleration during the synchronization phase.

Jerk [in]: the maximum jerk during the synchronization phase.

BufferMode [in]: defines how to blend the velocity of two functions. See the McBufferMode type.

Return value

Returns the KsCommandStatus structure.

Remarks

Example

KsCommandStatus AssignGearSlave(INT Master, INT Slave, DOUBLE MasterPosition, DOUBLE SlavePosition) {
   KsCommandStatus gear = WaitForCommand(10, FALSE, SetAxisGearInPos(Master, Slave,
      2, //Numerator of the gear factor
      1, //Denominator of the gear factor
      mcSetValue, /*Master Value Source. Value of the master position used.
                    Cam be the target position (commanded value and set value are identical)
                    or the actual position.*/
      MasterPosition, //The master's position where the slave is in sync with the master.
      SlavePosition, //The slave's position where the slave is in sync with the master.
      mcCatchUp, /*Defines the way to synchronize 
                   (such as "mcShortest," "mcCatchUp," "mcSlowDown"). Vendor-specific.*/
      0, //This will be calculated automatically if not provided.
      3600,
      36000,
      36000,
      3600000,
      mcAborting)
   );
   return gear;
}

Requirements

  RT Win32
Minimum supported version 4.0 4.0
Header ksmotion.h ksmotion.h
Library KsApi_Rtss.lib KsApi.lib

See also

PowerAxis

ReleaseAxis

SetAxisGear

StopAxis