Brief description of class BusIO.
More...
#include <armarx/control/ethercat/bus_io/BusIO.h>
|
EtherCATState | changeStateOfBus (EtherCATState state, bool validate=true) |
|
EtherCATState | changeStateOfSlave (std::uint16_t slaveIndex, EtherCATState state, bool validate=true) |
|
void | deactivateCOECA (std::uint16_t slaveIndex) |
| This deactivates the Complete access mode in CoE for the given slave. More...
|
|
bool | readRegisters (EtherCATFrameList *frames, std::uint16_t amountFramesToRead=0) |
|
bool | readRegisters (std::vector< RegisterDataList > ®isterData) |
|
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. More...
|
|
template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>> |
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. More...
|
|
EtherCATState | readStates () |
|
bool | resetErrorRegisters (std::uint16_t slaveIndex) |
|
void | setTimeouts (Timeouts const &timeouts) |
|
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. More...
|
|
template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>> |
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 succeeds. More...
|
|
virtual | ~BusIO () |
|
|
using | IOMap = std::array< char, 4096 > |
| IOmap the IO map where the process data are mapped in. More...
|
|
|
| BusIO () |
|
void | rtUpdatePDO () |
| Updates the PDO of all slaves. More...
|
|
Protected Member Functions inherited from ESIHandler |
std::optional< std::vector< std::byte > > | readESIBinaryBlob (std::uint16_t slaveIndex, std::uint16_t startAddress, std::uint16_t endAddress) const |
|
Brief description of class BusIO.
Detailed description of class BusIO.
Definition at line 57 of file BusIO.h.
◆ IOMap
using IOMap = std::array<char, 4096> |
|
protected |
IOmap the IO map where the process data are mapped in.
Definition at line 210 of file BusIO.h.
◆ ~BusIO()
◆ BusIO()
◆ changeStateOfBus()
◆ changeStateOfSlave()
◆ deactivateCOECA()
void deactivateCOECA |
( |
std::uint16_t |
slaveIndex | ) |
|
This deactivates the Complete access mode in CoE for the given slave.
For Elmo's it is necessary to deactivate the CA mode otherwise SOEM isn't able to bring them into OP-Mode
- Parameters
-
slave | the slave for which the CA mode will be deactivated |
Definition at line 445 of file BusIO.cpp.
◆ readRegisters() [1/2]
bool readRegisters |
( |
EtherCATFrameList * |
frames, |
|
|
std::uint16_t |
amountFramesToRead = 0 |
|
) |
| |
◆ readRegisters() [2/2]
◆ readSDOByteBuffer()
bool readSDOByteBuffer |
( |
std::uint16_t |
slaveIndex, |
|
|
std::uint16_t |
index, |
|
|
std::uint8_t |
subIndex, |
|
|
int * |
buflen, |
|
|
unsigned char * |
buf, |
|
|
bool |
completeAccess = false |
|
) |
| |
|
inline |
Performs a SDO read from the slave and returns true if it succeeds.
Fails if the bus has not been started yet.
Blocking until the write has been performed or a timeout is reached.
- Parameters
-
[IN] | slaveIndex the index of the slave it will read from |
[IN] | index the index of the object dictonary it will read from |
[IN] | subIndex the sub index of the entry |
[IN] | buflen amount of bytes to read |
[OUT] | buf buffer which contains the read data afterwards |
[IN] | completeAccess with this flag you can activate writing in complete access mode |
- Returns
- true when write was successful otherwise false
Definition at line 161 of file BusIO.h.
◆ readSDOEntry()
bool readSDOEntry |
( |
std::uint16_t |
slaveIndex, |
|
|
std::uint16_t |
index, |
|
|
std::uint8_t |
subIndex, |
|
|
T & |
result, |
|
|
bool |
completeAccess = false |
|
) |
| |
|
inline |
Performs a SDO read of an single entry from the slave and returns true if it succeeds.
Fails if the bus has not been started yet.
Blocking until the write has been performed or a timeout is reached.
- Parameters
-
[IN] | slaveIndex the index of the slave it will read from |
[IN] | index the index of the object dictonary it will read from |
[IN] | subIndex the sub index of the entry |
[OUT] | result the read data |
[IN] | completeAccess with this flag you can activate writing in complete access mode |
- Returns
- true when write was successful otherwise false
Definition at line 133 of file BusIO.h.
◆ readStates()
◆ resetErrorRegisters()
bool resetErrorRegisters |
( |
std::uint16_t |
slaveIndex | ) |
|
◆ rtUpdatePDO()
Updates the PDO of all slaves.
This function has priority over all other BusIO functions and can only be executed by the Bus itself.
Definition at line 113 of file BusIO.cpp.
◆ setTimeouts()
void setTimeouts |
( |
Timeouts const & |
timeouts | ) |
|
◆ writeSDOByteBuffer()
bool writeSDOByteBuffer |
( |
std::uint16_t |
slaveIndex, |
|
|
std::uint16_t |
index, |
|
|
std::uint8_t |
subIndex, |
|
|
int |
buflen, |
|
|
const unsigned char * |
buf, |
|
|
bool |
completeAccess = false |
|
) |
| |
|
inline |
Performs a SDO write to the slave with the given slaveIndex and returns true if it succeeds.
Fails if the bus has not been started yet.
Blocking until the write has been performed or a timeout is reached.
- Parameters
-
[IN] | slaveIndex the slavenumber of the slave on the bus |
[IN] | index the index of the entry where the value is written to |
[IN] | subIndex the subindex of the entry |
[IN] | buflen length of the buffer containing the data |
[IN] | buf buffer containing the data to write |
[IN] | completeAccess with this flag you can activate writing in complete access mode |
- Returns
- true when write was successful otherwise false
Definition at line 106 of file BusIO.h.
◆ writeSDOEntry()
bool writeSDOEntry |
( |
std::uint16_t |
slaveIndex, |
|
|
std::uint16_t |
index, |
|
|
std::uint8_t |
subIndex, |
|
|
T |
value, |
|
|
bool |
completeAccess = false |
|
) |
| |
|
inline |
Performs a SDO write to a single entry to the slave with the give slaveIndex and returns true if it succeeds.
Fails if the bus has not been started yet.
Blocking until the write has been performed or a timeout is reached.
- Parameters
-
[IN] | slaveIndex the slavenumber of the slave on the bus |
[IN] | index the index of the entry where the value is written to |
[IN] | subIndex the subindex of the entry |
[IN] | value the value that will be written to the slave |
[IN] | completeAccess with this flag you can activate writing in complete access mode |
- Returns
- true when write was successful otherwise false
Definition at line 79 of file BusIO.h.
◆ ioMap
◆ lastWorkCounter
◆ pdoAccessAvailable
bool pdoAccessAvailable = false |
|
protected |
◆ sdoAccessAvailable
bool sdoAccessAvailable = false |
|
protected |
◆ timeouts
The documentation for this class was generated from the following files: