[Etherlab-users] Configuring EL7047 stepper driver

Gavin Lambert gavin.lambert at tomra.com
Tue Aug 3 01:37:15 CEST 2021


Yes, you're calling both now.  Previously you had the "else-if" structured such that it wouldn't, though.

ecrt_domain_reg_pdo_entry_list doesn't require a *static* array (although that's used in the examples); you can build a temporary array if you wish, although then you're back to needing a loop.

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.  (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.)


Gavin Lambert
Senior Software Developer TOMRA Fresh Food

 


COMPAC SORTING EQUIPMENT LTD | 4 Henderson Pl | Onehunga | Auckland 1061 | New Zealand
Switchboard: +49 2630 96520 | https://www.tomra.com

The information contained in this communication and any attachment is confidential and may be legally privileged. It should only be read by the person(s) to whom it is addressed. If you have received this communication in error, please notify the sender and delete the communication.
-----Original Message-----
From: Fontana Nicola <ntd at entidi.it> 
Sent: Tuesday, 3 August 2021 12:36 am
To: Gavin Lambert <gavin.lambert at tomra.com>; etherlab-users at etherlab.org
Subject: Re: [Etherlab-users] Configuring EL7047 stepper driver

Il giorno lun, 02/08/2021 alle 13.50 +0200, Fontana Nicola ha scritto:
>
> Il giorno dom, 01/08/2021 alle 22.55 +0000, Gavin Lambert ha scritto:
> > Why are you calling ecrt_slave_config_pdos *OR* 
> > ecrt_slave_config_reg_pdo_entry?  You need to do both things.
>
> Hi Gavin,
>
> I am calling both.

I've just cleaned up the code and added some comment, hopefully making the intentions clearer.

> > (Although you can replace the latter with 
> > ecrt_domain_reg_pdo_entry_list to avoid a loop in your own code.)
>
> Good catch, thank you: I'll check if I can drop that 
> `autoregister_pdos` function and will update the snippet accordingly.

AFAIU, `ecrt_domain_reg_pdo_entry_list` requires another explicit static array. This is a big no from my point of view, where I am struggling to keep complexity as low as possible by using conventions instead of explicit lists.

Ciao.
--
Nicola




More information about the Etherlab-users mailing list