#include <ec_master.hpp>
◆ SIMPLECAT_CONTRL_CALLBACK
typedef void(* ethercat_interface::EcMaster::SIMPLECAT_CONTRL_CALLBACK) (void) |
run a control loop of update() and user_callback(), blocking. call activate and setThreadHighPriority/RealTime first.
◆ SIMPLECAT_EXIT_CALLBACK
typedef void(* ethercat_interface::EcMaster::SIMPLECAT_EXIT_CALLBACK) (int) |
add ctr-c exit callback. default exits the run loop and prints timing
◆ EcMaster()
ethercat_interface::EcMaster::EcMaster |
( |
const int |
master = 0 | ) |
|
|
explicit |
◆ ~EcMaster()
virtual ethercat_interface::EcMaster::~EcMaster |
( |
| ) |
|
|
virtual |
◆ addSlave()
void ethercat_interface::EcMaster::addSlave |
( |
uint16_t |
alias, |
|
|
uint16_t |
position, |
|
|
EcSlave * |
slave |
|
) |
| |
add a slave device to the master alias and position can be found by running the following command /opt/etherlab/bin$ sudo ./ethercat slaves look for the "A B:C STATUS DEVICE" (e.g. B=alias, C=position)
◆ configSlaveSdo()
int ethercat_interface::EcMaster::configSlaveSdo |
( |
uint16_t |
slave_position, |
|
|
SdoConfigEntry |
sdo_config, |
|
|
uint32_t * |
abort_code |
|
) |
| |
configure slave using SDO
◆ activate()
bool ethercat_interface::EcMaster::activate |
( |
| ) |
|
call after adding all slaves, and before update
◆ update()
virtual void ethercat_interface::EcMaster::update |
( |
uint32_t |
domain = 0 | ) |
|
|
virtual |
perform one EtherCAT cycle, passing the domain to the slaves
◆ run()
◆ stop()
virtual void ethercat_interface::EcMaster::stop |
( |
| ) |
|
|
inlinevirtual |
stop the control loop. use within callback, or from a separate thread.
◆ elapsedTime()
virtual double ethercat_interface::EcMaster::elapsedTime |
( |
| ) |
|
|
virtual |
time of last ethercat update, since calling run. stops if stop called. returns actual time. use elapsedCycles()/frequency for discrete time at last update.
◆ elapsedCycles()
virtual uint64_t ethercat_interface::EcMaster::elapsedCycles |
( |
| ) |
|
|
virtual |
number of EtherCAT updates since calling run.
◆ setCtrlCHandler()
◆ setThreadHighPriority()
static void ethercat_interface::EcMaster::setThreadHighPriority |
( |
| ) |
|
|
static |
set the thread to a priority of -19 priority range is -20 (highest) to 19 (lowest)
◆ setThreadRealTime()
static void ethercat_interface::EcMaster::setThreadRealTime |
( |
| ) |
|
|
static |
set the thread to real time (FIFO) thread cannot be preempted. set priority as 49 (kernel and interrupts are 50)
◆ setCtrlFrequency()
void ethercat_interface::EcMaster::setCtrlFrequency |
( |
double |
frequency | ) |
|
|
inline |
◆ getInterval()
uint32_t ethercat_interface::EcMaster::getInterval |
( |
| ) |
|
|
inline |
◆ readData()
void ethercat_interface::EcMaster::readData |
( |
uint32_t |
domain = 0 | ) |
|
◆ writeData()
void ethercat_interface::EcMaster::writeData |
( |
uint32_t |
domain = 0 | ) |
|
The documentation for this class was generated from the following file:
- /home/runner/work/ethercat_driver_ros2/ethercat_driver_ros2/ethercat_interface/include/ethercat_interface/ec_master.hpp