[Ethercat Master]
説明
Get the working counter for the current cycle. It is recommended to use this within the cyclic callback to ensure the working counter is retrieved in the correct cycle.
構文
int getWorkingCounter();
媒介変数
なし
戻り値
Return the working counter for the current cycle.
備考
この関数は、 EthercatMaster::start()
が正常に実行された後で、 EthercatMaster::stop()
の前に呼び出す必要があります。この関数はブロッキングされていないため、コールバック関数内で呼び出すことができます。
例
#include "Ethercat.h" EthercatMaster master; int CurrentWorkingCounter; void CyclicCallback() { CurrentWorkingCounter = master.getWorkingCounter(); } void setup() { Serial.begin(115200); master.begin(); master.attachCyclicCallback(CyclicCallback); master.start(); } void loop() { Serial.print("Current Working Counter: "); Serial.println(CurrentWorkingCounter); delay(1000); }
詳細は EtherCAT Library User Manual QEC EtherCAT命令とAPI使用法参照