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
// std::uint8_t forwardedRxErrorCounterPort2{0};
34
// std::uint8_t forwardedRxErrorCounterPort3{0};
35
36
static
SensorValueInfo<SlaveErrorRegistersSensorValue>
37
GetClassMemberInfo
()
38
{
39
SensorValueInfo<SlaveErrorRegistersSensorValue>
svi;
40
41
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::linkLostCounterPort0
,
42
"LinkLostCounter.Port0"
);
43
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::linkLostCounterPort1
,
44
"LinkLostCounter.Port1"
);
45
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::linkLostCounterPort2,
46
// "LinkLostCounter.Port2");
47
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::linkLostCounterPort3,
48
// "LinkLostCounter.Port3");
49
50
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::frameErrorCounterPort0
,
51
"FrameErrorCounter.Port0"
);
52
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::frameErrorCounterPort1
,
53
"FrameErrorCounter.Port1"
);
54
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::frameErrorCounterPort2,
55
// "FrameErrorCounter.Port2");
56
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::frameErrorCounterPort3,
57
// "FrameErrorCounter.Port3");
58
59
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::rxErrorCounterPort0
,
60
"RxErrorCounter.Port0"
);
61
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::rxErrorCounterPort1
,
62
"RxErrorCounter.Port1"
);
63
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::rxErrorCounterPort2,
64
// "RxErrorCounter.Port2");
65
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::rxErrorCounterPort3,
66
// "RxErrorCounter.Port3");
67
68
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort0
,
69
"ForwardedRxErrorCounter.Port0"
);
70
svi.
addMemberVariable
(&
SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort1
,
71
"ForwardedRxErrorCounter.Port1"
);
72
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort2,
73
// "ForwardedRxErrorCounter.Port2");
74
// svi.addMemberVariable(&SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort3,
75
// "ForwardedRxErrorCounter.Port3");
76
77
return
svi;
78
}
79
};
80
81
TYPEDEF_PTRS_SHARED
(SlaveErrorRegistersDevice);
82
83
/**
84
* @class SlaveErrorRegistersDevice
85
* @ingroup Library-ethercat
86
* @brief Brief description of class SlaveErrorRegistersDevice.
87
*
88
* Detailed description of class SlaveErrorRegistersDevice.
89
*/
90
class
SlaveErrorRegistersDevice
:
virtual
public
SensorDevice
91
{
92
public
:
93
SlaveErrorRegistersDevice
(
const
std::string& name, std::uint16_t slaveIndex) :
94
DeviceBase
(name),
SensorDevice
(name), slaveIndex(slaveIndex)
95
{
96
}
97
98
/**
99
* @see RtUtility:startLowLatencyMode
100
* @see armarx::control::ethercat::SlaveIdentifier::vendorID
101
*/
102
const
SensorValueBase
*
103
getSensorValue
()
const override
104
{
105
return
&
value
;
106
}
107
108
SlaveErrorRegistersSensorValue
value
;
109
110
void
updateValues
(
const
RegisterDataList
*
data
);
111
112
private
:
113
std::uint16_t slaveIndex;
114
};
115
116
}
// 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:90
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:108
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:93
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:316
armarx::control::ethercat::SlaveErrorRegistersSensorValue::GetClassMemberInfo
static SensorValueInfo< SlaveErrorRegistersSensorValue > GetClassMemberInfo()
Definition:
SlaveErrorRegistersDevice.h:37
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:103
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 Oct 12 2024 09:14:14 for armarx_documentation by
1.8.17