Motion Master
Loading...
Searching...
No Matches
ethernet_od_entry.h
Go to the documentation of this file.
1#include "comm/base.h"
2#include "comm/spoe.h"
3#include "virtual_parameter.h"
4
6 public:
7 friend class EthernetMaster;
8 friend class EthernetSlave;
10
11 EthernetOdEntry(mm::comm::spoe::Device &ed, uint16_t index, uint8_t subindex);
12 EthernetOdEntry(mm::comm::spoe::Device &ed, uint16_t index, uint8_t subindex,
13 const std::vector<uint8_t> &value);
14
15 Type get_parameter_type() override;
16 uint16_t get_index() override;
17 uint8_t get_subindex() override;
18 bool is_pdo_mapped() override;
19 bool set_pdo_mapping(PdoMapping pdo_mapping);
20 uint64_t get_raw_value() override;
21 uint64_t get_raw_value(bool force_refresh) override;
22 int32_t get_int_value() override;
23 int32_t get_int_value(bool force_refresh) override;
24 float get_float_value() override;
25 float get_float_value(bool force_refresh) override;
26 std::string get_string_value() override;
27 std::string get_string_value(bool force_refresh) override;
28 bool get_value_status() override;
29 int32_t set_raw_value(uint64_t value) override;
30 int32_t set_value(int32_t value) override;
31 int32_t set_value(float value) override;
32 int32_t set_value(const std::string &value) override;
33 ValueType get_value_type() override;
34 std::string get_name() override;
35 std::string get_parent_name() override;
36 bool is_read() override;
37 bool is_write() override;
38 std::string get_unit() override;
39 int32_t get_min() override;
40 int32_t get_max() override;
41 bool is_value_fresh() override;
42
43 int32_t refresh_value();
44
45 private:
46 uint16_t absolute_slave_position_;
47
48 uint16_t index_;
49 uint8_t subindex_;
50
51 uint8_t value_[128];
52
53 int32_t bit_length_;
54 uint8_t object_type_; // define(s) in co_dictionary.h
55 uint16_t entry_type_; // defined in ethercattype.h - ec_datatype
56 std::string name_;
57 std::string parent_name_;
58 uint16_t access_;
59 std::string unit_;
60 int32_t min_value_ = INT32_MIN;
61 int32_t max_value_ = INT32_MAX;
62
63 bool value_status_ = false; // used to be std::atomic_bool
64 bool value_initially_refreshed_ = false; // used to be std::atomic_bool
65
67 mm::comm::base::Parameter &parameter_;
68};
Definition: ethernet_master.h:11
Definition: ethernet_od_entry.h:5
std::string get_parent_name() override
Get the parameter parent name.
Definition: ethernet_od_entry.cc:135
bool is_pdo_mapped() override
Check if the parameter is PDO mapped.
Definition: ethernet_od_entry.cc:38
int32_t set_value(int32_t value) override
Set an integer value.
Definition: ethernet_od_entry.cc:200
bool is_value_fresh() override
Check if the value is fresh.
Definition: ethernet_od_entry.cc:147
ValueType get_value_type() override
Get the parameter value type.
Definition: ethernet_od_entry.cc:266
int32_t get_max() override
Get the maximum value the parameter should hold.
Definition: ethernet_od_entry.cc:145
uint8_t get_subindex() override
Get the subindex of the parameter.
Definition: ethernet_od_entry.cc:36
bool is_write() override
Check if the parameter can be written into.
Definition: ethernet_od_entry.cc:139
Type get_parameter_type() override
Get the type of the parameter.
Definition: ethernet_od_entry.cc:30
int32_t set_raw_value(uint64_t value) override
Set a raw (64-bit unsigned integer) value.
Definition: ethernet_od_entry.cc:178
int32_t get_int_value() override
Get the integer value of the parameter.
Definition: ethernet_od_entry.cc:62
int32_t get_min() override
Get the minimum value the parameter should hold.
Definition: ethernet_od_entry.cc:143
uint16_t get_index() override
Get the index of the parameter.
Definition: ethernet_od_entry.cc:34
std::string get_unit() override
Get the defined unit of the parameter value.
Definition: ethernet_od_entry.cc:141
bool get_value_status() override
Check the current status of the parameter value.
Definition: ethernet_od_entry.cc:131
int32_t refresh_value()
Definition: ethernet_od_entry.cc:155
bool set_pdo_mapping(PdoMapping pdo_mapping)
Definition: ethernet_od_entry.cc:43
std::string get_name() override
Get the name of the parameter.
Definition: ethernet_od_entry.cc:133
std::string get_string_value() override
Get the string value of the parameter.
Definition: ethernet_od_entry.cc:113
uint64_t get_raw_value() override
Get the raw (64-bit unsigned integer) value of the OD entry.
Definition: ethernet_od_entry.cc:48
float get_float_value() override
Get the float value of the parameter.
Definition: ethernet_od_entry.cc:99
bool is_read() override
Check if the parameter can be read.
Definition: ethernet_od_entry.cc:137
Definition: ethernet_slave.h:5
Definition: parameter_value_refresher.h:12
Definition: virtual_parameter.h:9
PdoMapping
Definition: virtual_parameter.h:36
Type
Definition: virtual_parameter.h:11
ValueType
Definition: virtual_parameter.h:19
Represents a device parameter identified by index and subindex.
Definition: base.h:463
Handles TCP communication with SOMANET devices over SPoE.
Definition: spoe.h:298
uint8_t * value
Definition: co_dictionary.h:9
uint16_t index
Definition: co_dictionary.h:0