[Ethercat Master]
描述
Get the EtherCAT Slave Vendor ID on EtherCAT bus.
語法
uint32_t getVendorID(uint16_t slave_no);
參數
[in] unit16_t slave_no
The sequence number of the EtherCAT slave device on the network, 0 indicates the first slave device, 1 indicates the second slave device, and so on.
回傳值
Return the Vendor ID of the specified slave. If an error occurs, it will return UINT32_MAX.
備註
This function must be called after a successful execution of EthercatMaster::begin(). This function is non-blocking and can be called within the Cyclic Callback.
範例
#include "Ethercat.h"
EthercatMaster master;
void setup() {
uint32_t slavevendorID;
uint16_t slavecount = 1;
Serial.begin(115200);
while (!Serial);
master.begin();
slavevendorID = master.getVendorID(slavecount);
Serial.println(slavevendorID);
}
void loop() {
// ...
}Please see the EtherCAT Library User Manual for more QEC EtherCAT instructions and API usage.