Console.WriteLine("📜 Axis Homing: DS402 Drive");
const int offsetIdx = 0x607C;
const int offsetSub = 0x0;
const int offsetSize = 4;
const int offsetVal = 0;
const int methodIdx = 0x6098;
const int methodSub = 0x0;
const int methodSize = 1;
const int methodVal = 24;
const int targetSpeedIdx = 0x6099;
const int targetSpeedSub = 0x1;
const int targetSpeedSize = 4;
const int targetSpeedVal = 2;
const int originSpeedIdx = 0x6099;
const int originSpeedSub = 0x2;
const int originSpeedSize = 4;
const int originSpeedVal = 10;
const int accelIdx = 0x609A;
const int accelSub = 0x0;
const int accelSize = 4;
const int accelVal = 100;
const int CTRL_WORD_PREP_HOMING = 15;
const int CTRL_WORD_START_HOMING = 31;
const int DELAY_MS = 20;
const int STATUS_TARGET_REACHED = 0x400;
const int STATUS_HOMING_ATTAINED = 0x1000;
const int STATUS_HOMING_ERROR = 0x2000;
try
{
{
Console.WriteLine("Network not started. Please start it before running this app.");
return;
}
Axis axis = controller.
AxisGet(Constants.AXIS_0_INDEX);
bool cancelHome = false;
while ((!cancelHome) && ((statusWord & STATUS_TARGET_REACHED) == 0))
{
}
if ((statusWord & STATUS_HOMING_ATTAINED) == STATUS_HOMING_ATTAINED)
Console.WriteLine("Axis homed successfully");
else if ((statusWord & STATUS_HOMING_ERROR) == STATUS_HOMING_ERROR)
Console.WriteLine("Error occurred during homing");
}
finally
{
}
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
Helpers class provides static methods for common tasks in RMP applications.
uint32_t NetworkIndexGet(RSINetworkIndexType indexType)
Get the PDO array index for an axis signal mapping.
void OperationModeSet(RSIOperationMode mode)
Set the axis operation mode.
NetworkNode * NetworkNode
Gets the associated NetworkNode object.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
void NetworkOutputOverrideValueSet(int32_t index, uint64_t outputValue)
Sets a PDO output directly.
RSINetworkState NetworkStateGet()
static MotionController * Get()
Get an already running RMP EtherCAT controller.
void NetworkOutputOverrideSet(int32_t index, bool outputOverride)
Set NetworkOutputValue to override RMP cyclic value.
void SampleWait(uint32_t samples)
Wait for controller firmware to execute samples.
void Delete(void)
Delete the MotionController and all its objects.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
void ServiceChannelWrite(int32_t index, int32_t subIndex, int32_t byteCount, int32_t sdoValue)
Write a number in the SDO.
uint16_t StatusWordGet(int32_t axisIndex)
Get the DS402 status word.
void ClearFaults()
Clear all faults for an Axis or MultiAxis.
int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
Enable all amplifiers.
MotionController * rsiControl
Gets the parent MotionController object.
RSINetworkState
State of network.
RSIOperationMode
DS402 modes of operation.
RSINetworkIndexType
Network PDO index types for configuring axis input/output mappings.