SetAxisParameter
Sets the value of a vendor-specific parameter for an axis. The parameters are defined in McAxisParameter.
Syntax
KsCommandStatus SetAxisParameter(
int Index,
McAxisParameter ParameterNumber,
double Value,
McExecutionMode ExecutionMode
);
Parameters
Index [in]: the index of an axis. Indexes are zero based. Aliases affect this parameter.
ParameterNumber [in]: a parameter from McAxisParameter. You can use the parameter name or its corresponding number.
Value [in]: writes the value to the parameter you picked from McAxisParameter. For example, if you pick mcHomingMode
from McAxisParameter, you need to select a mode from the McHomingMode type and write its value here.
ExecutionMode [in]: defines the chronological sequence of the function. See the McExecutionMode type.
Return value
Returns the KsCommandStatus structure.
Example
VOID HomeSlave(INT Index) {
//Configure the Slave Homing Mode
//Select the homing mode to use in the drive
KsCommandStatus status = WaitForCommand(5, FALSE,
SetAxisParameter(Index, mcSlaveHomingMode, 33, mcImmediately));
//Start homing
KsCommandStatus home = WaitForCommand(30, TRUE, HomeAxis(Index, 0, 360, 36,
3600, 3600, 3600000, mcPositiveDirection, homingSensor));
double homePosition = 1;
GetAxisPosition(Index, mcActualValue, &homePosition);
RtPrintf("Home position: %d\n", (int)homePosition);
}
Requirements
RT | Win32 | |
---|---|---|
Minimum supported version | 4.0 | 4.0 |
Header | ksmotion.h | ksmotion.h |
Library | KsApi_Rtss.lib | KsApi.lib |
See also