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:
- After the Subsystem is created
- After the Subsystem is started
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:
- Name
- VendorId
- ProductCode
- RevisionNumber
- SerialNumber
- InputLength
- OutputLength
Resolution [in]: the encoder resolution used by the simulated axis.
UseCustomMotor [in]: a BOOL flag that indicates whether to use a custom simulated motor.
- TRUE: a valid LibraryId must be specified. The ID can be obtained using LoadCustomMotorLibrary.
- FALSE: use the default simulated motor in KINGSTAR Runtime, and LibraryId is ignored.
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:
|
Remarks
- ConfigureAxisEx is not thread-safe in RTSS configuration.
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