SlaveErrorRegistersDevice.h
Go to the documentation of this file.
1
#pragma once
2
3
4
#include <
RobotAPI/components/units/RobotUnit/Devices/SensorDevice.h
>
5
#include <
RobotAPI/components/units/RobotUnit/SensorValues/SensorValueBase.h
>
6
7
#include "
bus_io/SlaveRegisters.h
"
8
9
namespace
armarx::control::ethercat
10
{
11
class
SlaveErrorRegistersSensorValue
:
public
armarx::SensorValueBase
12
{
13
public
:
14
DETAIL_SensorValueBase_DEFAULT_METHOD_IMPLEMENTATION
15
16
std::uint8_t
linkLostCounterPort0
{0};
17
std::uint8_t
linkLostCounterPort1
{0};
18
// std::uint8_t linkLostCounterPort2{0};
19
// std::uint8_t linkLostCounterPort3{0};
20
21
std::uint8_t
frameErrorCounterPort0
{0};
22
std::uint8_t
frameErrorCounterPort1
{0};
23
// std::uint8_t frameErrorCounterPort2{0};
24
// std::uint8_t frameErrorCounterPort3{0};
25
26
std::uint8_t
rxErrorCounterPort0
{0};
27
std::uint8_t
rxErrorCounterPort1
{0};
28
// std::uint8_t rxErrorCounterPort2{0};
29
// std::uint8_t rxErrorCounterPort3{0};
30
31
std::uint8_t
forwardedRxErrorCounterPort0
{0};
32
std::uint8_t
forwardedRxErrorCounterPort1
{0};
33
34
// std::uint8_t forwardedRxErrorCounterPort2{0};
35
// std::uint8_t forwardedRxErrorCounterPort3{0};
36
37
static
SensorValueInfo<SlaveErrorRegistersSensorValue>
38
GetClassMemberInfo
()
39
{
40
SensorValueInfo<SlaveErrorRegistersSensorValue>
svi;
41
42
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::linkLostCounterPort0
,
43
"LinkLostCounter.Port0"
);
44
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::linkLostCounterPort1
,
45
"LinkLostCounter.Port1"
);
46
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::linkLostCounterPort2,
47
// "LinkLostCounter.Port2");
48
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::linkLostCounterPort3,
49
// "LinkLostCounter.Port3");
50
51
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::frameErrorCounterPort0
,
52
"FrameErrorCounter.Port0"
);
53
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::frameErrorCounterPort1
,
54
"FrameErrorCounter.Port1"
);
55
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::frameErrorCounterPort2,
56
// "FrameErrorCounter.Port2");
57
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::frameErrorCounterPort3,
58
// "FrameErrorCounter.Port3");
59
60
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::rxErrorCounterPort0
,
61
"RxErrorCounter.Port0"
);
62
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::rxErrorCounterPort1
,
63
"RxErrorCounter.Port1"
);
64
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::rxErrorCounterPort2,
65
// "RxErrorCounter.Port2");
66
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::rxErrorCounterPort3,
67
// "RxErrorCounter.Port3");
68
69
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort0
,
70
"ForwardedRxErrorCounter.Port0"
);
71
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort1
,
72
"ForwardedRxErrorCounter.Port1"
);
73
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort2,
74
// "ForwardedRxErrorCounter.Port2");
75
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort3,
76
// "ForwardedRxErrorCounter.Port3");
77
78
return
svi;
79
}
80
};
81
82
TYPEDEF_PTRS_SHARED
(SlaveErrorRegistersDevice);
83
84
/**
85
* @class SlaveErrorRegistersDevice
86
* @ingroup Library-ethercat
87
* @brief Brief description of class SlaveErrorRegistersDevice.
88
*
89
* Detailed description of class SlaveErrorRegistersDevice.
90
*/
91
class
SlaveErrorRegistersDevice
:
virtual
public
SensorDevice
92
{
93
public
:
94
SlaveErrorRegistersDevice
(
const
std::string& name, std::uint16_t slaveIndex) :
95
DeviceBase
(name),
SensorDevice
(name), slaveIndex(slaveIndex)
96
{
97
}
98
99
/**
100
* @see RtUtility:startLowLatencyMode
101
* @see armarx::control::ethercat::SlaveIdentifier::vendorID
102
*/
103
const
SensorValueBase
*
104
getSensorValue
()
const override
105
{
106
return
&
value
;
107
}
108
109
SlaveErrorRegistersSensorValue
value
;
110
111
void
updateValues
(
const
RegisterDataList
*
data
);
112
113
private
:
114
std::uint16_t slaveIndex;
115
};
116
117
}
// namespace armarx::control::ethercat
armarx::control::ethercat::TYPEDEF_PTRS_SHARED
TYPEDEF_PTRS_SHARED(SlaveErrorRegistersDevice)
armarx::control::ethercat::SlaveErrorRegistersDevice
Brief description of class SlaveErrorRegistersDevice.
Definition:
SlaveErrorRegistersDevice.h:91
armarx::control::ethercat::SlaveErrorRegistersSensorValue::frameErrorCounterPort1
std::uint8_t frameErrorCounterPort1
Definition:
SlaveErrorRegistersDevice.h:22
SensorDevice.h
armarx::SensorValueBase
The SensorValueBase class.
Definition:
SensorValueBase.h:40
armarx::control::ethercat::SlaveErrorRegistersSensorValue::linkLostCounterPort1
std::uint8_t linkLostCounterPort1
Definition:
SlaveErrorRegistersDevice.h:17
armarx::control::ethercat::SlaveErrorRegistersDevice::value
SlaveErrorRegistersSensorValue value
Definition:
SlaveErrorRegistersDevice.h:109
armarx::control::ethercat::SlaveErrorRegistersSensorValue::rxErrorCounterPort0
std::uint8_t rxErrorCounterPort0
Definition:
SlaveErrorRegistersDevice.h:26
armarx::control::ethercat::SlaveErrorRegistersDevice::SlaveErrorRegistersDevice
SlaveErrorRegistersDevice(const std::string &name, std::uint16_t slaveIndex)
Definition:
SlaveErrorRegistersDevice.h:94
armarx::introspection::ClassMemberInfo
Definition:
ClassMemberInfo.h:34
armarx::DeviceBase
Definition:
DeviceBase.h:29
armarx::control::ethercat::SlaveErrorRegistersSensorValue::frameErrorCounterPort0
std::uint8_t frameErrorCounterPort0
Definition:
SlaveErrorRegistersDevice.h:21
SlaveRegisters.h
SensorValueBase.h
armarx::SensorDevice
This class represents some part of the robot providing sensor values.
Definition:
SensorDevice.h:59
armarx::control::ethercat::RegisterDataList
Brief description of struct RegisterDataList.
Definition:
SlaveRegisters.h:313
armarx::control::ethercat::SlaveErrorRegistersSensorValue::GetClassMemberInfo
static SensorValueInfo< SlaveErrorRegistersSensorValue > GetClassMemberInfo()
Definition:
SlaveErrorRegistersDevice.h:38
armarx::introspection::ClassMemberInfo::addMemberVariable
EntryConfigurator< ClassType > addMemberVariable(MemberType ClassType::*ptr, const std::string &name)
add a member variable of the current class
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::SlaveErrorRegistersDevice::getSensorValue
const SensorValueBase * getSensorValue() const override
Definition:
SlaveErrorRegistersDevice.h:104
armarx::control::ethercat::SlaveErrorRegistersSensorValue::linkLostCounterPort0
DETAIL_SensorValueBase_DEFAULT_METHOD_IMPLEMENTATION std::uint8_t linkLostCounterPort0
Definition:
SlaveErrorRegistersDevice.h:16
DETAIL_SensorValueBase_DEFAULT_METHOD_IMPLEMENTATION
#define DETAIL_SensorValueBase_DEFAULT_METHOD_IMPLEMENTATION
Definition:
SensorValueBase.h:139
armarx::control::ethercat::SlaveErrorRegistersSensorValue
Definition:
SlaveErrorRegistersDevice.h:11
armarx::control::ethercat::SlaveErrorRegistersSensorValue::rxErrorCounterPort1
std::uint8_t rxErrorCounterPort1
Definition:
SlaveErrorRegistersDevice.h:27
armarx::control::ethercat::SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort1
std::uint8_t forwardedRxErrorCounterPort1
Definition:
SlaveErrorRegistersDevice.h:32
armarx
control
ethercat
SlaveErrorRegistersDevice.h
Generated on Sat Mar 29 2025 09:17:34 for armarx_documentation by
1.8.17