[Ethercat Device]
描述
Get the memory pointer of the input process data for such EtherCAT slave device.
語法
uint8_t *pdoGetInputBuffer();
參數
無
回傳值
The memory pointer of the input process data for such EtherCAT slave device. If the returned value is NULL, it indicates an 錯誤代碼 or that such slave device has no input process data.
備註
此函式必須在執行成功之後呼叫, EthercatMaster::start(). This function is non-blocking and can be called within the Cyclic Callback.
範例
#include "Ethercat.h"
EthercatMaster master;
EthercatDevice_Generic slave;
uint8_t *pointer;
void setup() {
Serial.begin(115200);
master.begin();
slave.attach(0, master);
master.start(1000000);
pointer = slave.pdoGetInputBuffer();
}
void loop() {
Serial.print("Byte-0 Value: ");
Serial.println(pointer[0]);
delay(1000);
}關於更多 EtherCAT 函式庫使用者手冊 for more QEC EtherCAT instructions and API usage.