SlaveInterface Class Referenceabstract

Brief description of class SlaveInterface. More...

#include <armarx/control/ethercat/SlaveInterface.h>

+ Inheritance diagram for SlaveInterface:

Public Member Functions

virtual void doMappings ()=0
 This is called after EtherCAT Bus is PreOp Mode. More...
 
virtual void execute ()=0
 This method gets triggered by the Bus Controller, this function hast to be implemented cooperative. More...
 
virtual void finishPreparingForOp ()
 This gets called after prepareForOp() was called. More...
 
virtual void finishPreparingForSafeOp ()
 
SlaveErrorRegistersDevicePtr getErrorRegistersDevice () const
 
const SlaveIdentifiergetSlaveIdentifier () const
 
std::uint16_t getSlaveNumber () const
 This returns the slave number of the slave on the bus +1 because slave 0 is the master. More...
 
virtual bool handleErrors ()
 This tries to clear oder fix the errors or problems of the slave or just gives detailed information about the problem. More...
 
virtual bool hasError ()=0
 This function indicates if there is a error or Problem with this slave. More...
 
virtual bool hasPDOMapping () const
 
virtual bool isEmergencyStopActive () const
 
virtual void prepareForOp ()=0
 This gets called between the SafeOp an the Op state of the bus at the initizialisation. More...
 
virtual bool prepareForRun ()=0
 This gets triggered by the bus controller before it will start the control loop. More...
 
virtual void prepareForSafeOp ()
 
virtual bool recoverFromEmergencyStop ()
 
void setErrorRegistersDevice (SlaveErrorRegistersDevicePtr errorRegistersDevice)
 
virtual void setInputPDO (void *ptr)=0
 
virtual void setName (const std::string &name)
 
virtual void setOutputPDO (void *ptr)=0
 
void setParentDeviceName (const std::string &name)
 
virtual bool shutdown ()=0
 This gets triggered by the bus Controller before it will close the EtherCAT bus. More...
 
 SlaveInterface (const SlaveIdentifier &slaveIdentifier)
 
virtual ~SlaveInterface () override
 
- Public Member Functions inherited from Logging
SpamFilterDataPtr deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
 disables the logging for the current line for the given amount of seconds. More...
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More...
 
void setTag (const LogTag &tag)
 
void setTag (const std::string &tagName)
 
virtual ~Logging ()
 

Protected Attributes

SlaveErrorRegistersDevicePtr errorRegistersDevice
 
SlaveIdentifier slaveIdentifier
 
- Protected Attributes inherited from Logging
MessageTypeT minimumLoggingLevel
 
SpamFilterDataPtr spamFilter
 
LogTag tag
 

Additional Inherited Members

- Protected Member Functions inherited from Logging
bool checkLogLevel (MessageTypeT level) const
 
const LogSenderPtrgetLogSender () const
 Retrieve log sender. More...
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 

Detailed Description

Brief description of class SlaveInterface.

Detailed description of class SlaveInterface.

Definition at line 29 of file SlaveInterface.h.

Constructor & Destructor Documentation

◆ SlaveInterface()

SlaveInterface ( const SlaveIdentifier slaveIdentifier)

Definition at line 10 of file SlaveInterface.cpp.

◆ ~SlaveInterface()

virtual ~SlaveInterface ( )
inlineoverridevirtual

Definition at line 34 of file SlaveInterface.h.

Member Function Documentation

◆ doMappings()

virtual void doMappings ( )
pure virtual

This is called after EtherCAT Bus is PreOp Mode.

This is where the PDO Mapping can be configured for the slave.

◆ execute()

virtual void execute ( )
pure virtual

This method gets triggered by the Bus Controller, this function hast to be implemented cooperative.

The Bus controller will guarantee that the process data will be update before each call.

◆ finishPreparingForOp()

virtual void finishPreparingForOp ( )
inlinevirtual

This gets called after prepareForOp() was called.

This is useful if prepareForOp() executes a long running initialization and needs to be done before the slave goes into op

Definition at line 81 of file SlaveInterface.h.

