[Ethercat Device]
説明
EtherCATスレーブデバイスでサポートされているメールボックス・プロトコル・タイプを取得します。
構文
int getMailboxProtocol();
媒介変数
なし
戻り値
サポートされているメールボックス・プロトコルの種類を返します:
- 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.
戻り値が0未満の場合、 error codeを示します。.
備考
この関数は、 EthercatMaster::begin()
の前に呼び出す必要があります。この関数はブロッキングされていないため、コールバック関数内で呼び出すことができます。
例
#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() { // ... }
詳細は EtherCAT Library User Manual QEC EtherCAT命令とAPI使用法参照