NexMotion  1.4.0
Open Robots & Machines [WIP]
Group_State_Control

Group State Control Functions. More...

Collaboration diagram for Group_State_Control:

Functions

RTN_ERR FNTYPE NMC_GroupEnable (I32_T DevID, I32_T GroupIndex)
 Enable all group axes (Servo On). More...
 
RTN_ERR FNTYPE NMC_GroupDisable (I32_T DevID, I32_T GroupIndex)
 Disable all group axes ( Servo Off ). More...
 
RTN_ERR FNTYPE NMC_GroupGetStatus (I32_T DevID, I32_T GroupIndex, I32_T *PRetStatusInBit)
 Get the group status by bit. More...
 
RTN_ERR FNTYPE NMC_GroupGetState (I32_T DevID, I32_T GroupIndex, I32_T *PRetState)
 Get the state of group. More...
 
RTN_ERR FNTYPE NMC_GroupResetState (I32_T DevID, I32_T GroupIndex)
 Reset the group state . More...
 
RTN_ERR FNTYPE NMC_GroupResetDriveAlm (I32_T DevID, I32_T GroupIndex, I32_T GroupAxisIndex)
 Reset the group servo alarm. More...
 
RTN_ERR FNTYPE NMC_GroupResetDriveAlmAll (I32_T DevID, I32_T GroupIndex)
 Reset all group servo alarms. More...
 
RTN_ERR FNTYPE NMC_GroupGetDriveAlmCode (I32_T DevID, I32_T GroupIndex, I32_T GroupAxisIndex, I32_T *PRetAlmCode)
 Get alarm code fo Drive. More...
 

Detailed Description

Group State Control Functions.

Function Documentation

RTN_ERR FNTYPE NMC_GroupDisable ( I32_T  DevID,
I32_T  GroupIndex 
)

Disable all group axes ( Servo Off ).

If all group axes are disabled successfully, the group state will transfer to GROUP_DISABLE.

Parameters
DevIDDevice ID (DevID)
GroupIndexGroup 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:

I32 _T devID = 0;
I32_T groupIndex = 0;
RTN_ERR ret = 0;
ret = NMC_GroupDisable( devID, groupIndex );
if( ret != 0 ) return ret;

Reference:

RTN_ERR FNTYPE NMC_GroupEnable ( I32_T  DevID,
I32_T  GroupIndex 
)

Enable all group axes (Servo On).

If all group axes are enabled successfully, the group state will transfer from GROUP_DISABLE to GROUP_ENABLE

Parameters
DevIDDevice ID (DevID)
GroupIndexGroup 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:

I32_T devID = 0;
I32_T groupIndex = 0;
RTN_ERR ret = 0;
ret = NMC_GroupEnable( devID, groupIndex );
if( ret != 0 ) return ret;

Reference:

RTN_ERR FNTYPE NMC_GroupGetDriveAlmCode ( I32_T  DevID,
I32_T  GroupIndex,
I32_T  GroupAxisIndex,
I32_T PRetAlmCode 
)

Get alarm code fo Drive.

Parameters
DevIDDevice ID (DevID)
GroupIndexGroup index
GroupAxisIndexGroup axis index
[out]PRetAlmCodeThe 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:

Todo:
Add more description. The original definition is empty in official pdf manual.
RTN_ERR FNTYPE NMC_GroupGetState ( I32_T  DevID,
I32_T  GroupIndex,
I32_T PRetState 
)

Get the state of group.

Please refer to the below table for details.

Value State Description
0 GROUP_DISABLE A group axis is disabled.
1 GROUP_STAND_STILL A group axes are enabled.
2 GROUP_STOPPED After NMC_GroupStop() is called, the group is stopped.
3 GROUP_STOPPING After NMC_GroupStop() is called, the group is stopping.
4 GROUP_MOVING A group is moving.
5 GROUP_HOMING A group is homing.
6 GROUP_ERROR_STOP An error is occured in a group axis.
Parameters
DevIDDevice ID (DevID)
GroupIndexGroup index
[out]PRetState[Input] A pointer variable, [Output] Group 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:

