[Ethercat Device]
Description
Get the supported mailbox protocol types by the EtherCAT slave device.
Syntax
int getMailboxProtocol();
Parameters
None.
Return Value
Return the supported mailbox protocol types.
- Bit 0: ADS over EtherCAT.
- Bit 1: Ethernet over EtherCAT.
- Bit 2: CAN application protocol over EtherCAT.
- Bit 3: File Access over EtherCAT.
- Bit 4: Servo Drive Profile over EtherCAT.
- Bit 5: Vendor specific protocol over EtherCAT.
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 within the callback functions.
Example Code
#include "Ethercat.h" EthercatMaster master; EthercatDevice_Generic slave; void setup() { Serial.begin(115200); master.begin(); slave.attach(0, master); Serial.print("Mailbox Protocols: "); Serial.println(slave.getMailboxProtocol()); } void loop() { // ... }
Please see the EtherCAT Library User Manual for more QEC EtherCAT instructions and API usage.