RX72M Group
Single-Chip Motor Control via EtherCAT Communications
R01AN5434EJ0110 Rev.1.10
Page 22 of 85
Aug.31.2020
The specifications of the CiA402 state transition functions are described below.
CiA402_StateTransition(N)
These functions are called when a state transition (N), where N = 1 to 12 and 14 to 16 as specified for a
CiA402 FSA, occurs.
Write code for the processing to be executed when the given state transitions occur.
Format
UINT16 CiA402_StateTransition(N)(TCiA402Axis *pCiA402Axis)
Parameters
TCiA402Axis *pCiA402Axis
Return Values
0: Normal end
1: The state transition did not proceed
Properties
The prototypes are declared in cia402appl.h.
Description
If a fault occurs during processing, set the objects to appropriate values and end function calling in accord
with the CiA402 standard. When 1 is set as the return value, the state transition has not proceeded.
Example
TCiA402Axis *pCiA402Axis;
UINT16 retval ;
/* Transition1 */
retval = CiA402_StateTransition1 (pCiA402Axis);
CiA402_LocalError
This function is called in response to the detection of an error specified in the CiA402 drive profile. After this
function is executed, state transition 13 will proceed as is specified for CiA402 FSAs.
Write code for the processing to be executed when an error is detected.
Format
void CiA402_LocalError(UINT16 ErrorCode)
Parameters
UINT16 ErrorCode : CiA402 drive profile error code
Return Values
None
Properties
The prototypes are declared in cia402appl.h.
Description
The error code specified as an argument is stored in object 0x603F and sent to the EtherCAT master.
Example
/* Over speed error is detected */
CiA402_LocalError (ERROR_SPEED);