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

This class describe the EtherCAT driver for a beckhoff EL1018 device. More...

#include <EL1018.h>

Inheritance diagram for ethercatcpp::EL1018:
Inheritance graph

Public Types

enum  channel_id_t {
  channel_1, channel_2, channel_3, channel_4,
  channel_5, channel_6, channel_7, channel_8
}
 This enum define open circuit detection pin. More...
 
- Public Types inherited from ethercatcpp::SlaveDevice
enum  syncmanager_buffer_t { ASYNCHROS_OUT, ASYNCHROS_IN, SYNCHROS_OUT, SYNCHROS_IN = 4 }
 This enum define all type of buffers (SyncManager type) More...
 

Public Member Functions

 EL1018 ()
 Constructor of EL1018 class. More...
 
virtual ~EL1018 ()
 
bool channel_state (channel_id_t channel) const
 Get state of a channel. More...
 
void print_all_channels () const
 Print all available data. More...
 
- Public Member Functions inherited from ethercatcpp::SlaveDevice
 SlaveDevice ()
 Constructor of SlaveDevice class. More...
 
virtual ~SlaveDevice ()
 
void set_serial_number (uint32_t serial_number)
 Set the serial number of the device. More...
 
uint32_t eep_manufacturer () const
 Get EtherCAT device manufacturer id. More...
 
uint32_t eep_device () const
 Get EtherCAT device id. More...
 
uint32_t serial_number () const
 Get device serial number. More...
 
- Public Member Functions inherited from ethercatcpp::Device
 Device ()
 
virtual ~Device ()
 

Private Member Functions

void unpack_status_buffer ()
 

Private Attributes

uint8_t data_
 

Additional Inherited Members

- Protected Member Functions inherited from ethercatcpp::SlaveDevice
template<typename T , typename... U>
void define_physical_buffer (syncmanager_buffer_t type, uint16_t start_addr, uint32_t flags)
 Define a physical buffer (EtherCAT syncManager buffer). More...
 
void define_physical_buffer (syncmanager_buffer_t type, uint16_t start_addr, uint32_t flags, uint16_t length)
 Define a physical buffer (EtherCAT syncManager buffer). More...
 
template<typename T >
T * input_buffer (uint16_t start_addr)
 Get data of input physical buffer. More...
 
template<typename T , typename U , typename... Other>
std::tuple< T *, U *, Other *... > input_buffer (uint16_t start_addr)
 
uint8_t * input_buffer (uint16_t start_addr)
 Get data of input physical buffer. More...
 
template<typename T >
T * output_buffer (uint16_t start_addr)
 Get data of output physical buffer. More...
 
template<typename T , typename U , typename... Other>
std::tuple< T *, U *, Other *... > output_buffer (uint16_t start_addr)
 
uint8_t * output_buffer (uint16_t start_addr)
 Get data of output physical buffer. More...
 
void add_run_step (std::function< void()> &&pre, std::function< void()> &&post)
 Add a run step and define pre_function and post_function run step. More...
 
void add_init_step (std::function< void()> &&pre, std::function< void()> &&post)
 Add a init step and define pre_function and post_function for this init step. More...
 
void add_end_step (std::function< void()> &&pre, std::function< void()> &&post)
 Add a end step and define pre_function and post_function for this end step. More...
 
void set_id (const std::string &name, uint32_t manufacturer, uint32_t model)
 Set a specific ID to the slave. More...
 
void define_distributed_clock (bool have_dc)
 Define if the slave have a distributed clock. More...
 
void define_period_for_non_cyclic_steps (int period)
 Define the period between two non cyclic steps. More...
 
void configure_at_init (std::function< void()> &&func)
 Define the function that configures the slave in PREOP state at initialization of the ethercat bus (Master::init()) . More...
 
void configure_at_end (std::function< void()> &&func)
 Define the function that performs configuration actions in PREOP state at termination of the ethercat bus. (Master::end()). More...
 