◆ finishPreparingForSafeOp()

virtual void finishPreparingForSafeOp ( )
inlinevirtual

Definition at line 91 of file SlaveInterface.h.

◆ getErrorRegistersDevice()

SlaveErrorRegistersDevicePtr getErrorRegistersDevice ( ) const

Definition at line 61 of file SlaveInterface.cpp.

◆ getSlaveIdentifier()

const SlaveIdentifier & getSlaveIdentifier ( ) const

Definition at line 34 of file SlaveInterface.cpp.

◆ getSlaveNumber()

std::uint16_t getSlaveNumber ( ) const

This returns the slave number of the slave on the bus +1 because slave 0 is the master.

Returns
index in ec_slave array

Definition at line 20 of file SlaveInterface.cpp.

◆ handleErrors()

bool handleErrors ( )
virtual

This tries to clear oder fix the errors or problems of the slave or just gives detailed information about the problem.

If hasError == false this function does nothing.

Returns
true if the function is trying to recover the slave or there is no error, false is send if this just reports the info

Definition at line 27 of file SlaveInterface.cpp.

+ Here is the call graph for this function:

◆ hasError()

virtual bool hasError ( )
pure virtual

This function indicates if there is a error or Problem with this slave.

It should not

Returns
true if there is an error/problem with this slave otherwise false;
+ Here is the caller graph for this function:

◆ hasPDOMapping()

virtual bool hasPDOMapping ( ) const
inlinevirtual

Reimplemented in SlaveInterfaceWithIO< InputT, OutputT >.

Definition at line 131 of file SlaveInterface.h.

◆ isEmergencyStopActive()

virtual bool isEmergencyStopActive ( ) const
inlinevirtual

Definition at line 102 of file SlaveInterface.h.

◆ prepareForOp()

virtual void prepareForOp ( )
pure virtual

This gets called between the SafeOp an the Op state of the bus at the initizialisation.

The slave can assume that the PDO is already mapped

◆ prepareForRun()

virtual bool prepareForRun ( )
pure virtual

This gets triggered by the bus controller before it will start the control loop.

If a slave needs more preparation than just getting in EtherCAT Op-Mode this should be done here. So slaves can assume that the EtherCAT state machine is in Op-Mode so PDO's are available. Attention!!! This needs to be implemented cooperative

Returns
true if the prepare is finished an don't needs to be called again

◆ prepareForSafeOp()

virtual void prepareForSafeOp ( )
inlinevirtual

Definition at line 86 of file SlaveInterface.h.

◆ recoverFromEmergencyStop()

virtual bool recoverFromEmergencyStop ( )
inlinevirtual

Definition at line 108 of file SlaveInterface.h.

◆ setErrorRegistersDevice()

void setErrorRegistersDevice ( SlaveErrorRegistersDevicePtr  errorRegistersDevice)

Definition at line 53 of file SlaveInterface.cpp.

◆ setInputPDO()

virtual void setInputPDO ( void *  ptr)
pure virtual

◆ setName()

void setName ( const std::string &  name)
virtual

Definition at line 41 of file SlaveInterface.cpp.

+ Here is the call graph for this function:

◆ setOutputPDO()

virtual void setOutputPDO ( void *  ptr)
pure virtual

◆ setParentDeviceName()

void setParentDeviceName ( const std::string &  name)

Definition at line 47 of file SlaveInterface.cpp.

+ Here is the call graph for this function:

◆ shutdown()

virtual bool shutdown ( )
pure virtual

This gets triggered by the bus Controller before it will close the EtherCAT bus.

So if the device need to do something before to get in a safe state, this can be done here. Attention!!! This needs to be implemented cooperative

Returns
if slave is shut down

Member Data Documentation

◆ errorRegistersDevice

SlaveErrorRegistersDevicePtr errorRegistersDevice
protected

Definition at line 138 of file SlaveInterface.h.

◆ slaveIdentifier

SlaveIdentifier slaveIdentifier
protected

Definition at line 137 of file SlaveInterface.h.


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