Motion Master
Loading...
Searching...
No Matches
SoemOdEntry Class Reference

#include <soem_od_entry.h>

Inheritance diagram for SoemOdEntry:
Collaboration diagram for SoemOdEntry:

Public Member Functions

Type get_parameter_type () override
 Get the type of the parameter.
uint16_t get_index () override
 Get the index of the parameter.
uint8_t get_subindex () override
 Get the subindex of the parameter.
bool is_pdo_mapped () override
 Check if the parameter is PDO mapped.
bool set_pdo_mapping (PdoMapping pdo_mapping)
uint64_t get_raw_value () override
 Get the raw (64-bit unsigned integer) value of the OD entry.
uint64_t get_raw_value (bool force_refresh) override
 Get the raw (64-bit unsigned integer) value of the OD entry.
int32_t get_int_value () override
 Get the integer value of the parameter.
int32_t get_int_value (bool force_refresh) override
 Get the integer value of the parameter.
float get_float_value () override
 Get the float value of the parameter.
float get_float_value (bool force_refresh) override
 Get the float value of the parameter.
std::string get_string_value () override
 Get the string value of the parameter.
std::string get_string_value (bool force_refresh) override
 Get the string value of the parameter.
bool get_value_status () override
 Check the current status of the parameter value.
int32_t set_raw_value (uint64_t value) override
 Set a raw (64-bit unsigned integer) value.
int32_t set_value (int32_t value) override
 Set an integer value.
int32_t set_value (float value) override
 Set a float value.
int32_t set_value (const std::string &value) override
 Set a string value.
ValueType get_value_type () override
 Get the parameter value type.
std::string get_name () override
 Get the name of the parameter.
std::string get_parent_name () override
 Get the parameter parent name.
bool is_read () override
bool is_write () override
std::string get_unit () override
 Get the defined unit of the parameter value.
int32_t get_min () override
 Get the minimum value the parameter should hold.
int32_t get_max () override
 Get the maximum value the parameter should hold.
bool is_value_fresh () override
 Check if the value is fresh.
bool has_value () override
 Check if the parameter holds a value that was read at least once.
bool is_read_attempted () override
 Check if a read of the value has finished, successfully or not.
std::string get_last_error () override
 Get why the last read or write of the value failed.
Public Member Functions inherited from VirtualParameter
virtual ~VirtualParameter ()=default

Friends

class Soem
class Soes
class SoemMaster
class SoemSlave
class ParameterValueRefresher
void to_json (nlohmann::json &j, const SoemOdEntry &e)
void from_json (const nlohmann::json &j, SoemOdEntry &e)

Additional Inherited Members

Public Types inherited from VirtualParameter
enum class  Type {
  kNotDefined = 0 , kIghOdEntry , kSoemOdEntry , kMock ,
  kEthernetOdEntry
}
enum class  ValueType {
  kUnspecified = 0 , kBoolean , kInteger8 , kInteger16 ,
  kInteger32 , kUnsignedInteger8 , kUnsignedInteger16 , kUnsignedInteger32 ,
  kFloat , kString , kOctetString , kUnicodeString ,
  kEnum , kOther
}
enum class  PdoMapping { kNotPdoMapped , kRxPdoMapped , kTxPdoMapped }

Member Function Documentation

◆ get_float_value() [1/2]

float SoemOdEntry::get_float_value ( )
overridevirtual

Get the float value of the parameter.

Returns
the float value

Implements VirtualParameter.

◆ get_float_value() [2/2]

float SoemOdEntry::get_float_value ( bool force_refresh)
overridevirtual

Get the float value of the parameter.

Parameters
force_refreshforce the value refresh
Returns
the float value

Implements VirtualParameter.

◆ get_index()

uint16_t SoemOdEntry::get_index ( )
overridevirtual

Get the index of the parameter.

Returns
index of the parameter

Implements VirtualParameter.

◆ get_int_value() [1/2]

int32_t SoemOdEntry::get_int_value ( )
overridevirtual

Get the integer value of the parameter.

Returns
the integer value

Implements VirtualParameter.

◆ get_int_value() [2/2]

int32_t SoemOdEntry::get_int_value ( bool force_refresh)
overridevirtual

Get the integer value of the parameter.

Parameters
force_refreshforce the value refresh
Returns
the integer value

Implements VirtualParameter.

◆ get_last_error()

std::string SoemOdEntry::get_last_error ( )
overridevirtual

Get why the last read or write of the value failed.

Returns
the reason, for example "SDO abort 0x06090031: Value of parameter written too high", or an empty string when it succeeded or the reason is not known

Reimplemented from VirtualParameter.

◆ get_max()

int32_t SoemOdEntry::get_max ( )
overridevirtual

Get the maximum value the parameter should hold.

IMPORTANT: Not being used currently

Returns
the maximum value

Reimplemented from VirtualParameter.

◆ get_min()

int32_t SoemOdEntry::get_min ( )
overridevirtual

Get the minimum value the parameter should hold.

IMPORTANT: Not being used currently

Returns
the minimum value

Reimplemented from VirtualParameter.

◆ get_name()

std::string SoemOdEntry::get_name ( )
overridevirtual

Get the name of the parameter.

Returns
name of the parameter

Implements VirtualParameter.

◆ get_parameter_type()

VirtualParameter::Type SoemOdEntry::get_parameter_type ( )
overridevirtual

Get the type of the parameter.

Returns
type of the parameter (OD entry, MOCK, etc.)

Reimplemented from VirtualParameter.

◆ get_parent_name()

