Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
EtherCAT_Router Class Reference

EtherCAT Router component. More...

#include <ethercat_router.h>

List of all members.

Public Member Functions

 EtherCAT_Router (EtherCAT_AL *_m_al_instance, EC_Logic *_m_logic_instance, EtherCAT_DataLinkLayer *_m_dll_instance)
bool is_running () const
 Router running?
void route (void) const
 Actual routing code.
void start ()
 Start routing.
void stop ()
 Stop routing.

Public Attributes

EtherCAT_ALm_al_instance
 Pointer to AL instance.

Private Member Functions

bool check_mbx (const EtherCAT_SlaveHandler *sh) const
 Check and deliver post from slave.
bool post_mbxmsg (EtherCAT_MbxMsg *msg, const EtherCAT_SlaveHandler *from_sh) const
 Post a msg from a certain slave.

Private Attributes

EtherCAT_DataLinkLayerm_dll_instance
 Pointer to DLL instance.
bool m_is_running
 Usage counter.
EC_Logicm_logic_instance
 Pointer to EC_Logic.

Detailed Description

EtherCAT Router component.

Definition at line 46 of file ethercat_router.h.


Constructor & Destructor Documentation

EtherCAT_Router::EtherCAT_Router ( EtherCAT_AL _m_al_instance,
EC_Logic _m_logic_instance,
EtherCAT_DataLinkLayer _m_dll_instance 
)

Member Function Documentation

bool EtherCAT_Router::check_mbx ( const EtherCAT_SlaveHandler sh) const [private]

Check and deliver post from slave.

Check if slave posted something in its mailbox and if positive, deliver msgs to destination.

Parameters:
shSlave Handler to query
Returns:
true if nothing went wrong (i.e. nothing was posted, or no error occurred during routing
bool EtherCAT_Router::is_running ( ) const [inline]

Router running?

Definition at line 57 of file ethercat_router.h.

bool EtherCAT_Router::post_mbxmsg ( EtherCAT_MbxMsg msg,
const EtherCAT_SlaveHandler from_sh 
) const [private]

Post a msg from a certain slave.

Parameters:
msgmbx_msg to be posted
from_sh"poster" of the msg (The EtherCAT protocol does not provide a From: header in its messages)
Returns:
true if everything went fine
void EtherCAT_Router::route ( void  ) const

Actual routing code.

Todo:

This method should not be public, but since it is used in a C-function and I don't know how I could declare a C-function to be a friend of a class...

The current implementation simply polls the sync manager data area of each slave and checks if wkc is incremented. Another solution is to configure FMMU's of each slave and query the slaves with one logical EtherCAT msg. This has the advantage of only using one message per slave, but it "sacrifices" an extra FMMU per slave, which might not always be possible. In that case, the master would---during the start_mbx_communication() call of slaves---configure an FMMU of the slave which listens to the written bit of sync manager 0.

Start routing.

Stop routing.


Member Data Documentation

Pointer to AL instance.

Definition at line 79 of file ethercat_router.h.

Pointer to DLL instance.

Definition at line 84 of file ethercat_router.h.

Usage counter.

Definition at line 86 of file ethercat_router.h.

Pointer to EC_Logic.

Definition at line 82 of file ethercat_router.h.


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


ros_ethercat_eml
Author(s): Tom Panis, Klaas Gadeyne, Bob Koninckx, Austin Hendrix, Manos Nikolaidis
autogenerated on Thu Jul 4 2019 20:01:50