RX72M Group
Single-Chip Motor Control via EtherCAT Communications
R01AN5434EJ0110 Rev.1.10
Page 13 of 85
Aug.31.2020
2.3.2 Software Module Configuration
Figure 2-2 shows the module configuration of the motor control program.
The files added or modified to control the motor control base project by EtherCAT communication are
enclosed in a red frame.
The frames with solid red lines indicate the files that have been added, and the frame with a broken red line
indicates the files that have been changed.
The major changes are listed below according to the module layer.
Table 2-9 Changes According to the Module Layer
Layer / Module
Related File
Description of File
Application layer
/ EtherCAT application
cia402sample.c
Application layer for the EtherCAT
communications program. This has the functions
of passing commands from the EtherCAT
master to the motor control program and
passing indicators of state from the motor
control program to the EtherCAT master.
Middle layer
/ EtherCAT interface module
r_ecat_dirver_acces.c
API functions for the interface between the
motor control program and the EtherCAT
communications program.
Middle layer
/ Control module
r_mtr_foc_control_encd_position.c
r_mtr_foc_speed.c
r_mtr_foc_position.c
These files convert the units of velocity [count/s]
and position [count] used in the CiA402 to the
units of velocity [rad/s] and position [rad] used in
the motor control program.