NexMotion  1.4.0
Open Robots & Machines [WIP]
Axis_State_Control

Axis State Control Functions. More...

Collaboration diagram for Axis_State_Control:

Functions

RTN_ERR FNTYPE NMC_AxisEnable (I32_T DevID, I32_T AxisIndex)
 Enable an axis. More...
 
RTN_ERR FNTYPE NMC_AxisDisable (I32_T DevID, I32_T AxisIndex)
 Disable an axis. More...
 
RTN_ERR FNTYPE NMC_AxisGetStatus (I32_T DevID, I32_T AxisIndex, I32_T *PRetAxisStatus)
 Get the status of the axis. More...
 
RTN_ERR FNTYPE NMC_AxisGetState (I32_T DevID, I32_T AxisIndex, I32_T *PRetAxisState)
 Get the state of the axis. More...
 
RTN_ERR FNTYPE NMC_AxisResetState (I32_T DevID, I32_T AxisIndex)
 Reset the state of the axis. More...
 
RTN_ERR FNTYPE NMC_AxisResetDriveAlm (I32_T DevID, I32_T AxisIndex)
 Reset the axis servo alarm. More...
 
RTN_ERR FNTYPE NMC_AxisGetDriveAlmCode (I32_T DevID, I32_T AxisIndex, I32_T *PRetAlmCode)
 Get the axis servo alarm code. More...
 

Detailed Description

Axis State Control Functions.

Function Documentation

RTN_ERR FNTYPE NMC_AxisDisable ( I32_T  DevID,
I32_T  AxisIndex 
)

Disable an axis.

Parameters
DevIDDevice ID (DevID)
AxisIndexAxis index
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:

Examples:

RTN_ERR ret = 0;
ret = NMC_AxisDisable(0, 0);

Reference:
NMC_AxisEnable() and NMC_AxisGetState()

RTN_ERR FNTYPE NMC_AxisEnable ( I32_T  DevID,
I32_T  AxisIndex 
)

Enable an axis.

Parameters
DevIDDevice ID (DevID)
AxisIndexAxis index
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:

  1. Before the axis motion, the function shall be called to drive the axis into the excitation.
  2. After the axis is excitation, the function will return successfully.
  3. If the axis is in the error state, the function will return the error code. After the error is resolved and the NMC_AxisResetState() is called, the function can be called to drive the axis into the excitation again.

Examples:

RTN_ERR ret = 0;
ret = NMC_AxisEnable(0, 0);

Reference:
NMC_AxisDisable(), NMC_AxisGetState(), and NMC_AxisResetState()

RTN_ERR FNTYPE NMC_AxisGetDriveAlmCode ( I32_T  DevID,
I32_T  AxisIndex,
I32_T PRetAlmCode 
)

Get the axis servo alarm code.

Parameters
DevIDDevice ID (DevID)
AxisIndexAxis index
[out]PRetAlmCode[Output] The value of alarm code.
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:

Examples:

Reference:
NMC_AxisGetStatus(), NMC_AxisResetState()

RTN_ERR FNTYPE NMC_AxisGetState ( I32_T  DevID,
I32_T  AxisIndex,
I32_T PRetAxisState 
)

Get the state of the axis.

Parameters
DevIDDevice ID (DevID)
AxisIndexAxis Index
PRetAxisStateReturn the axis state.
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:

  1. The function can be called in a periodic procedure to confirm the current axis state.
  2. Before being in motion or executing the Homing procedure, the axis shall be excitation. After NMC_AxisEnable() is called, NMC_AxisGetState() can be called to confirm the axis is excitation.
  3. If the axis is in the error state or not stopped normally, and NMC_AxisResetState() is called, NMC_AxisGetState() can be called to confirm the axis error state is resolved.

Examples:

RTN_ERR ret = 0;
I32_T state = 0;
ret = NMC_AxisGetState( 0, 0, &state );

Reference:
NMC_AxisGetStatus() NMC_AxisEnable() NMC_AxisResetState()

RTN_ERR FNTYPE NMC_AxisGetStatus ( I32_T  DevID,
I32_T  AxisIndex,
I32_T PRetAxisStatus 
)

Get the status of the axis.

Parameters
DevIDDevice ID (DevID)
AxisIndexAxis Index
PRetAxisStatusReturn the axis status
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:

Examples:

RTN_ERR ret = 0; I32_T status = 0;
ret = NMC_AxisGetStatus( 0, 0, &status );

Reference:
NMC_AxisGetState()

RTN_ERR FNTYPE NMC_AxisResetDriveAlm ( I32_T  DevID,
I32_T  AxisIndex 
)

Reset the axis servo alarm.

Parameters
DevIDDevice ID (DevID)
AxisIndexThe index of the axis will be reset.
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:

  1. When an alarm of axis drive is issued, the drive will automatically release the excitation in general. After the error is resolved, the function can be called to reset the alarm, and NMC_AxisGetStatus() can be called to get the axis status for the confirmation of alarm reset.
  2. Unless all drive alarms can be reseted with the function, some drive alarms shall be reseted by means of reengerization.
  3. After the function is called to reset the drive alarms successfully, the axis state can not be reset from the error state, unless NMC_AxisResetState() is called to reset the axis to the nonexcitation (AXIS_STATE_DISABLE).

Examples:

RTN_ERR ret = 0;
ret = NMC_AxisResetDriveAlm( 0, 0 );

Reference:
NMC_AxisGetStatus() NMC_AxisResetState()

RTN_ERR FNTYPE NMC_AxisResetState ( I32_T  DevID,
I32_T  AxisIndex 
)

Reset the state of the axis.

Parameters
DevIDDevice ID (DevID)
AxisIndexAxis Index
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:

  1. If an axis is in the error state, or an aix is requested with a forced stop command and has stopped, the function can be called to reset the axis to the nonexcitation state or the normal excitation state. NMC_AxisGetState() can be called to confirm the axis is normal.
  2. If the axis drive is in the alarm state and the function is called, the device will reset the alarm automatically. After the error is resolved, the axis state will trafer to the nonexcitation state from the error state (AXIS_STATE_ERROR).
  3. If an axis is requested with a forced stop command and has stopped, the function can be called to reset the axis to nonexcitation state (AXIS_STATE_STAND_STILL).

Examples:

RTN_ERR ret = 0;
ret = NMC_AxisResetState( 0, 0 );

Reference:
NMC_AxisGetState() NMC_AxisResetDriveAlm()