Motion Master
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
SoemMaster Class Reference

#include <soem_master.h>

Inheritance diagram for SoemMaster:
Inheritance graph
[legend]
Collaboration diagram for SoemMaster:
Collaboration graph
[legend]

Public Member Functions

 SoemMaster (Notifier &notifier, const std::string &ifname)
 
 ~SoemMaster () override
 
size_t start () override
 Start the EtherCAT master. More...
 
void stop () override
 Stop the EtherCAT master. More...
 
size_t restart () override
 
int32_t execute (uint64_t pending_signals) override
 Main EtherCAT master loop function to be executed at one millisecond interval. More...
 
bool is_running () override
 Check if the EtherCAT master is currently running. More...
 
int get_slaves_responding () override
 Return the number of slaves actually responding on the bus. More...
 
std::list< VirtualDevice * > get_slaves () override
 Get all of the available slaves. More...
 
bool disable_all_slaves () override
 Switch all slaves to PREOP. More...
 
void abort_all_client_requests () override
 
int roundtrip ()
 
void checkstate ()
 
- Public Member Functions inherited from EthercatMaster
virtual ~EthercatMaster ()=default
 
virtual size_t start ()=0
 Start the EtherCAT master. More...
 
virtual void stop ()=0
 Stop the EtherCAT master. More...
 
virtual size_t restart ()=0
 Restart the EtherCAT master. More...
 
virtual int32_t execute (uint64_t pending_signals)=0
 Main EtherCAT master loop function to be executed at one millisecond interval. More...
 
virtual bool is_running ()=0
 Check if the EtherCAT master is currently running. More...
 
virtual int get_slaves_responding ()=0
 Return the number of slaves actually responding on the bus. More...
 
virtual std::list< VirtualDevice * > get_slaves ()=0
 Get all of the available slaves. More...
 
virtual bool disable_all_slaves ()=0
 Switch all slaves to PREOP. More...
 
virtual void abort_all_client_requests ()=0
 

Static Public Member Functions

static void wait_for_slaves (Notifier &notifier, const std::string &ifname)
 

Static Public Attributes

static std::map< uint16_t, std::unique_ptr< EthercatSlave > > slaveMap {}
 

Constructor & Destructor Documentation

◆ SoemMaster()

SoemMaster::SoemMaster ( Notifier notifier,
const std::string &  ifname 
)
explicit

◆ ~SoemMaster()

SoemMaster::~SoemMaster ( )
override

Member Function Documentation

◆ abort_all_client_requests()

void SoemMaster::abort_all_client_requests ( )
inlineoverridevirtual

Implements EthercatMaster.

◆ checkstate()

void SoemMaster::checkstate ( )

◆ disable_all_slaves()

bool SoemMaster::disable_all_slaves ( )
overridevirtual

Switch all slaves to PREOP.

Attention
Must be implemented as non-blocking!
Returns
true on success, false otherwise

Implements EthercatMaster.

◆ execute()

int32_t SoemMaster::execute ( uint64_t  pending_signals)
overridevirtual

Main EtherCAT master loop function to be executed at one millisecond interval.

Returns
error if any

Implements EthercatMaster.

◆ get_slaves()

std::list< VirtualDevice * > SoemMaster::get_slaves ( )
overridevirtual

Get all of the available slaves.

Returns
map of available slaves

Implements EthercatMaster.

◆ get_slaves_responding()

int SoemMaster::get_slaves_responding ( )
overridevirtual

Return the number of slaves actually responding on the bus.

Returns
number of responding slaves

Implements EthercatMaster.

◆ is_running()

bool SoemMaster::is_running ( )
overridevirtual

Check if the EtherCAT master is currently running.

Returns
true if currently running, false otherwise

Implements EthercatMaster.

◆ restart()

size_t SoemMaster::restart ( )
overridevirtual

A restart is required only when clients request an EtherCAT state change from PRE_OP to OP. This is presumably done because a new PDO mapping might have been set on a device, necessitating an update of the PDO mapping in the slave instance.

Implements EthercatMaster.

◆ roundtrip()

int SoemMaster::roundtrip ( )

◆ start()

size_t SoemMaster::start ( )
overridevirtual

Start the EtherCAT master.

Returns
the number of initially responding slaves

Implements EthercatMaster.

◆ stop()

void SoemMaster::stop ( )
overridevirtual

Stop the EtherCAT master.

Implements EthercatMaster.

◆ wait_for_slaves()

void SoemMaster::wait_for_slaves ( Notifier notifier,
const std::string &  ifname 
)
static

Member Data Documentation

◆ slaveMap

std::map< uint16_t, std::unique_ptr< EthercatSlave > > SoemMaster::slaveMap {}
static

The documentation for this class was generated from the following files: