Axis information

When you are working with an axis, you'll want to check its states and connected switches to make sure everything is working properly. You can check them using GetAxisInfo checks the information concerning an axis, such as the connected switches, simulation mode, homing state, power state, and errors.

In AxisConfiguration.cpp, add the following code:

Copy
VOID PrintAxisInformation(int Index)
{
    BOOL HomeAbsSwitch = FALSE;
    BOOL LimitSwitchPos = FALSE;
    BOOL LimitSwitchNeg = FALSE;
    BOOL Simulation = FALSE;
    BOOL CommunicationReady = FALSE;
    BOOL ReadyForPowerOn = FALSE;
    BOOL PowerOn = FALSE;
    BOOL IsHomed = FALSE;
    BOOL AxisWarning = FALSE;
    KsError nRet = errNoError;

    nRet = GetAxisInfo(Index, &HomeAbsSwitch, &LimitSwitchPos, &LimitSwitchNeg, &Simulation, &CommunicationReady, &ReadyForPowerOn, &PowerOn, &IsHomed, &AxisWarning);
    if (nRet != errNoError)
        RtPrintf("GetAxisInfo failed: %x\n", nRet);

    RtPrintf("Switches:\n");
    RtPrintf("Home Switch: %d, Positive Limit Switch: %d, Negative Limit Switch: %d\n\n", HomeAbsSwitch, LimitSwitchPos, LimitSwitchNeg);

    RtPrintf("States:\n");
    RtPrintf("States: Simulation: %d, Communication Ready: %d, Ready for Power On: %d, Power On: %d, Is Homed: %d, Axis Warning: %d\n",
        Simulation, CommunicationReady, ReadyForPowerOn, PowerOn, IsHomed, AxisWarning);

    RtPrintf("\n");
}