EtherCAT - Adding support for EL2252
02 Jul 2018 14:54 - 13 Jul 2018 09:31 #113236
by jmiceli
EtherCAT - Adding support for EL2252 was created by jmiceli
Hi all,
I'm implementing the support for Beckhoff EL2252 module (2x digital outputs).
In this module, the outputs switch at a time set by the user.
For my initial experiments, I like to use a PIN to ask for a output switch: when the pin value changes, the outputs switches state 1s later (in a second time, this pin will be use to set the switching time).
But how can I get the current time ? I've done many experiment (see some code below) and the app_time is like a constant / it does not change value.
Here is my test current code:
In the debug process, I also tried to print the current time using the RTAI and RTAPI functions directly in lcec_write_master(). There are also constant (which explains why app_time is constant...). I tried to see if the timer was correctly started: it is OK
APIs used:
Any idea why the RT timer are not running ? or how I can get the current time ?
thanks for your help
J-P
I'm implementing the support for Beckhoff EL2252 module (2x digital outputs).
In this module, the outputs switch at a time set by the user.
For my initial experiments, I like to use a PIN to ask for a output switch: when the pin value changes, the outputs switches state 1s later (in a second time, this pin will be use to set the switching time).
But how can I get the current time ? I've done many experiment (see some code below) and the app_time is like a constant / it does not change value.
Here is my test current code:
static void lcec_el2252_write(struct lcec_slave *slave, long period)
{
int ret;
ec_master_info_t master_info;
lcec_master_t *master = slave->master;
ret = ecrt_master(master->master, &master_info);
rtapi_print_msg(RTAPI_MSG_ALL, "== app time: %lld\n", (long long)master_info.app_time);
}
In the debug process, I also tried to print the current time using the RTAI and RTAPI functions directly in lcec_write_master(). There are also constant (which explains why app_time is constant...). I tried to see if the timer was correctly started: it is OK
APIs used:
// RTAPI
rtapi_get_time();
// RTAI
rt_get_time();
rt_get_time_ns();
rt_get_cpu_time();
rt_is_hard_timer_running();
Any idea why the RT timer are not running ? or how I can get the current time ?
thanks for your help
J-P
Last edit: 13 Jul 2018 09:31 by jmiceli.
Please Log in or Create an account to join the conversation.
Time to create page: 0.058 seconds