RX72M Group
Single-Chip Motor Control via EtherCAT Communications
R01AN5434EJ0110 Rev.1.10
Page 27 of 85
Aug.31.2020
5. API Functions
5.1 Overview
The API functions for the motor control program interface are shown below.
Functions
Description
R_MTR_InitControl
Initializes the motor control program.
R_MTR_SetUserifMode
Enables or disables automatic updating of the command values
for position and velocity.
R_MTR_ExecEvent
Issues indicators of events with regard to the state of system
operation.
R_MTR_ChargeCapacitor
Waits for the inverter’s main line voltage to become stable.
R_MTR_GetLoopModeStatus
Gets the setting for the control loop mode.
R_MTR_SetPositionStatus
Sets the input method of the position command value.
R_MTR_SetPosition
Sets the position command value in degrees.
R_MTR_GetPosition
Gets the value in degrees of the current position.
R_MTR_GetPositioningFLag
Gets the value of the positioning completed flag.
R_MTR_SetSpeed
Sets the velocity command value in rpm.
R_MTR_GetSpeed
Gets the current velocity value in rpm.
R_MTR_SetDir
Sets the direction of the motor’s rotation.
R_MTR_GetDir
Gets the currently set direction of motor rotation.
R_MTR_GetStatus
Gets the state of system operation of the motor control program.
R_MTR_InputBuffParamReset
Sets the buffer of variables for ICS input to the default value.
R_MTR_CtrlInput
Copies an ICS input variable to the buffer of variables for ICS
input.
R_MTR_SetVariables
Sets the contents of the buffer of variables for ICS input as the
motor control parameters.
R_MTR_AutoSetVariables
Sets the position and velocity command values in the buffer of
variables for ICS input as the given motor control parameters.
R_MTR_CtrlGainCalc
Calculates the gain for the motor control parameters.
R_MTR_UpdatePolling
Polls the write enable flag among the motor control parameters.
R_MTR_GetErrorStatus
Gets the error state of the encoder position and velocity control.
R_MTR_GetPositionPFStatus
Gets the profile state of encoder position control.
R_MTR_SetPositionUnits
Sets the position command value (number counted).
R_MTR_SetActualPositionUnits
Sets the current position (number counted).
R_MTR_GetPositionUnits
Gets the value (number counted) corresponding to the current
position.
R_MTR_GetSpeedUnits
Gets the current velocity value (number counted per second).
R_MTR_SetAccelerationUnits
Sets the velocity command value in count/s
2
.
R_MTR_SetDecelerationUnits
Sets the deceleration command value in count/s
2
.