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

EtherCAT Router component. More...

#include <ethercat_router.h>

List of all members.

Public Member Functions

bool is_running () const
 Router running?
void route (void) const
 Actual routing code.
void start ()
 Start routing.
void stop ()
 Stop routing.

Static Public Member Functions

static EtherCAT_Routerinstance ()
 Singleton.

Protected Member Functions

 EtherCAT_Router ()

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_ALm_al_instance
 Pointer to AL instance.
EtherCAT_DataLinkLayerm_dll_instance
 Pointer to DLL instance.
unsigned int m_is_running
 Usage counter.
EC_Logicm_logic_instance
 Pointer to EC_Logic.

Static Private Attributes

static EtherCAT_Routerm_instance

Detailed Description

EtherCAT Router component.

Definition at line 46 of file ethercat_router.h.


Constructor & Destructor Documentation


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

Singleton.

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 82 of file ethercat_router.h.

Pointer to DLL instance.

Definition at line 86 of file ethercat_router.h.

Definition at line 88 of file ethercat_router.h.

unsigned int EtherCAT_Router::m_is_running [private]

Usage counter.

Definition at line 90 of file ethercat_router.h.

Pointer to EC_Logic.

Definition at line 84 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 Aug 27 2015 14:47:07