[Ethercat Device]
説明
Read 8-bit input process data which starting from the specified offset for such EtherCAT slave device.
構文
uint8_t pdoRead8(uint32_t offset);
媒介変数
[in] uint32_t offset
該当するEtherCATスレーブデバイスの入力プロセスデータのオフセット値。
戻り値
Return the 8-bit input process data.
備考
この関数は、 EthercatMaster::start()
が正常に実行された後に呼び出す必要があります。この関数はブロッキングされていないため、循環コールバック内で呼び出すことができます。
例
#include "Ethercat.h" EthercatMaster master; EthercatDevice_Generic slave; void setup(){ Serial.begin(115200); master.begin(); slave.attach(0, master); master.start(); } void loop() { slave.pdoWrite8(0, 0xFF); /* Write value of byte offset 0 of slave's output process data. */ Serial.println(slave.pdoRead8(0), HEX); /* Read value of byte offset 0 of slave's input process data. */ delay(100); }
詳細は EtherCAT Library User Manual QEC EtherCAT命令とAPI使用法参照