Description
Check if the EtherCAT SubDevice is a stepper motor drive.
Syntax
int isStepper();
Parameters
None.
Return Value
Return whether the EtherCAT SubDevice is a stepper motor drive. If the return value is less than 0, it indicates an error code.
Comment
This function must be called after a successful execution of EthercatMaster::begin(). This function is non-blocking and can be called in callback functions.
Example Code
#include "Ethercat.h"
EthercatMaster master;
EthercatDevice_CiA402 motor;
void setup()
{ Serial.begin(115200);
while (!Serial);
master.begin();
motor.attach(0, master);
Serial.print("Stepper Motor Drive: ");
Serial.println(motor.isStepper());
}
void loop() {
// put your main code here, to run repeatedly:
}
Please see the EtherCAT CiA 402 User Manual for more QEC EtherCAT instructions and API usage.