[Ethercat Master]
描述
Get the Global Shift Time for DC-Synchronous mode. For the definition of Global Shift Time, please refer to 1.5 同步.
語法
int getShiftTime();
參數
無
回傳
Return the Global Shift Time, in nanoseconds.
備註
This function must be called after a successful execution of EthercatMaster::start() and before EthercatMaster::stop(). 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);
slave.setDc(1000000);
master.start(1000000);
Serial.print("Global Shift Time: ");
Serial.println(master.getShiftTime());
}
void loop() {
// ...
}Please see the EtherCAT Library User Manual for more QEC EtherCAT instructions and API usage.