RX72M Group
Single-Chip Motor Control via EtherCAT Communications
R01AN5434EJ0110 Rev.1.10
Page 39 of 85
Aug.31.2020
5.13 R_MTR_SetDir
This function sets the direction of the motor’s rotation.
Format
void R_MTR_SetDir (uint8_t dir, uint8_t u1_id)
Parameters
dir
Rotation direction
MTR_CW(0): Clockwise
MTR_CCW(1): Counterclockwise
u1_id
Specifies the ID of the motor to be controlled.
MTR_ID_A /* Motor A*/
Return Values
None
Properties
The prototypes are declared in r_mtr_driver_acces.h.
Description
Processing of the position and velocity are with the set direction of rotation as the positive direction.
The default value in the sample program is clockwise.
Example
/* Set the direction to CW */
R_MTR_SetDir(MTR_CW, MTR_ID_A);