Motion Master
Loading...
Searching...
No Matches
soem_od_entry.h
Go to the documentation of this file.
1#pragma once
2
3#include "virtual_parameter.h"
4
6 public:
7 friend class Soem;
8 friend class Soes;
9 friend class SoemMaster;
10 friend class SoemSlave;
12
13 Type get_parameter_type() override;
14 uint16_t get_index() override;
15 uint8_t get_subindex() override;
16 bool is_pdo_mapped() override;
17 bool set_pdo_mapping(PdoMapping pdo_mapping);
18 uint64_t get_raw_value() override;
19 uint64_t get_raw_value(bool force_refresh) override;
20 int32_t get_int_value() override;
21 int32_t get_int_value(bool force_refresh) override;
22 float get_float_value() override;
23 float get_float_value(bool force_refresh) override;
24 std::string get_string_value() override;
25 std::string get_string_value(bool force_refresh) override;
26 bool get_value_status() override;
27 int32_t set_raw_value(uint64_t value) override;
28 int32_t set_value(int32_t value) override;
29 int32_t set_value(float value) override;
30 int32_t set_value(const std::string &value) override;
31 ValueType get_value_type() override;
32 std::string get_name() override;
33 std::string get_parent_name() override;
34 bool is_read() override;
35 bool is_write() override;
36 std::string get_unit() override;
37 int32_t get_min() override;
38 int32_t get_max() override;
39 bool is_value_fresh() override;
40
41 private:
42 uint16_t absolute_slave_position_;
43
44 uint16_t index_;
45 uint8_t subindex_;
46
47 uint8_t value_[128];
48
49 int32_t bit_length_;
50 uint8_t object_type_; // define(s) in co_dictionary.h
51 uint16_t entry_type_; // defined in ethercattype.h - ec_datatype
52 std::string name_;
53 std::string parent_name_;
54 uint16_t access_;
55 std::string unit_;
56 int32_t min_value_ = INT32_MIN;
57 int32_t max_value_ = INT32_MAX;
58
59 std::atomic_bool value_status_ = false;
60 std::atomic_bool value_initially_refreshed_ = false;
61
63
64 int32_t refresh_value();
65 int32_t set_value_sdo(uint64_t value);
66 int32_t set_value_sdo(float value);
67 int32_t set_value_sdo(const std::string &value);
68};
Definition: parameter_value_refresher.h:12
Definition: soem_master.h:9
Definition: soem_od_entry.h:5
friend class Soem
Definition: soem_od_entry.h:7
bool is_pdo_mapped() override
Check if the parameter is PDO mapped.
Definition: soem_od_entry.cc:19
bool set_pdo_mapping(PdoMapping pdo_mapping)
Definition: soem_od_entry.cc:23
int32_t get_int_value() override
Get the integer value of the parameter.
Definition: soem_od_entry.cc:42
std::string get_name() override
Get the name of the parameter.
Definition: soem_od_entry.cc:332
int32_t set_value(int32_t value) override
Set an integer value.
Definition: soem_od_entry.cc:142
friend class Soes
Definition: soem_od_entry.h:8
std::string get_parent_name() override
Get the parameter parent name.
Definition: soem_od_entry.cc:334
std::string get_unit() override
Get the defined unit of the parameter value.
Definition: soem_od_entry.cc:354
Type get_parameter_type() override
Get the type of the parameter.
Definition: soem_od_entry.cc:11
bool is_write() override
Definition: soem_od_entry.cc:352
ValueType get_value_type() override
Get the parameter value type.
Definition: soem_od_entry.cc:297
float get_float_value() override
Get the float value of the parameter.
Definition: soem_od_entry.cc:89
bool get_value_status() override
Check the current status of the parameter value.
Definition: soem_od_entry.cc:118
int32_t get_max() override
Get the maximum value the parameter should hold.
Definition: soem_od_entry.cc:358
bool is_read() override
Definition: soem_od_entry.cc:343
bool is_value_fresh() override
Check if the value is fresh.
Definition: soem_od_entry.cc:360
uint8_t get_subindex() override
Get the subindex of the parameter.
Definition: soem_od_entry.cc:17
int32_t get_min() override
Get the minimum value the parameter should hold.
Definition: soem_od_entry.cc:356
int32_t set_raw_value(uint64_t value) override
Set a raw (64-bit unsigned integer) value.
Definition: soem_od_entry.cc:120
uint16_t get_index() override
Get the index of the parameter.
Definition: soem_od_entry.cc:15
std::string get_string_value() override
Get the string value of the parameter.
Definition: soem_od_entry.cc:104
uint64_t get_raw_value() override
Get the raw (64-bit unsigned integer) value of the OD entry.
Definition: soem_od_entry.cc:28
Definition: soem_slave.h:17
Definition: virtual_parameter.h:9
PdoMapping
Definition: virtual_parameter.h:30
Type
Definition: virtual_parameter.h:11
ValueType
Definition: virtual_parameter.h:13
uint8_t * value
Definition: co_dictionary.h:9