![Renesas RX72M Series Application Note Download Page 35](http://html.mh-extra.com/html/renesas/rx72m-series/rx72m-series_application-note_1440520035.webp)
RX72M Group
Single-Chip Motor Control via EtherCAT Communications
R01AN5434EJ0110 Rev.1.10
Page 35 of 85
Aug.31.2020
5.9 R_MTR_GetPosition
This function gets the value in degrees of the current position.
Format
int16_t R_MTR_GetPosition(uint8_t u1_id)
Parameters
u1_id
Specifies the ID of the motor to be controlled.
MTR_ID_A /* Motor A*/
Return Values
Current position [deg]
Properties
The prototypes are declared in r_mtr_driver_acces.h.
Description
The current position value is a signed value in units of degrees.
The position after initialization of the position of the motor’s magnet is 0 degrees.
Example
int16_t s2_pos;
/* Get current position */
s2_pos = R_MTR_GetPosition(MTR_ID_A);