ConfigureAxisEx

Configures the settings of a simulated axis and associates the axis with a custom simulated motor. This function can be used in the following states:

Syntax

KsError ConfigureAxisEx(
     int Index,
     SlaveStatus Detail,
     int Resolution,
     BOOL UseCustomMotor,
     int LibraryId
);

Parameters

Index [in]: the index of a simulated axis. Indexes are zero based. It doesn't support alias.

Detail [in]: contains information used to configure simulated axis settings. The following information can be set for the simulated axis:

Resolution [in]: the encoder resolution used by the simulated axis.

UseCustomMotor [in]: a BOOL flag that indicates whether to use a custom simulated motor.

LibraryId [in]: the ID of the custom simulated motor implementation. This value must be set to a valid ID when UseCustomMotor is set to TRUE. The ID can be obtained using LoadCustomMotorLibrary.

Return value

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

Possible error codes:

Error code Meaning

errSubsystemNotRunning

The function is used when the Subsystem has not been created.

errWrongParameter

One of the following conditions occurred:

  • Index is out of range.
  • Resolution is less than 0.
  • UseCustomMotor is set to TRUE but LibraryId is out of range (less than 0 or greater than or equal to 256).
  • UseCustomMotor is set to TRUE but RTDLL associated with the specified LibraryId is not loaded.
  • Attempting to reconfigure an axis with different settings after the axis has been created.

Remarks

Requirements

  RT Win32
Minimum supported version 4.5.4 4.5.4
Header CustomSimulatedMotorApi.h CustomSimulatedMotorApi.h
Library KsApi_Rtss.lib KsApi.lib

See also

Custom Simulated Motor

GetAxisMotorType

LoadCustomMotorLibrary