77 template <
typename T,
typename = std::enable_if_t<std::is_
integral_v<T>>>
81 std::uint8_t subIndex,
83 bool completeAccess =
false)
85 return generalSDOWrite(
86 slaveIndex,
index, subIndex,
sizeof(value), &value, completeAccess);
108 std::uint8_t subIndex,
110 const unsigned char* buf,
111 bool completeAccess =
false)
113 return generalSDOWrite(slaveIndex,
index, subIndex, buflen, buf, completeAccess);
131 template <
typename T,
typename = std::enable_if_t<std::is_
integral_v<T>>>
135 std::uint8_t subIndex,
137 bool completeAccess =
false)
139 int buflen =
sizeof(result);
140 return generalSDORead(slaveIndex,
index, subIndex, &buflen, &result, completeAccess);
162 std::uint8_t subIndex,
165 bool completeAccess =
false)
167 return generalSDORead(slaveIndex,
index, subIndex, buflen, buf, completeAccess);
178 bool readRegisters(std::vector<RegisterDataList>& registerData);
209 using IOMap = std::array<char, 4096>;
214 bool generalSDOWrite(std::uint16_t slaveIndex,
216 std::uint8_t subIndex,
217 std::uint16_t buflen,
219 bool completeAccess =
false);
221 bool generalSDORead(std::uint16_t slaveIndex,
223 std::uint8_t subIndex,
226 bool completeAccess =
false);
228 bool isSDOAccessAvailable()
const;
251 const std::vector<size_t>& slaveAddressOffsets);
255 std::thread requestHandlerThread;
256 std::atomic_bool requestHandlerThreadRunning{
true};
257 std::atomic_bool pdoUpdateRequested{
false};
259 void requestHandlerLoop();
261 bool handleNextRequest();
262 void handleSDOUpdateRequest(
const std::shared_ptr<SDOUpdateRequest>& request);
263 void handleChangeStateRequest(
const std::shared_ptr<ChangeStateRequest>& request);
264 void handleReadStatesRequest(
const std::shared_ptr<ReadStatesRequest>& request);
265 void handleRegisterResetRequest(
const std::shared_ptr<RegisterResetRequest>& request);
266 void handleRegisterReadRequest(
const std::shared_ptr<RegisterReadRequest>& request);
uint16_t slaveConfiguredAddress
void deactivateCOECA(std::uint16_t slaveIndex)
This deactivates the Complete access mode in CoE for the given slave.
EtherCATState readStates()
void setTimeouts(Timeouts const &timeouts)
bool readSDOByteBuffer(std::uint16_t slaveIndex, std::uint16_t index, std::uint8_t subIndex, int *buflen, unsigned char *buf, bool completeAccess=false)
Performs a SDO read from the slave and returns true if it succeeds.
EtherCATState changeStateOfSlave(std::uint16_t slaveIndex, EtherCATState state, bool validate=true)
bool readSDOEntry(std::uint16_t slaveIndex, std::uint16_t index, std::uint8_t subIndex, T &result, bool completeAccess=false)
Performs a SDO read of an single entry from the slave and returns true if it succeeds.
void rtUpdatePDO()
Updates the PDO of all slaves.
bool writeSDOByteBuffer(std::uint16_t slaveIndex, std::uint16_t index, std::uint8_t subIndex, int buflen, const unsigned char *buf, bool completeAccess=false)
Performs a SDO write to the slave with the given slaveIndex and returns true if it succeeds.
bool readRegisters(std::vector< RegisterDataList > ®isterData)
EtherCATState changeStateOfBus(EtherCATState state, bool validate=true)
bool resetErrorRegisters(std::uint16_t slaveIndex)
bool writeSDOEntry(std::uint16_t slaveIndex, std::uint16_t index, std::uint8_t subIndex, T value, bool completeAccess=false)
Performs a SDO write to a single entry to the slave with the give slaveIndex and returns true if it s...
std::array< char, 4096 > IOMap
IOmap the IO map where the process data are mapped in.
Brief description of class ChangeStateRequest.
Brief description of class ESIHandler.
This class is a wrapper around an enum containing the different EtherCAT states.
Brief description of class ReadStatesRequest.
Brief description of class RegisterReadRequest.
Brief description of class RegisterResetRequest.
Brief description of class RequestQueue.
Brief description of class SDOUpdateRequest.
The EtherCATFrameList struct holds a list of EtherCAT frames that can be scheduled in round-robin-sty...
The EtherCATFrame struct represents an EtherCAT frame according to the EtherCAT spec.