std::string SoemOdEntry::get_parent_name ( )
overridevirtual

Get the parameter parent name.

This is the name of the group a (sub-)parameter is a part of (the name of the parent parameter if it is an array or a record)

Returns
the parent name if any, otherwise empty

Implements VirtualParameter.

◆ get_raw_value() [1/2]

uint64_t SoemOdEntry::get_raw_value ( )
overridevirtual

Get the raw (64-bit unsigned integer) value of the OD entry.

Returns
the raw (64-bit unsigned integer) value

Implements VirtualParameter.

◆ get_raw_value() [2/2]

uint64_t SoemOdEntry::get_raw_value ( bool force_refresh)
overridevirtual

Get the raw (64-bit unsigned integer) value of the OD entry.

Parameters
force_refreshforce the value refresh
Returns
the raw (64-bit unsigned integer) value

Implements VirtualParameter.

◆ get_string_value() [1/2]

std::string SoemOdEntry::get_string_value ( )
overridevirtual

Get the string value of the parameter.

Parameters
force_refreshforce the value refresh
Returns
the string value

Implements VirtualParameter.

◆ get_string_value() [2/2]

std::string SoemOdEntry::get_string_value ( bool force_refresh)
overridevirtual

Get the string value of the parameter.

Parameters
force_refreshforce the value refresh
Returns
the string value

Implements VirtualParameter.

◆ get_subindex()

uint8_t SoemOdEntry::get_subindex ( )
overridevirtual

Get the subindex of the parameter.

Returns
subindex of the parameter

Implements VirtualParameter.

◆ get_unit()

std::string SoemOdEntry::get_unit ( )
overridevirtual

Get the defined unit of the parameter value.

Returns
the unit as a string

Reimplemented from VirtualParameter.

◆ get_value_status()

bool SoemOdEntry::get_value_status ( )
overridevirtual

Check the current status of the parameter value.

For example, the value of the parameter can fail to refresh.

Returns
true if status normal, false otherwise

Implements VirtualParameter.

◆ get_value_type()

VirtualParameter::ValueType SoemOdEntry::get_value_type ( )
overridevirtual

Get the parameter value type.

Returns
the value type

Implements VirtualParameter.

◆ has_value()

bool SoemOdEntry::has_value ( )
overridevirtual

Check if the parameter holds a value that was read at least once.

When true, the value getters return without reading the device. When the last read failed, the value is the last one read.

Returns
true if a value was read at least once, false otherwise

Reimplemented from VirtualParameter.

◆ is_pdo_mapped()

bool SoemOdEntry::is_pdo_mapped ( )
overridevirtual

Check if the parameter is PDO mapped.

IMPORTANT: Not available for all types of parameters

Returns
true if PDO mapped, false otherwise

Implements VirtualParameter.

◆ is_read()

bool SoemOdEntry::is_read ( )
overridevirtual

Returns true if the Service Data Object (SDO) can be read in any of the following states:

  • Bit 0: read access in Pre-Operational state
  • Bit 1: read access in Safe-Operational state-
  • Bit 2: read access in Operational state

Reimplemented from VirtualParameter.

◆ is_read_attempted()

bool SoemOdEntry::is_read_attempted ( )
overridevirtual

Check if a read of the value has finished, successfully or not.

Returns
true once the first read has finished, false before that

Reimplemented from VirtualParameter.

◆ is_value_fresh()

bool SoemOdEntry::is_value_fresh ( )
overridevirtual

Check if the value is fresh.

Returns
true if the value is fresh, false otherwise

Implements VirtualParameter.

◆ is_write()

bool SoemOdEntry::is_write ( )
overridevirtual

Returns true if the Service Data Object (SDO) can be written in any of the following states:

  • Bit 3: write access in Pre-Operational state
  • Bit 4: write access in Safe-Operational state
  • Bit 5: write access in Operational state

Reimplemented from VirtualParameter.

◆ set_pdo_mapping()

bool SoemOdEntry::set_pdo_mapping ( PdoMapping pdo_mapping)

◆ set_raw_value()

int32_t SoemOdEntry::set_raw_value ( uint64_t value)
overridevirtual

Set a raw (64-bit unsigned integer) value.

Parameters
valuevalue to set
Returns
zero if successful, non-zero otherwise

Implements VirtualParameter.

◆ set_value() [1/3]

int32_t SoemOdEntry::set_value ( const std::string & value)
overridevirtual

Set a string value.

Parameters
valuevalue to set
Returns
zero if successful, non-zero otherwise

Implements VirtualParameter.

◆ set_value() [2/3]

int32_t SoemOdEntry::set_value ( float value)
overridevirtual

Set a float value.

Parameters
valuevalue to set
Returns
zero if successful, non-zero otherwise

Implements VirtualParameter.

◆ set_value() [3/3]

int32_t SoemOdEntry::set_value ( int32_t value)
overridevirtual

Set an integer value.

Parameters
valuevalue to set
Returns
zero if successful, non-zero otherwise

Implements VirtualParameter.

◆ from_json

void from_json ( const nlohmann::json & j,
SoemOdEntry & e )
friend

◆ ParameterValueRefresher

friend class ParameterValueRefresher
friend

◆ Soem

friend class Soem
friend

◆ SoemMaster

friend class SoemMaster
friend

◆ SoemSlave

friend class SoemSlave
friend

◆ Soes

friend class Soes
friend

◆ to_json

void to_json ( nlohmann::json & j,
const SoemOdEntry & e )
friend

The documentation for this class was generated from the following files: