[Ethercat Device]
描述
Write the specified bit value to the output process data of such slave device.
語法
int pdoBitWrite(uint32_t bit_offset, uint8_t value);
參數
[in] uint32_t bit_offset
The bit offset value of output process data for such EtherCAT slave device.[in] unit_8_t value
The bit value to be written to output process data for such EtherCAT slave device.
回傳值
Return an error code. If the returned value is zero, it indicates a successful execution of this function.
備註
This function must be called after a successful execution of EthercatMaster::start(). This function is non-blocking and can be called within the Cyclic Callback.
範例
#include "Ethercat.h"
EthercatMaster master;
EthercatDevice_Generic slave;
void setup() {
master.begin();
slave.attach(0, master);
master.start(1000000);
}
void loop() {
slave.pdoBitWrite(0, 1);
delay(500);
slave.pdoBitWrite(0, 0);
delay(1000);
}Please see the EtherCAT Library User Manual for more QEC EtherCAT instructions and API usage.