[Etherlab-users] Communicate with slave via terminal

Gabriel Forstner gabriel.forstner at corpowerocean.com
Wed Feb 24 07:39:05 CET 2021


Hi Sebastien,

Thanks for your reply! The output of the cstruct command is as follows:

ethercat cstruct -p0
/* Master 0, Slave 0, "LeineAndLinde Encoder"
 * Vendor ID:       0x00000194
 * Product code:    0x00000600
 * Revision number: 0x00000001
 */

ec_pdo_entry_info_t slave_0_pdo_entries[] = {
    {0x6004, 0x00, 32}, /* SubIndex 000 */
    {0x1001, 0x00, 16}, /* SubIndex 000 */
    {0x6503, 0x00, 16}, /* SubIndex 000 */
    {0x6505, 0x00, 16}, /* SubIndex 000 */
    {0x2060, 0x00, 32}, /* SubIndex 000 */
    {0x6030, 0x00, 16}, /* SubIndex 000 */
    {0x6040, 0x00, 16}, /* SubIndex 000 */
    {0x2100, 0x00, 16}, /* SubIndex 000 */
};

ec_pdo_info_t slave_0_pdos[] = {
    {0x1a00, 8, slave_0_pdo_entries + 0}, /* Configurable TxPDO map with max 8 PDO */
};

ec_sync_info_t slave_0_syncs[] = {
    {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
    {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
    {2, EC_DIR_OUTPUT, 0, NULL, EC_WD_ENABLE},
    {3, EC_DIR_INPUT, 1, slave_0_pdos + 0, EC_WD_DISABLE},
    {0xff}
};

Greetings,
Gabriel

-----Original Message-----
From: Etherlab-users <etherlab-users-bounces at etherlab.org> On Behalf Of Sebastien BLANCHET
Sent: Tuesday, February 23, 2021 6:50 PM
To: etherlab-users at etherlab.org
Subject: Re: [Etherlab-users] Communicate with slave via terminal

Hi,


Could you specify the exact model of your slave ?

Could you post the output of
"ethercat cstruct -p0"



---
Sebastien BLANCHET

Le 23/02/2021 à 18:24, Gabriel Forstner a écrit :
> Dear etherlab-users,
> 
> I am quite new to the use of ethercat in linux and struggling to get a 
> particular slave from state PREOP to OP, and to read values of this 
> slave. I have found some commends on this topic already, where it is 
> suggested to do a “reg_write” at “0x500 -tbool 1”. Other suggested to 
> generate a SII file out of an XML file with TwinCAT and to download it 
> to the slave. I did both but without success. The slave I am 
> struggling with is an absolute encoder, and the problem might be 
> related to the memory architecture of the EEPROM.
> 
> I am using “ethercat version IgH EtherCAT master 1.5.2” on “Ubuntu
> 20.04.2 LTS” with “uname -r 5.4.84-rt47” kernel.
> 
> First, I am wondering if it is required to have an application in 
> order to communicate with slaves or is this also possible via the 
> terminal. I can do the following in the terminal:
> 
>   * When I enter “sudo ethercat slaves” all connected slaves a listed,
>     so I assume that the bus topology is correctly recognized.
>   * I can list all sdos with “sudo ethercat sdos -p0”, e.g., SDO 0x6004,
>     "Position value" 0x6004:00, r-r-r-, uint32, 32 bit, "SubIndex 000".
>   * I *do not* receive the correct position values, e.g., when I read
>     the position sdo with “sudo ethercat upload -p0 -tuint32 0x6004 0” I
>     receive “0x00000000 0”. When I enter ”dmesg” I receive three error
>     massages: “SDO download 0x6004 (4 bytes) aborted.”, “SDO abort
>     message 0x06010000: "Unsupported access to an object".”, and “Failed
>     to process SDO request.”. However, a meaningful value is displayed
>     in TwinCAT.
>   * I *cannot* change the state of the slaves to OP via the terminal.
> 
> Second, I am wondering if the reg_write can be done in the terminal 
> (which appears not work in my case):
> 
>  1. Change state “sudo ethercat state -p0 INIT” works.
>  2. Do “sudo ethercat -p0 reg_write 0x500 -tbool 1” appear to work.
>  3. Change state “sudo ethercat state -p0 PREOP” works.
>  4. Change state “sudo ethercat state -p0 SAFEOP” *does not work*. When
>     I enter ”dmesg” I receive two error massages: “Failed to set SAFEOP
>     state, slave refused state change (PREOP + ERROR)” and “AL status
>     message 0x001E: "Invalid input configuration”.”.
> 
> I would appreciate it a lot if somebody could answer me my question!
> 
> Kind regards,
> 
> Gabriel
> 
> ______________________________________________________________________
> _______
> 
> *Gabriel Forstner*, /Senior Software and Automation Engineer /
> 
> CorPower Ocean *
> *Västberga Allé 60, 126 30 Hägersten
> M: +46 73 155 88 88
> 
> www.corpowerocean.com<http://www.corpowerocean.com/>
> 
> 
--
Etherlab-users mailing list
Etherlab-users at etherlab.org
https://lists.etherlab.org/mailman/listinfo/etherlab-users


More information about the Etherlab-users mailing list