Motion Master
|
#include <ethernet_slave.h>
Public Member Functions | |
EthernetSlave (const std::string &ipAddress, uint16_t position) | |
~EthernetSlave () override | |
mm::comm::spoe::Device & | getDevice () |
uint16_t | get_device_id () const override |
Get the ID (absolute position) of the EtherCAT slave in the EtherCAT chain. | |
uint16_t | get_hardware_id () const override |
Get the hardware ID. | |
Type | get_device_type () const override |
Get the device type. | |
std::list< VirtualParameter * > | get_all_virtual_parameters () override |
Get all configuration parameters from a slave. | |
VirtualParameter * | get_virtual_parameter (uint16_t index, uint8_t subindex) override |
Get a configuration parameter by its index/subindex. | |
std::variant< MotionMasterError, std::list< std::string > > | get_file_list () override |
Get the list of available files on the device. | |
std::variant< MotionMasterError, std::vector< uint8_t > > | read_file (const std::string &file_name) override |
Return the raw content (bytes) of the requested file from the flash memory. | |
MotionMasterError | write_file (const std::string &file_name, const std::vector< uint8_t > &content, std::function< void(uint8_t)> progress_callback) override |
Write raw content (bytes) into a file in the flash memory. | |
MotionMasterError | remove_file (const std::string &file_name) override |
Remove a file from the flash memory. | |
bool | has_firmware () override |
Check if the slave has a firmware installed. | |
bool | is_operational () const override |
Request the current slave state. | |
bool | is_supported () |
bool | has_pdos () override |
Check if PDO mapping is available. | |
State | get_state (bool force_refresh) const override |
Get the slave EtherCAT state. | |
bool | set_state (State state, uint32_t timeout_ms=5000) override |
Change the EtherCAT state of the slave. | |
Public Member Functions inherited from EthercatSlave | |
EthercatSlave () | |
EthercatSlave (EthercatSlave const &) | |
~EthercatSlave () | |
Protocol | get_protocol () const override |
Get the protocol the device uses. | |
virtual MotionMasterError | write_sii (const std::vector< uint8_t > &content) |
Write the SII file content onto an EtherCAT slave. | |
virtual void | update_pdo_mapping_od () |
virtual void | receive_pdos (const uint8_t *process_data) |
virtual void | send_pdos (const uint8_t *process_data) |
virtual bool | request_state_switch (State state) |
Public Member Functions inherited from VirtualDevice | |
virtual | ~VirtualDevice ()=default |
Additional Inherited Members | |
Public Types inherited from EthercatSlave | |
enum class | State : uint8_t { kUnspecified = 0 , kInit = 1 , kPreOp = 2 , kBoot = 3 , kSafeOp = 4 , kOp = 8 } |
enum class | FoeError { kNotFound = 0x00008001 , kAccessDenied = 0x00008002 , kDiskFull = 0x00008003 , kIllegal = 0x00008004 , kPacketNumberWrong = 0x00008005 , kAlreadyExists = 0x00008006 , kNoUser = 0x00008007 , kBootstrapOnly = 0x00008008 , kNotBootstrap = 0x00008009 , kNoRights = 0x0000800a , kProgramError = 0x0000800b } |
Public Types inherited from VirtualDevice | |
enum class | Protocol { kUnspecified = 0 , kMock , kEcat , kSerial } |
enum class | Type { kUnspecified = 0 , kCia402Drive , kDigitalIo } |
Public Attributes inherited from EthercatSlave | |
uint16_t | obytes = 0 |
uint16_t | ibytes = 0 |
Static Public Attributes inherited from EthercatSlave | |
static const std::map< State, std::map< State, State > > | ecat_state_machine_table_ |
static const std::map< FoeError, std::string > | foe_error_messages_ |
Static Public Attributes inherited from VirtualDevice | |
static const std::map< std::pair< uint32_t, uint32_t >, Type > | device_type_map_ |
|
explicit |
|
override |
|
nodiscardoverridevirtual |
Get all configuration parameters from a slave.
Reimplemented from EthercatSlave.
|
nodiscardoverridevirtual |
Get the ID (absolute position) of the EtherCAT slave in the EtherCAT chain.
Reimplemented from EthercatSlave.
|
nodiscardoverridevirtual |
|
nodiscardoverridevirtual |
Get the list of available files on the device.
Reimplemented from EthercatSlave.
|
nodiscardoverridevirtual |
|
nodiscardoverridevirtual |
|
nodiscardoverridevirtual |
Get a configuration parameter by its index/subindex.
index | |
subindex |
Reimplemented from EthercatSlave.
mm::comm::spoe::Device & EthernetSlave::getDevice | ( | ) |
|
overridevirtual |
Check if the slave has a firmware installed.
Reimplemented from EthercatSlave.
|
nodiscardoverridevirtual |
Check if PDO mapping is available.
Try to fetch all of the OD entries that define the PDO mapping
Reimplemented from EthercatSlave.
|
nodiscardoverridevirtual |
Request the current slave state.
force_refresh | force refresh the state of the slave first |
Reimplemented from EthercatSlave.
bool EthernetSlave::is_supported | ( | ) |
|
nodiscardoverridevirtual |
Return the raw content (bytes) of the requested file from the flash memory.
file_name |
Reimplemented from EthercatSlave.
|
overridevirtual |
Remove a file from the flash memory.
file_name |
Reimplemented from EthercatSlave.
|
overridevirtual |
Change the EtherCAT state of the slave.
state | EtherCAT state to switch the slave to |
timeout_ms | Timeout in ms, or how long to poll the state, default value is 10000 |
Reimplemented from EthercatSlave.
|
overridevirtual |
Write raw content (bytes) into a file in the flash memory.
file_name | |
content | vector of bytes |
progress_callback | function to call for progress changes |
Reimplemented from EthercatSlave.