int write_sdo (uint16_t index, uint8_t sub_index, int buffer_size, void *buffer) const
 write a SDO capable object field More...
 
int read_sdo (uint16_t index, uint8_t sub_index, int buffer_size, void *buffer) const
 read a SDO capable object field More...
 
template<typename T >
int write_sdo (uint16_t index, uint8_t sub_index, T &value) const
 Send a CoE write SDO packet to the slave. More...
 
template<typename T >
int read_sdo (uint16_t index, uint8_t sub_index, T &value) const
 Send a CoE read SDO packet to the slave. More...
 
template<typename T >
bool start_command_pdo_mapping ()
 Start the definition of the command PDO mapping. More...
 
template<typename T >
bool add_command_pdo_mapping (uint16_t pdo_address)
 Add a new command PDO map link. More...
 
template<typename T >
bool end_command_pdo_mapping ()
 Finish the definition of the command PDO mapping. More...
 
template<typename T >
bool start_status_pdo_mapping ()
 Start definition of the status PDO mapping. More...
 
template<typename T >
bool add_status_pdo_mapping (uint16_t pdo_address)
 Add a new STATUS PDO map link. More...
 
template<typename T >
bool end_status_pdo_mapping ()
 Finish definition of the status PDO mapping. More...
 
void configure_dc_sync0 (uint32_t cycle_time_0, int32_t cycle_shift) const
 Define DC synchro signal 0. More...
 
void configure_dc_sync0_1 (uint32_t cycle_time_0, uint32_t cycle_time_1, int32_t cycle_shift) const
 Define DC synchro signals 0 and 1. More...
 
int32_t read_file (std::string_view filename, uint32_t password, int32_t size, uint8_t *buffer) const
 
bool write_file (std::string_view filename, uint32_t password, int32_t size, uint8_t *buffer) const
 
bool read_sercos (uint8_t drive, uint8_t flags, uint16_t idn, int32_t size, uint8_t *buffer) const
 
bool write_sercos (uint8_t drive, uint8_t flags, uint16_t idn, int32_t size, uint8_t *buffer) const
 

Detailed Description

This class describe the EtherCAT driver for a beckhoff EL1018 device.

This driver permit to communicate with a "beckhoff EL1018" through an EtherCAT bus. The EL1018 EtherCAT Terminal is an interface to connect 8-channel digital input (fast).

WARNING !! Inputs ids channels are not the same that Connectors ids !!!

Examples
example_EL1018.cpp, and example_EL1018_2008.cpp.

Member Enumeration Documentation

◆ channel_id_t

This enum define open circuit detection pin.

Enumerator
channel_1 

Channel 1.

channel_2 

Channel 2.

channel_3 

Channel 3.

channel_4 

Channel 4.

channel_5 

Channel 5.

channel_6 

Channel 6.

channel_7 

Channel 7.

channel_8 

Channel 8.

Constructor & Destructor Documentation

◆ EL1018()

ethercatcpp::EL1018::EL1018 ( )

Constructor of EL1018 class.

◆ ~EL1018()

virtual ethercatcpp::EL1018::~EL1018 ( )
virtual

Member Function Documentation

◆ channel_state()

bool ethercatcpp::EL1018::channel_state ( channel_id_t  channel) const

Get state of a channel.

Parameters
[in]channeldesired channel (choose in channel_id_t)
Returns
state of specified channel
Examples
example_EL1018.cpp, and example_EL1018_2008.cpp.

◆ print_all_channels()

void ethercatcpp::EL1018::print_all_channels ( ) const

Print all available data.

Examples
example_EL1018.cpp, and example_EL1018_2008.cpp.

◆ unpack_status_buffer()

void ethercatcpp::EL1018::unpack_status_buffer ( )
private

Member Data Documentation

◆ data_

uint8_t ethercatcpp::EL1018::data_
private

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