Commit b451f655 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Use operational output of ethercat block for safety.

parent 97fe63ef
......@@ -87,7 +87,7 @@ links {
{ "azimuth_spg", "v", "azimuth_servo_state", "spg_v" , true }
{ "azimuth_spg", "a", "azimuth_servo_state", "spg_a" , true }
{ "azimuth_safety", "safe_out", "azimuth_safe_and", "a" , false }
{ "ethercat", "pdo_data", "azimuth_safe_and", "b" , true }
{ "ethercat", "operational","azimuth_safe_and", "b" , true }
{ "azimuth_safe_and", "q", "azimuth_servo_state", "safe" , true }
{ "azimuth_servo_state", "out_x", "azimuth_error", "positive" , true }
{ "azimuth_position_offset_sum", "out", "azimuth_setpoint_error", "negative" , true }
......@@ -120,7 +120,7 @@ links {
{ "elevation_spg", "v", "elevation_servo_state", "spg_v" , true }
{ "elevation_spg", "a", "elevation_servo_state", "spg_a" , true }
{ "elevation_safety", "safe_out", "elevation_safe_and", "a" , false }
{ "ethercat", "pdo_data", "elevation_safe_and", "b" , true }
{ "ethercat", "operational","elevation_safe_and", "b" , true }
{ "elevation_safe_and", "q", "elevation_servo_state", "safe" , true }
{ "elevation_servo_state", "out_x", "elevation_error", "positive" , true }
{ "elevation_servo_state", "out_v", "elevation_speed_ff", "in0" , true }
......
......@@ -27,6 +27,7 @@ struct controller_block *ec_block;
struct controller_block_private {
bool pdo_data;
bool operational;
};
static void param_set(struct controller_block *ec, int param, va_list val)
......@@ -34,6 +35,7 @@ static void param_set(struct controller_block *ec, int param, va_list val)
int enabled = va_arg(val, int);
ec->private->pdo_data = enabled;
ec->private->operational = enabled;
}
static struct controller_block_param_list params[] = {
......@@ -42,7 +44,8 @@ static struct controller_block_param_list params[] = {
};
static struct controller_block_outterm_list outterms[] = {
{ "pdo_data", CONTROLLER_BLOCK_TERM_BOOL, offsetof(struct controller_block_private, pdo_data) },
{ "pdo_data", CONTROLLER_BLOCK_TERM_BOOL, offsetof(struct controller_block_private, pdo_data) },
{ "operational", CONTROLLER_BLOCK_TERM_BOOL, offsetof(struct controller_block_private, operational) },
{ NULL },
};
......@@ -63,6 +66,7 @@ struct controller_block * block_ec_sim_create(char *name, va_list ap)
goto err;
ec->private->pdo_data = true;
ec->private->operational = true;
if (controller_block_outterm_list_init(ec, outterms))
goto err_ec;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment