Datasheet

DMC60CSoftware Reference Manual
Page 11 of 16
followerMode(int deviceNumbertoFollow) Sets the DMC60C to follow another DMC60C on the CAN
bus.
o deviceNumbertoFollow The device number of the master DMC60C.
4.4 Disable Motor
A disable motor command is included which tells the DMC60C to apply a neutral output to the motor. This function
should be called if no other drive commands are being sent to the DMC60C to feed the FRC watchdog and motor
safety controller.
disableMotor() or Disable() or StopMotor() Sends a neutral output command to the DMC60C. If in
brake mode, the DMC60C will hold the position of the motor in place. If in coast mode, the DMC60C will
disable all current to the motor.
5. Getting the Status of the DMC60C
The status functions in the DMC60C API are all prefixed with “get” or “is”. This section will describe what each
status message returns.
5.1 General Status
Get() Gets the current duty cycle scaled from -1 to 1.
getCurrentDutyCycle() Returns the current duty cycle applied to the output of the motor from -100% to
100%.
isEnabled() Returns whether or not the DMC60C is currently driving (not disabled).
GetInverted() Returns whether or not the motor is inverted.
isCurrentLimitActive() Returns whether or not the current limit is actively throttling the output current.
getBusVoltage() - Returns the DMC60C's bus (battery) voltage in volts.
getAIN1Voltage() - Returns the voltage applied to the AIN1 pin on the DMC60C in volts.
getLoadCurrent() - Returns the load current of the DMC60C in amps. This is the current that is running
through the motor.
getAmbientTemp() - Returns the internal temperature of the DMC60C in °C.
getDeviceNumber() Returns the device number of the DMC60C.
5.2 Limit Switches
getFwdLimitSwitch() Returns the raw state of the forward limit switch.
getRevLimitSwitch() Returns the raw state of the reverse limit switch.
isFwdLimitSwitchActive() Returns true if the forward limit is active, false if not.
isRevLimitSwitchActive() Returns true if the reverse limit is active, false if not.
getFwdLimitSwitchStatus() Returns the complete status of the forward limit switch. (C++ only)
getRevLimitSwitchStatus() Returns the complete status of the reverse limit switch. (C++ only)
5.3 Closed Loop Status
getClosedLoopError() Returns the Closed Loop Error. Useful for PID tuning.
getRevolutionsTraveled() Returns the number of revolutions traveled relative to the zero position.
getDistanceTraveled() Returns the distance traveled in meters relative to the zero position.