SetAxisPositiveLimitSwitch

Sets a positive limit switch for an axis.

Syntax

KsError SetAxisPositiveLimitSwitch(
     int Index,
     BOOL AxisSwitch,
     int ModuleIndex,
     int BitOffset,
     BOOL Invert,
     BOOL enable
);

Parameters

Index: the index of an axis. Indexes are zero based. Aliases affect this parameter.

AxisSwitch: set to TRUE if the sensor is connected to an axis input, or set to FALSE if it is connected to an I/O module.

ModuleIndex: identifies which I/O module or axis contains the sensor. Aliases affect this parameter.

BitOffset: the offset in bit of the sensor digital input in the module input variables.

Invert: inverts the sensor value.

enable: TRUE: enables a positive limit switch for an axis. FALSE: disables the positive limit switch.

Return value

If the function succeeds, it returns errNoError, otherwise an error code. For more information about the error code, see the KsError list.

Remarks

Used to select a digital input to use as a positive limit switch.

Example

VOID ConfigureSafety(INT Index) {
   KsError nRet = SetAxisPositiveLimitSwitch(
      Index,
      FALSE,	//MAX_SENSOR_TYPE
      0,	//MAX_SENSOR_INDEX
      0,	//MAX_SENSOR_OFFSET
      FALSE,	//MAX_SENSOR_INVERT
      FALSE	//MAX_SENSOR_ENABLE
   );

   nRet = SetAxisNegativeLimitSwitch(
      Index,
      FALSE,	//MIN_SENSOR_TYPE
      0,	//MIN_SENSOR_INDEX
      0,	//MIN_SENSOR_OFFSET
      FALSE,	//MIN_SENSOR_INVERT
      FALSE	//MIN_SENSOR_ENABLE
   );
}

Requirements

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

See also

SetAxisHomeSwitch

SetAxisNegativeLimitSwitch