SetAxisGear

Commands a ratio between the velocity of the slave and master axis.

Syntax

KsCommandStatus SetAxisGear(
     int Master,
     int Slave,
     BOOL Permanent,
     double Ratio,
     McSource MasterValueSource,
     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.

Acceleration [in]: the acceleration for gearing in.

Deceleration [in]: the deceleration for gearing in.

Jerk [in]: the jerk for gearing in.

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) {
   KsCommandStatus gear = WaitForCommand(10, FALSE, SetAxisGear(Master, Slave, FALSE,
      2 / 1, //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.*/
      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

AbortCommand

PowerAxis

SetAxisGearInPos

StopAxis