Class EcMaster.
More...
#include <EcMaster.h>
Class EcMaster.
The EcMaster is the manager of the EtherCat state machine and communications.These are examples of how to use the EcMaster class:
- Examples:
- demo1.cpp, demo2.cpp, demo3.cpp, and demo4.cpp.
cpp4ec::EcMaster::EcMaster |
( |
std::string |
ecPort, |
|
|
unsigned long |
cycleTime = 1000000 , |
|
|
bool |
useDC = false |
|
) |
| |
Constructor.
- Parameters
-
ecPort | ethercat port |
cycleTime | The period of the thread that sends PDO. |
useDC | if true the slaves use DC synchronization. |
bool cpp4ec::EcMaster::configure |
( |
| ) |
|
throw | ( | EcError |
| ) | | |
std::vector<EcSlave*> cpp4ec::EcMaster::getSlaves |
( |
| ) |
|
|
inline |
bool cpp4ec::EcMaster::preconfigure |
( |
| ) |
|
throw | ( | EcError |
| ) | | |
Preconfiguration.
Preconfigures the master and slaves. In this functions is set to Preoperational the EtherCAT State Machine.
- Examples:
- demo1.cpp, demo2.cpp, demo3.cpp, and demo4.cpp.
bool cpp4ec::EcMaster::reset |
( |
| ) |
|
throw | ( | EcError |
| ) | | |
void cpp4ec::EcMaster::setCycleTime |
( |
unsigned long |
cycleTime | ) |
|
|
inline |
Set the cycle time of the PDO thread.
- Parameters
-
void cpp4ec::EcMaster::setDC |
( |
bool |
useDC | ) |
|
|
inline |
Set Distributed clocks.
- Parameters
-
useDC | if true the slaves use DC synchronization. |
void cpp4ec::EcMaster::setPort |
( |
std::string |
ecPort | ) |
|
|
inline |
Set the ethercat port.
- Parameters
-
void cpp4ec::EcMaster::setSlaveInfo |
( |
bool |
slaveInfo | ) |
|
|
inline |
Set slave information.
- Parameters
-
slaveInfo | if true prints on EtherCATsoemInfo.txt the slave information. |
void cpp4ec::EcMaster::setSync0Shift |
( |
int |
Shift | ) |
|
|
inline |
Set Sync0 Shift.
- Parameters
-
bool cpp4ec::EcMaster::start |
( |
| ) |
|
throw | ( | EcError |
| ) | | |
bool cpp4ec::EcMaster::stop |
( |
| ) |
|
throw | ( | EcError |
| ) | | |
void cpp4ec::EcMaster::update |
( |
void |
| ) |
|
throw | ( | EcError |
| ) | | |
Update the outputs.
Update the output values. It sends the output PDO to the RT task, to be sent to devices.
- Examples:
- demo2.cpp, demo3.cpp, and demo4.cpp.
The documentation for this class was generated from the following files:
- /home/users/sergi.ruiz/cpp4ec/src/EcMaster.h
- /home/users/sergi.ruiz/cpp4ec/src/EcNRTMaster.cpp
- /home/users/sergi.ruiz/cpp4ec/src/EcRTMaster.cpp