SlaveErrorRegistersDevice.cpp
Go to the documentation of this file.
1
#include "
SlaveErrorRegistersDevice.h
"
2
3
namespace
armarx::control::ethercat
4
{
5
void
6
SlaveErrorRegistersDevice::updateValues
(
const
RegisterDataList
*
data
)
7
{
8
ARMARX_CHECK_EQUAL
(
data
->slaveIndex, this->slaveIndex);
9
10
auto
update
= [&](std::uint8_t* member,
datatypes::RegisterEnum
registertype)
11
{
12
if
(
data
->registerData.count(registertype))
13
{
14
*member = std::get<datatypes::EtherCATDataType::UNSIGNED8>(
15
data
->registerData.at(registertype));
16
}
17
};
18
19
update
(&
value
.
linkLostCounterPort0
,
datatypes::RegisterEnum::LOST_LINK_COUNTER_PORT_0
);
20
update
(&
value
.
linkLostCounterPort1
,
datatypes::RegisterEnum::LOST_LINK_COUNTER_PORT_1
);
21
// update(&value.linkLostCounterPort2, datatypes::RegisterEnum::LOST_LINK_COUNTER_PORT_2);
22
// update(&value.linkLostCounterPort3, datatypes::RegisterEnum::LOST_LINK_COUNTER_PORT_3);
23
24
update
(&
value
.
frameErrorCounterPort0
,
datatypes::RegisterEnum::FRAME_ERROR_COUNTER_PORT_0
);
25
update
(&
value
.
frameErrorCounterPort1
,
datatypes::RegisterEnum::FRAME_ERROR_COUNTER_PORT_1
);
26
// update(&value.frameErrorCounterPort2, datatypes::RegisterEnum::FRAME_ERROR_COUNTER_PORT_2);
27
// update(&value.frameErrorCounterPort3, datatypes::RegisterEnum::FRAME_ERROR_COUNTER_PORT_3);
28
29
update
(&
value
.
rxErrorCounterPort0
,
datatypes::RegisterEnum::PHYSICAL_ERROR_COUNTER_PORT_0
);
30
update
(&
value
.
rxErrorCounterPort1
,
datatypes::RegisterEnum::PHYSICAL_ERROR_COUNTER_PORT_1
);
31
// update(&value.rxErrorCounterPort2, datatypes::RegisterEnum::PHYSICAL_ERROR_COUNTER_PORT_2);
32
// update(&value.rxErrorCounterPort3, datatypes::RegisterEnum::PHYSICAL_ERROR_COUNTER_PORT_3);
33
34
update
(&
value
.
forwardedRxErrorCounterPort0
,
35
datatypes::RegisterEnum::PREVIOUS_ERROR_COUNTER_PORT_0
);
36
update
(&
value
.
forwardedRxErrorCounterPort1
,
37
datatypes::RegisterEnum::PREVIOUS_ERROR_COUNTER_PORT_1
);
38
// update(&value.forwardedRxErrorCounterPort2,
39
// datatypes::RegisterEnum::PREVIOUS_ERROR_COUNTER_PORT_2);
40
// update(&value.forwardedRxErrorCounterPort3,
41
// datatypes::RegisterEnum::PREVIOUS_ERROR_COUNTER_PORT_3);
42
}
43
}
// namespace armarx::control::ethercat
armarx::control::ethercat::SlaveErrorRegistersSensorValue::frameErrorCounterPort1
std::uint8_t frameErrorCounterPort1
Definition:
SlaveErrorRegistersDevice.h:22
armarx::control::ethercat::SlaveErrorRegistersSensorValue::linkLostCounterPort1
std::uint8_t linkLostCounterPort1
Definition:
SlaveErrorRegistersDevice.h:17
armarx::control::ethercat::SlaveErrorRegistersDevice::value
SlaveErrorRegistersSensorValue value
Definition:
SlaveErrorRegistersDevice.h:108
armarx::control::ethercat::SlaveErrorRegistersSensorValue::rxErrorCounterPort0
std::uint8_t rxErrorCounterPort0
Definition:
SlaveErrorRegistersDevice.h:26
armarx::control::ethercat::datatypes::RegisterEnum
RegisterEnum
The RegisterEnum enum encodes the slave registers that every slave offers.
Definition:
SlaveRegisters.h:37
armarx::control::ethercat::datatypes::RegisterEnum::PREVIOUS_ERROR_COUNTER_PORT_0
@ PREVIOUS_ERROR_COUNTER_PORT_0
armarx::control::ethercat::SlaveErrorRegistersSensorValue::frameErrorCounterPort0
std::uint8_t frameErrorCounterPort0
Definition:
SlaveErrorRegistersDevice.h:21
armarx::control::ethercat::datatypes::RegisterEnum::FRAME_ERROR_COUNTER_PORT_1
@ FRAME_ERROR_COUNTER_PORT_1
armarx::control::ethercat::datatypes::RegisterEnum::LOST_LINK_COUNTER_PORT_1
@ LOST_LINK_COUNTER_PORT_1
armarx::control::ethercat::RegisterDataList
Brief description of struct RegisterDataList.
Definition:
SlaveRegisters.h:316
data
uint8_t data[1]
Definition:
EtherCATFrame.h:68
armarx::control::ethercat::SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort0
std::uint8_t forwardedRxErrorCounterPort0
Definition:
SlaveErrorRegistersDevice.h:31
armarx::control::ethercat
Definition:
Bus.cpp:24
armarx::control::ethercat::SlaveErrorRegistersDevice::updateValues
void updateValues(const RegisterDataList *data)
Definition:
SlaveErrorRegistersDevice.cpp:6
armarx::control::ethercat::datatypes::RegisterEnum::PREVIOUS_ERROR_COUNTER_PORT_1
@ PREVIOUS_ERROR_COUNTER_PORT_1
armarx::control::ethercat::SlaveErrorRegistersSensorValue::linkLostCounterPort0
DETAIL_SensorValueBase_DEFAULT_METHOD_IMPLEMENTATION std::uint8_t linkLostCounterPort0
Definition:
SlaveErrorRegistersDevice.h:16
SlaveErrorRegistersDevice.h
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition:
mongodb.cpp:67
armarx::control::ethercat::datatypes::RegisterEnum::PHYSICAL_ERROR_COUNTER_PORT_0
@ PHYSICAL_ERROR_COUNTER_PORT_0
armarx::control::ethercat::datatypes::RegisterEnum::PHYSICAL_ERROR_COUNTER_PORT_1
@ PHYSICAL_ERROR_COUNTER_PORT_1
ARMARX_CHECK_EQUAL
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
Definition:
ExpressionException.h:130
armarx::control::ethercat::SlaveErrorRegistersSensorValue::rxErrorCounterPort1
std::uint8_t rxErrorCounterPort1
Definition:
SlaveErrorRegistersDevice.h:27
armarx::control::ethercat::datatypes::RegisterEnum::FRAME_ERROR_COUNTER_PORT_0
@ FRAME_ERROR_COUNTER_PORT_0
armarx::control::ethercat::SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort1
std::uint8_t forwardedRxErrorCounterPort1
Definition:
SlaveErrorRegistersDevice.h:32
armarx::control::ethercat::datatypes::RegisterEnum::LOST_LINK_COUNTER_PORT_0
@ LOST_LINK_COUNTER_PORT_0
armarx
control
ethercat
SlaveErrorRegistersDevice.cpp
Generated on Sat Oct 12 2024 09:14:14 for armarx_documentation by
1.8.17