|
Motion Master
|
#include <soem_slave.h>


Public Member Functions | |
| SoemSlave (const uint16_t position) | |
| ~SoemSlave () override | |
| 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. | |
| bool | has_virtual_parameters () override |
| 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 () |
| void | initialize () |
| Initializes the slave based on its current EtherCAT state. | |
| 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=10000) override |
| Change the EtherCAT state of the slave. | |
| bool | request_state_switch (State state) override |
| MotionMasterError | write_sii (const std::vector< uint8_t > &content) override |
| void | receive_pdos (const uint8_t *process_data) override |
| void | update_outputs () |
| void | send_pdos (const uint8_t *process_data) override |
| void | update_inputs () |
| std::variant< MotionMasterError, std::vector< uint8_t > > | get_file_content (const std::string &file_name) |
| int32_t | set_file_content (const std::string &file_name, const std::vector< uint8_t > &content) |
| MotionMasterError | do_remove_file (const std::string &file_name) |
| std::vector< uint8_t > | read_sii () |
| Public Member Functions inherited from EthercatSlave | |
| EthercatSlave () | |
| EthercatSlave (EthercatSlave const &) | |
| ~EthercatSlave () | |
| Protocol | get_protocol () const override |
| Get the protocol the device uses. | |
| 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 |
|
inlineoverride |
| MotionMasterError SoemSlave::do_remove_file | ( | const std::string & | file_name | ) |
|
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 |
|
nodiscard |
|
nodiscardoverridevirtual |
Get the list of available files on the device.
If the fs-getlist output is too long, and the EtherCAT slave is currently in EtherCAT BOOT state, the command will return the truncated output in the first call and the rest of the output in the second call.
Reimplemented from EthercatSlave.
|
nodiscardoverridevirtual |
|
nodiscardoverridevirtual |
|
nodiscardoverridevirtual |
Get a configuration parameter by its index/subindex.
| index | |
| subindex |
Reimplemented from EthercatSlave.
|
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 |
Reimplemented from VirtualDevice.
| void SoemSlave::initialize | ( | ) |
Initializes the slave based on its current EtherCAT state.
Reads the slave's state and performs state-dependent initialization:
|
nodiscardoverridevirtual |
Request the current slave state.
| force_refresh | force refresh the state of the slave first |
Reimplemented from EthercatSlave.
| bool SoemSlave::is_supported | ( | ) |
|
nodiscardoverridevirtual |
Return the raw content (bytes) of the requested file from the flash memory.
| file_name |
Reimplemented from EthercatSlave.
| std::vector< uint8_t > SoemSlave::read_sii | ( | ) |
|
overridevirtual |
Reimplemented from EthercatSlave.
|
overridevirtual |
Remove a file from the flash memory.
| file_name |
The files_to_delete list should be empty at this point, but clear it anyway just because of possible future changes to the code which could result in some files still being in the list.
Try removing files outside of the file list - SAFETY SWEEP
If no additional (hidden) files are found, check if any non-hidden files were removed in the first removal phase and return the result of that.
Reimplemented from EthercatSlave.
|
overridevirtual |
NOTE: This function is called only when using the IgH EtherCAT Master.
Reimplemented from EthercatSlave.
|
overridevirtual |
Reimplemented from EthercatSlave.
|
nodiscard |
|
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.
| void SoemSlave::update_inputs | ( | ) |
| void SoemSlave::update_outputs | ( | ) |
|
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.
|
overridevirtual |
According to the EtherCAT specification (ETG.2000), the SII starts at EEPROM address 0x0000. However, this is not a strict requirement, and the actual starting address may differ based on the slave device's implementation.
Reimplemented from EthercatSlave.