43 [](Device& device,
const Value&) -> Value {
44 device.set_entry(
"controlword", (uint16_t) 0x0006);
45 device.set_entry(
"controlword", (uint16_t) 0x0007);
46 device.set_entry(
"controlword", (uint16_t) 0x000F);
51 "set_controlword_flag",
52 [](Device& device,
const Value& flag_name) -> Value {
53 DEBUG_LOG(
"Set controlword flag "<<flag_name);
54 const uint16_t cw = device.get_entry(
"controlword");
55 const uint16_t flag = device.get_constant(flag_name);
56 device.set_entry(
"controlword", static_cast<uint16_t>(cw | flag));
61 "unset_controlword_flag",
62 [](Device& device,
const Value& flag_name) -> Value {
63 DEBUG_LOG(
"Unset controlword flag "<<flag_name);
64 const uint16_t cw = device.get_entry(
"controlword");
65 const uint16_t flag = device.get_constant(flag_name);
66 device.set_entry(
"controlword", static_cast<uint16_t>(cw & ~flag));
71 "set_target_position",
72 [](Device& device,
const Value& target_position) -> Value {
73 DEBUG_LOG(
"Set target pos to "<<target_position);
74 device.set_entry(
"Target position", target_position);
75 device.execute(
"set_controlword_flag",
"controlword_pp_new_set_point");
76 device.execute(
"unset_controlword_flag",
"controlword_pp_new_set_point");
89 {
"profile_position_mode",
static_cast<int8_t
>(1) },
90 {
"velocity_mode",
static_cast<int8_t
>(2) },
91 {
"profile_velocity_mode",
static_cast<int8_t
>(3) },
92 {
"torque_profile_mode",
static_cast<int8_t
>(4) },
93 {
"homing_mode",
static_cast<int8_t
>(6) },
94 {
"interpolated_position_mode",
static_cast<int8_t
>(7) },
97 {
"controlword_switch_on",
static_cast<uint16_t
>(1<<0) },
98 {
"controlword_enable_voltage",
static_cast<uint16_t
>(1<<1) },
99 {
"controlword_quick_stop",
static_cast<uint16_t
>(1<<2) },
100 {
"controlword_enable_operation",
static_cast<uint16_t
>(1<<3) },
101 {
"controlword_fault_reset",
static_cast<uint16_t
>(1<<7) },
102 {
"controlword_halt",
static_cast<uint16_t
>(1<<8) },
105 {
"controlword_manufacturer_11",
static_cast<uint16_t
>(1<<11) },
106 {
"controlword_manufacturer_12",
static_cast<uint16_t
>(1<<12) },
107 {
"controlword_manufacturer_13",
static_cast<uint16_t
>(1<<13) },
108 {
"controlword_manufacturer_14",
static_cast<uint16_t
>(1<<14) },
109 {
"controlword_manufacturer_15",
static_cast<uint16_t
>(1<<15) },
112 {
"controlword_vl_rfg_enable",
static_cast<uint16_t
>(1<<4) },
113 {
"controlword_vl_rfg_unlock",
static_cast<uint16_t
>(1<<5) },
114 {
"controlword_vl_use_ref",
static_cast<uint16_t
>(1<<6) },
117 {
"controlword_pp_new_set_point",
static_cast<uint16_t
>(1<<4) },
118 {
"controlword_pp_change_set_immediately",
static_cast<uint16_t
>(1<<5) },
119 {
"controlword_pp_abs_rel",
static_cast<uint16_t
>(1<<6) },
122 {
"controlword_hm_operation_start",
static_cast<uint16_t
>(1<<4) },
125 {
"controlword_ip_enable_ip_mode",
static_cast<uint16_t
>(1<<4) },
128 {
"statusword_ready_to_switch_on",
static_cast<uint16_t
>(1<<0) },
129 {
"statusword_switched_on",
static_cast<uint16_t
>(1<<1) },
130 {
"statusword_operation_enabled",
static_cast<uint16_t
>(1<<2) },
131 {
"statusword_fault",
static_cast<uint16_t
>(1<<3) },
132 {
"statusword_voltage_enabled",
static_cast<uint16_t
>(1<<4) },
133 {
"statusword_quick_stop",
static_cast<uint16_t
>(1<<5) },
134 {
"statusword_switch_on_disabled",
static_cast<uint16_t
>(1<<6) },
135 {
"statusword_warning",
static_cast<uint16_t
>(1<<7) },
136 {
"statusword_remote",
static_cast<uint16_t
>(1<<9) },
137 {
"statusword_target_reached",
static_cast<uint16_t
>(1<<10) },
138 {
"statusword_internal_limit_active",
static_cast<uint16_t
>(1<<11) },
141 {
"statusword_manufacturer_8",
static_cast<uint16_t
>(1<<8) },
142 {
"statusword_manufacturer_14",
static_cast<uint16_t
>(1<<14) },
143 {
"statusword_manufacturer_15",
static_cast<uint16_t
>(1<<15) },
146 {
"statusword_pp_set_point_acknowledge",
static_cast<uint16_t
>(1<<12) },
147 {
"statusword_pp_following_error",
static_cast<uint16_t
>(1<<13) },
150 {
"statusword_pv_speed",
static_cast<uint16_t
>(1<<12) },
151 {
"statusword_pv_max_slippage_error",
static_cast<uint16_t
>(1<<13) },
154 {
"statusword_hm_homing_attained",
static_cast<uint16_t
>(1<<12) },
155 {
"statusword_hm_homing_error",
static_cast<uint16_t
>(1<<13) },
158 {
"statusword_ip_ip_mode_active",
static_cast<uint16_t
>(1<<12) }
static const std::map< uint16_t, std::map< std::string, const Operation > > operations
Convenience operations for CiA profiles. Type: map < profile number , map < operation name ...
static const std::map< uint16_t, std::map< std::string, const Value > > constants
Constants for CiA profiles. Type: map < profile number , map < operation name , constant value > > ...