EtherCAT Control Framework v0.9
Implementation of EtherCAT protocol using IgH EtherCAT library for robot controller.
ecat_slave.hpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * $Id$
4 *
5 * Copyright (C) 2021 Veysi ADIN, UST KIST
6 *
7 * This file is part of the Wrapped IgH EtherCAT master userspace program
8 * for control applications.
9 *
10 * The Wrapped IgH EtherCAT master userspace program for control application
11 * in userspace is free software; you canredistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; version 2 of the License.
14 *
15 * The Wrapped IgH EtherCAT master userspace program for control application
16 * is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18 * PURPOSE.
19 * See the GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with the Wrapped IgH EtherCAT master userspace program for control application.
23 * If not, see <http://www.gnu.org/licenses/>.
24 *
25 * ---
26 *
27 * The license mentioned above concerns the source code only. Using the
28 * EtherCAT technology and brand is only permitted in compliance with the
29 * industrial property and similar rights of Beckhoff Automation GmbH.
30 *
31 * Contact information: veysi.adin@kist.re.kr
32 *****************************************************************************/
33/******************************************************************************
34 * \file ecat_slave.hpp
35 * \brief Ethercat slave class implementation header file.
36 *
37 * This header file contains blueprint of EtherCAT slave's which will be
38 * used to communicate with EtherCAT master.
39 *******************************************************************************/
40#pragma once
41
42#include "ecat_globals.hpp"
43
44
50{
51 public:
62
63
65 const static uint32_t kSync0_shift_ = 0;
66
68 ec_slave_config_t * slave_config_ ;
69
71 ec_slave_config_state_t slave_config_state_ ;
72
74 ec_pdo_info_t * slave_pdo_info_ ;
76 ec_pdo_entry_info_t * slave_pdo_entry_info_;
78 ec_sync_info_t * slave_sync_info_;
80 ec_pdo_entry_reg_t * slave_pdo_entry_reg_ ;
83
85 int32_t motor_state_ ;
91 ec_slave_info_t slave_info_;
100 // Slave homing parameters.
102
103};// EthercatSlave class
Contains EtherCAT slave parameters for configuration.
Definition: ecat_slave.hpp:50
HomingParam homing_param_
Definition: ecat_slave.hpp:101
OffsetPDO offset_
Offset for PDO entries to assign pdo registers.
Definition: ecat_slave.hpp:93
int CheckSlaveConfigState()
This function will check slave's application layer states. (INIT/PREOP/SAFEOP/OP)
Definition: ecat_slave.cpp:13
ProfileVelocityParam velocity_param_
Slave velocity parameters.
Definition: ecat_slave.hpp:97
ec_pdo_entry_info_t * slave_pdo_entry_info_
Definition: ecat_slave.hpp:76
DataReceived data_
Received data from servo drivers.
Definition: ecat_slave.hpp:95
ProfilePosParam position_param_
Slave position parameters.
Definition: ecat_slave.hpp:99
ec_slave_info_t slave_info_
Slave information data structure. This structure contains all information related to slave....
Definition: ecat_slave.hpp:91
~EthercatSlave()
Definition: ecat_slave.cpp:8
ec_slave_config_t * slave_config_
Slave configuration parameters, assinged to each slave.
Definition: ecat_slave.hpp:68
static const uint32_t kSync0_shift_
DC sync shift setting, zero will give best synchronization.
Definition: ecat_slave.hpp:65
ec_pdo_entry_reg_t * slave_pdo_entry_reg_
Definition: ecat_slave.hpp:80
ec_pdo_info_t * slave_pdo_info_
Definition: ecat_slave.hpp:74
ec_slave_config_state_t slave_config_state_
Slave state handle to check if slave is online and slaves state machine status(INIT/PREOP/SAFEOP/0P)
Definition: ecat_slave.hpp:71
int32_t motor_state_
Variable for checking motor state.
Definition: ecat_slave.hpp:85
uint8_t * slave_pdo_domain_
PDO domain for data exchange.
Definition: ecat_slave.hpp:82
ec_sync_info_t * slave_sync_info_
Definition: ecat_slave.hpp:78
EthercatSlave()
Definition: ecat_slave.cpp:3
Structure for data to be received from slaves.
Definition: ecat_globals.hpp:229
Homing mode configuration parameters.
Definition: ecat_globals.hpp:459
offset for PDO entries to register PDOs.
Definition: ecat_globals.hpp:327
Parameters that should be specified in position mode.
Definition: ecat_globals.hpp:378
Profile velocity mode configuration parameters.
Definition: ecat_globals.hpp:475