ethercatcpp
Public Member Functions | Private Attributes | List of all members
ethercatcpp::Master Class Reference

This class define The EtherCAT Master. More...

#include <master.h>

Public Member Functions

 Master ()
 Constructor of Master class. More...
 
 Master (Master &&)=default
 
 Master (Master &)=delete
 
 ~Master ()
 
Masteroperator= (Master &&)=default
 
Masteroperator= (Master &)=delete
 
void add (Device &device)
 Add a new device to the global Ethercat bus. The order of addition must match the hardware order. Once all devices are added, call init() More...
 
void init ()
 Initializes network interface(s) then detect and match all devices on hardware bus. More...
 
void end ()
 Close all interface(s) (ethernet and EtherCAT) More...
 
void print_slave_info ()
 Print all devices informations from EtherCAT system (Master) datas. More...
 
void set_primary_interface (const std::string &interface_primary)
 Set the primary network interface to the EtherCAT system (Master) More...
 
void set_redundant_interface (const std::string &interface_redundant)
 Set the secondary (redundant) network interface to the EtherCAT system (Master) More...
 
void set_dc_compensate_shift_time (int32_t shift_time)
 Set the DC compensate shift time. More...
 
bool next_cycle ()
 Launch next ethercat communication cycle. More...
 
bool is_redundant () const
 Tell whether the master is configured in redundant mode. More...
 

Private Attributes

std::unique_ptr< Impl > impl_
 

Detailed Description

This class define The EtherCAT Master.

To create an EtherCAT system, Master is needed. It regroup all datas (network interface used, configurations, devices used, ...) and control the step cycle.

Examples
clipx_example.cpp, example_EL1018.cpp, example_EL1018_2008.cpp, example_EL2008.cpp, example_EL3104.cpp, example_EL3164.cpp, example_EL5101.cpp, shadow_one_hand.cpp, shadow_one_hand_torque.cpp, shadow_two_hands_mono.cpp, and shadow_two_hands_multi.cpp.

Constructor & Destructor Documentation

◆ Master() [1/3]

ethercatcpp::Master::Master ( )

Constructor of Master class.

◆ Master() [2/3]

ethercatcpp::Master::Master ( Master &&  )
default

◆ Master() [3/3]

ethercatcpp::Master::Master ( Master )
delete

◆ ~Master()

ethercatcpp::Master::~Master ( )

Member Function Documentation

◆ add()

void ethercatcpp::Master::add ( Device device)

Add a new device to the global Ethercat bus. The order of addition must match the hardware order. Once all devices are added, call init()

Parameters
[in]devicethe device to add, either a slave or a bus
Examples
clipx_example.cpp, example_EL1018.cpp, example_EL1018_2008.cpp, example_EL2008.cpp, example_EL3104.cpp, example_EL3164.cpp, example_EL5101.cpp, shadow_one_hand.cpp, shadow_one_hand_torque.cpp, shadow_two_hands_mono.cpp, and shadow_two_hands_multi.cpp.

◆ end()

void ethercatcpp::Master::end ( )

Close all interface(s) (ethernet and EtherCAT)

◆ init()

void ethercatcpp::Master::init ( )

◆ is_redundant()

bool ethercatcpp::Master::is_redundant ( ) const

Tell whether the master is configured in redundant mode.

Returns
true if in redundant mode, false otherwise

◆ next_cycle()

bool ethercatcpp::Master::next_cycle ( )

◆ operator=() [1/2]

Master& ethercatcpp::Master::operator= ( Master &&  )
default

◆ operator=() [2/2]

Master& ethercatcpp::Master::operator= ( Master )
delete

◆ print_slave_info()

void ethercatcpp::Master::print_slave_info ( )

Print all devices informations from EtherCAT system (Master) datas.

◆ set_dc_compensate_shift_time()

void ethercatcpp::Master::set_dc_compensate_shift_time ( int32_t  shift_time)

Set the DC compensate shift time.

The shift time depend on computer speed. A default value is already set to work in most cases (50 ms). If DC synchro don't work and your computer is very slow, you can increase this value with a max of 90 ms.

Parameters
[in]shift_timeshift time value in ms

◆ set_primary_interface()

void ethercatcpp::Master::set_primary_interface ( const std::string &  interface_primary)

Set the primary network interface to the EtherCAT system (Master)

Parameters
[in]interface_primaryname of network interface (ex: "eth0").
Examples
clipx_example.cpp, example_EL1018.cpp, example_EL1018_2008.cpp, example_EL2008.cpp, example_EL3104.cpp, example_EL3164.cpp, example_EL5101.cpp, shadow_one_hand.cpp, shadow_one_hand_torque.cpp, shadow_two_hands_mono.cpp, and shadow_two_hands_multi.cpp.

◆ set_redundant_interface()

void ethercatcpp::Master::set_redundant_interface ( const std::string &  interface_redundant)

Set the secondary (redundant) network interface to the EtherCAT system (Master)

Parameters
[in]interface_redundantname of network interface (ex: "eth1").

Member Data Documentation

◆ impl_

std::unique_ptr<Impl> ethercatcpp::Master::impl_
private

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