[Etherlab-users] Configuring EL7047 stepper driver
Fontana Nicola
ntd at entidi.it
Tue Aug 3 08:06:40 CEST 2021
Il giorno lun, 02/08/2021 alle 23.37 +0000, Gavin Lambert ha scritto:
> Yes, you're calling both now. Previously you had the "else-if" structured
> such that it wouldn't, though.
That snippet is a git repository. The original code (commit
433715bdd304) is:
if (layout->syncs != NULL && layout->n_syncs != 0 &&
ecrt_slave_config_pdos(sc, layout->n_syncs, layout->syncs) != 0) {
fprintf(stderr, "Failed to configure PDOs on slave %u-%u (%s module)\n",
alias, position, layout->name);
} else if (domain != NULL) {
autoregister_pdos(domain, sc, layout);
}
This, although a bit mind twisting, is functionally equivalent to the
current one, i.e. both `ecrt_slave_config_pdos` and `autoregister_pdos`
are called for all modules but the EK1100.
> ...
> The important point though is that it captures the pointer to the actual
> value, which you are currently discarding in your call and simply hoping that
> the data appears at the offsets you expect in your process image structure.
Yes, I'm not interested in storing byte or bit offsets. With "hoping"
you mean that libethercat can (at least theoretically) leave byte holes
inside the process image? That would certainly create issues here, as I
am implying everything is packed.
> (Which, to be fair, it always should -- until you move devices around in your
> network or upgrade a device to a later revision with a different data model.
> What you have works for now, but it's brittle. But if you're happy with that
> caveat, then fine.)
Can you expand a bit here? If the devices can be moved around I would
use aliases and if a new device cannot behave like the old one, that
would require some code rewrite. But I think those concerns are not
related to the fact I am "autoregistering" the PDO entries.
Ciao.
--
Nicola
More information about the Etherlab-users
mailing list