我想找...

搜尋

分享

目錄

EthercatDevice.getMailboxProtocol()

[Ethercat Device]

描述

Get the supported mailbox protocol types by the EtherCAT slave device.

語法

int getMailboxProtocol();

參數

回傳值

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 錯誤代碼.

備註

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.

範例程式碼

#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.

返回頂端