Motion Master
|
#include <gtest/gtest.h>
#include <chrono>
#include <thread>
#include "loguru.h"
#include "soempp.h"
Functions | |
std::unique_ptr< soempp::Master > | initMaster (const std::string &iface) |
Initializes the SOEM master and prepares all connected slaves for operation. More... | |
TEST (SomeppPdoRemappingTestSuite, CirculoInitMasterTest) | |
TEST (SoemppPdoRemappingTestSuite, CirculoFailsSdoReadAfterSecondCallToEcxConfigMapGroupTest) | |
TEST (SoemppPdoRemappingTestSuite, InitialPdoMappingTest) | |
TEST (SoemppPdoRemappingTestSuite, PdoRemappingTest) | |
TEST (SomeppPdoRemappingTestSuite, IntegroNoInitialPdoMappingFromMasterSideTest) | |
TEST (SoemppPdoRemappingTestSuite, PdoRemapAndReinitFieldbusTest) | |
Variables | |
const std::string | kIface |
const size_t | kRxPdoCount = 11 |
const size_t | kTxPdoCount = 16 |
const int32_t | kObytes = 35 |
const int32_t | kIbytes = 47 |
std::unique_ptr< soempp::Master > initMaster | ( | const std::string & | iface | ) |
Initializes the SOEM master and prepares all connected slaves for operation.
This function creates a SOEM master instance using the specified network interface (iface
), initializes all connected slaves, and brings each slave through the required EtherCAT states (BOOT, INIT, PRE-OP). It then loads parameter definitions, updates and logs the PDO mappings, and configures the PDO mapping to transition slaves to the OPERATIONAL state.
The function performs the following steps:
iface
).iface | The network interface to be used for initializing the SOEM master (e.g., "eth0"). |
std::unique_ptr
to the fully initialized soempp::Master
object. TEST | ( | SoemppPdoRemappingTestSuite | , |
CirculoFailsSdoReadAfterSecondCallToEcxConfigMapGroupTest | |||
) |
TEST | ( | SoemppPdoRemappingTestSuite | , |
InitialPdoMappingTest | |||
) |
TEST | ( | SoemppPdoRemappingTestSuite | , |
PdoRemapAndReinitFieldbusTest | |||
) |
This test verifies PDO remapping by destroying and reinitializing the master. It ensures that remapping persists and functions correctly after a full fieldbus reset.
TEST | ( | SoemppPdoRemappingTestSuite | , |
PdoRemappingTest | |||
) |
This test verifies PDO remapping by adding the Core and Drive temperature entries to the TxPDO objects:
Behavior on different devices:
TEST | ( | SomeppPdoRemappingTestSuite | , |
CirculoInitMasterTest | |||
) |
TEST | ( | SomeppPdoRemappingTestSuite | , |
IntegroNoInitialPdoMappingFromMasterSideTest | |||
) |
Integro devices do not include an initial PDO mapping, even though the SoC defines a default one. Therefore, when using Integro devices, the master MUST explicitly configure the initial PDO mapping; otherwise, all values will default to zero. This should be addressed by the SOMANET Software team to ensure that the initially read PDO mapping is correct.
const int32_t kIbytes = 47 |
const std::string kIface |
const int32_t kObytes = 35 |
const size_t kRxPdoCount = 11 |
const size_t kTxPdoCount = 16 |