Examples:

I32_T devID = 0;
I32_T groupIndex = 0;
I32_T state = 0;
RTN_ERR ret = 0;
ret = NMC_GroupGetState( devID, groupIndex, &state );
if( ret != 0 ) return ret;

Reference:

RTN_ERR FNTYPE NMC_GroupGetStatus ( I32_T  DevID,
I32_T  GroupIndex,
I32_T PRetStatusInBit 
)

Get the group status by bit.

The meanings of the bits are describe as follows. if the bit values is 1, the event is triggered.

bit Description
0 Trigger the external emergency switch
1 Drive alarm
2 Over the positive limit of hardware
3 Over the negative limit of hardware
4 Over the positive limit of soft ware
5 Over the negative limit of software
6 All groups enabled (i.e. all group state are GROUP_STAND_STILL)
7 A group axis error (i.e. a group axis state is GROUP_ERROR_STOP)
9 No position change for all group axes
10 The (line or arc) motion in the Cartesian coordinate system is accelerated (or decelerated) to the maximum velocity. The bit is 0 in case of the PTP or JOG motion.
11 The (line or arc) motion in the Cartesian coordinate system is decelerated to the target velocity or 0. The bit is 0 in case of the PTP or JOG motion.
12 The (line or arc) motion in the Cartesian coordinate system is executed at the maximum velocity. The bit is 0 in case of the PTP or JOG motion.
13 The group is in motion (i.e. the group state is GROUP_MOVING , GROUP_HOMING or GROUP_STOPPING)
14 The group is stopped (i.e. the group state is GROUP_STOPPED)
Parameters
DevIDDevice ID (DevID)
GroupIndexGroup index
[out]PRetStatusInBit[Input]A pointer variable,[Output] Status by bit.
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:

I32_T devID = 0;
I32_T group Index = 0;
I32_T statusInBit = 0;
RTN_ERR ret = 0;
ret = NMC_GroupGetStatus( devID, groupIndex, &statusInBit );
if( ret != 0 ) return ret;

Reference:

RTN_ERR FNTYPE NMC_GroupResetDriveAlm ( I32_T  DevID,
I32_T  GroupIndex,
I32_T  GroupAxisIndex 
)

Reset the group servo alarm.

Parameters
DevIDDevice ID (DevID)
GroupIndexGroup index
GroupAxisIndexThe index of the group axis which alarm to 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:

Examples:

I32_T devID =
I32_T groupIndex = 0;
I32_T groupAxisIndex = 0;
RTN_ERR ret = 0;
ret = NMC_GroupResetDriveAlm( devID, groupIndex, groupAxisInde x );
if( ret != 0 ) return ret;

Reference:

RTN_ERR FNTYPE NMC_GroupResetDriveAlmAll ( I32_T  DevID,
I32_T  GroupIndex 
)

Reset all group servo alarms.

Parameters
DevIDDevice ID (DevID)
GroupIndexGroup 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:

I32_T devID = 0;
I32_T groupIndex = 0;
RTN_ERR ret = 0;
ret = NMC_GroupResetDriveAlmAll( devID, groupIndex );
if( ret != 0 ) return ret;

Reference:

RTN_ERR FNTYPE NMC_GroupResetState ( I32_T  DevID,
I32_T  GroupIndex 
)

Reset the group state .

It can reset the group state from GROUP_STOPPED to GROUP_STAND_STILL. If the group state is GROUP_ERROR_STOP and the API is called, all drive alarms will be reset automatically. Then the group state will transfer to GROUP_STAND_STILL after all drive alarms are reset.

Parameters
DevIDDevice ID (DevID)
GroupIndexGroup 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:

I32_T devID = 0;
I32_T groupIndex = 0;
RTN_ERR ret = 0;
ret = NMC_GroupResetState( devID, groupIndex );
if( ret != 0 ) return ret;

Reference: