I want to find...

Search

Shares

Table of Content

EthercatDevice_DmpStepper.configDeviceMode()

[EthercatDevice_DmpStepper_Generic]

Description

Configure the device mode for the EtherCAT slave device. This parameter is written to the EEPROM of the EtherCAT slave device and loaded during startup, so users do not need to configure this parameter each time before running the program. After calling this function, the device mode of the EtherCAT slave device will not change immediately. The EtherCAT slave device must be repowered for the change to take effect.

This EtherCAT slave device supports the following two device modes:

  • CiA 402 Servo
    This EtherCAT slave device is equipped with 3-axis CiA 402 stepper motors. Users can individually control each CiA 402 stepper motor.
  • G-code Controller
    This EtherCAT slave device functions as a G-code controller, responsible for parsing and executing G-code instructions.

Derived Class:

Class NameVendor IDProduct Code
EthercatDevice_QECR11MP3S0x00000bc30x0086d0d6
EthercatDevice_QECR00MP3S0x00000bc30x0086d0d9

Syntax

int configDeviceMode(uint8_t mode);

Parameters

  • [in] uint8_t mode
    The device modes supported by this EtherCAT slave device are as follows:
DefinitionValueDescription
ECAT_CIA402_SERVO_MODE0CiA 402 Servo mode.
ECAT_GCODE_CONTROLLER_MODE1G-code Controller mode.

Return Value

Return an error code. If the returned value is zero, it indicates a successful execution of this function.

Comment

This function must be called after a successful execution of EthercatMaster::begin(). This function is blocking and cannot be called within the Cyclic Callback.

Example

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR11MP3S slave;

void setup() {
  master.begin();
  slave.attach(0, master);

  slave.configDeviceMode(ECAT_GCODE_CONTROLLER_MODE);
}

void loop() {
  // ...
}

Please see EthercatDevice_DmpStepper_Generic Class for more QEC Stepper Drivers instructions and API usage.

Scroll to Top