Hello,
attached patch will circumvent the misbehaviour but slows down bus
initialization....
Regards Wilhelm.
Am 21.12.2016 um 11:30 schrieb Dr. Ing. Olaf Marthiens:
Hello,
we have the same problem with the EL3356-0010. With the EtherCAT
Configurator 2.11 all is ok.
Have anyone a solution ?
With kind regards,
Olaf Marthiens.
-----Ursprüngliche Nachricht-----
Von: etherlab-users [mailto:[email protected]] Im Auftrag
von Dr.-Ing. Wilhelm Hagemeister
Gesendet: Dienstag, 8. November 2016 16:46
An: [email protected]
Betreff: [etherlab-users] Beckhoff Terminal EL3356 possibly has a timing
issue?
Hallo,
we observe with the Ethercat terminal EL3356 a timing issue and would like
to know if other users of the EtherLab EtherCat-Master experience this as
well:
The ethercat master writes the configuration SDO's before the transition
from PREOP to SAFEOP. We observe that if the transition to SAFEOP happens to
quick (<100ms) after writing the SDO's the process data from the terminal is
"wrong" or the terminal does not switch to OP.
It "feels" like the terminal is not ready with configuration after
SDO-writing and the request to switch to SAFEOP comes to early.
Has anybody else similar experiences (maybe also with other masters)?
With kind regards
Wilhelm Hagemeister.
_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users
_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users
diff -r a1079c6242a5 master/fsm_slave_config.c
--- a/master/fsm_slave_config.c Tue Oct 18 10:20:47 2016 +0200
+++ b/master/fsm_slave_config.c Tue Dec 06 13:59:37 2016 +0100
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * $Id$
+ * $Id: fsm_slave_config.c,v 7690a5df7539 2016/09/16 10:35:09 fp $
*
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
*
@@ -85,6 +85,7 @@
void ec_fsm_slave_config_state_dc_sync_check(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_state_dc_start(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_state_dc_assign(ec_fsm_slave_config_t *);
+void ec_fsm_slave_config_state_wait_safeop(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_state_safeop(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_state_soe_conf_safeop(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_state_op(ec_fsm_slave_config_t *);
@@ -105,6 +106,7 @@
void ec_fsm_slave_config_enter_pdo_sync(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_enter_fmmu(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_enter_dc_cycle(ec_fsm_slave_config_t *);
+void ec_fsm_slave_config_enter_wait_safeop(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_enter_safeop(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_enter_soe_conf_safeop(ec_fsm_slave_config_t *);
void ec_fsm_slave_config_enter_op(ec_fsm_slave_config_t *);
@@ -1198,7 +1200,7 @@
const ec_sync_t *sync;
if (!slave->config) {
- ec_fsm_slave_config_enter_safeop(fsm);
+ ec_fsm_slave_config_enter_wait_safeop(fsm);
return;
}
@@ -1303,7 +1305,7 @@
fsm->state = ec_fsm_slave_config_state_dc_cycle;
} else {
// DC are unused
- ec_fsm_slave_config_enter_safeop(fsm);
+ ec_fsm_slave_config_enter_wait_safeop(fsm);
}
}
@@ -1527,6 +1529,44 @@
return;
}
+ ec_fsm_slave_config_enter_wait_safeop(fsm);
+}
+
+/*****************************************************************************/
+
+/** Wait before SAFEOP transition.
+ */
+void ec_fsm_slave_config_enter_wait_safeop(
+ ec_fsm_slave_config_t *fsm /**< slave state machine */
+ )
+{
+ fsm->state = ec_fsm_slave_config_state_wait_safeop;
+
+ /* dummy read */
+ ec_datagram_fprd(fsm->datagram, fsm->slave->station_address, 0x0600, 1);
+
+ fsm->jiffies_start = jiffies;
+}
+
+/*****************************************************************************/
+
+/** Time in [ms] to wait before going to SAFEOP.
+ * Workaround for broken slave Beckhoff EL3356.
+ */
+#define WAIT_SAFEOP_MS 100
+
+/** Slave configuration state: WAIT SAFEOP.
+ */
+void ec_fsm_slave_config_state_wait_safeop(
+ ec_fsm_slave_config_t *fsm /**< slave state machine */
+ )
+{
+ unsigned long diff = jiffies - fsm->jiffies_start;
+
+ if ((unsigned int) diff * 1000 / HZ < WAIT_SAFEOP_MS) {
+ return;
+ }
+
ec_fsm_slave_config_enter_safeop(fsm);
}
_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users