[EthercatDevice_DmpStepper_Generic]
描述
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.
衍生類別:
Class Name | Vendor ID | Product Code |
EthercatDevice_QECR11MP3S | 0x00000bc3 | 0x0086d0d6 |
EthercatDevice_QECR00MP3S | 0x00000bc3 | 0x0086d0d9 |
語法
int configDeviceMode(uint8_t mode);
參數
[in] uint8_t mode
The device modes supported by this EtherCAT slave device are as follows:
定義 | 值 | 描述 |
ECAT_CIA402_SERVO_MODE | 0 | CiA 402 Servo mode. |
ECAT_GCODE_CONTROLLER_MODE | 1 | G-code Controller mode. |
回傳值
Return an error code. If the returned value is zero, it indicates a successful execution of this function.
備註
This function must be called after a successful execution of EthercatMaster::begin()
. This function is blocking and cannot be called within the Cyclic Callback.
範例
#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 類別 for more QEC Stepper Drivers instructions and API usage.