<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial; font-size: 12pt; color: #000000'>Hi,<br> I'm having some trouble registering PDOs in an application that I derived from the EtherCAT master "user" example and would appreciate any input you can offer. BTW, I'm a novice with Linux and EtherCAT, so if it's a dumb mistake I wouldn't be surprised and don't hesitate to say so ;)<br><br> The error I get is "Failed to register PDO entry: No such file or directory" when ecrt_domain_reg_pdo_entry_list is called. This happens with EthCAT Master v1.5 running on Ubuntu 11.10. I'm working with an EtherCAT drive from Elmo Motion Control and have implemented the patch posted by Jesper Smith (thanks Jesper!). Despite also implementing recommendations from other postings about this error I'm stuck.<br><br> Immediately below are outputs from "config", "pdos" and "slaves". Further below are the sections of code relevant to the PDO registration.
The PDO configuration is based o the output from "ethercat cstructs".<br><br> Any ideas are welcome and I'll gladly provide any additional information needed. Thanks in advance!<br><br>johnc@ubuntu:~$ sudo /opt/etherlab/bin/ethercat config -p0 -v<br>Alias: 0<br>Position: 0<br>Vendor Id: 0x0000009a<br>Product code: 0x00030924<br>Attached slave: 0 (PREOP)<br>Watchdog divider: (Default)<br>Watchdog intervals: (Default)<br>SM2, Dir: Output, Watchdog: Disable<br> PDO 0x1600<br> PDO entry 0x607a:00, 32 bit<br> PDO entry 0x60fe:01, 32 bit<br> PDO entry 0x6040:00, 16 bit<br>SM3, Dir: Input, Watchdog: Disable<br> PDO 0x1a00<br> PDO entry 0x6064:00, 32 bit<br> PDO entry 0x60fd:00, 32 bit<br> PDO entry 0x6041:00, 16 bit<br>SDO configuration:<br> None.<br>IDN configuration:<br> None.<br><br>johnc@ubuntu:~$ sudo /opt/etherlab/bin/ethercat pdos -p0 -v<br>SM0: PhysAddr 0x1800, DefaultSize 140, ControlRegister 0x26, Enable 1<br>SM1: PhysAddr 0x1900, DefaultSize 140, ControlRegister 0x22, Enable 1<br>SM2: PhysAddr 0x1100, DefaultSize 128, ControlRegister 0x24, Enable 1<br> RxPDO 0x1600 "RPDO1 Mapping"<br> PDO entry 0x607a:00, 32 bit, "Target position"<br> PDO entry 0x60fe:01, 32 bit, "Physical outputs"<br> PDO entry 0x6040:00, 16 bit, "Controlword"<br>SM3: PhysAddr 0x1180, DefaultSize 128, ControlRegister 0x20, Enable 1<br> TxPDO 0x1a00 "TPDO1 Mapping"<br> PDO entry 0x6064:00, 32 bit, "Position actual value"<br> PDO entry 0x60fd:00, 32 bit, "Digital inputs"<br> PDO entry 0x6041:00, 16 bit, "Statusword"<br><br><br>=== Master 0, Slave 0 ===<br>State: PREOP<br>Flag: +<br>Identity:<br> Vendor Id: 0x0000009a<br> Product code: 0x00030924<br> Revision number: 0x000103f6<br> Serial number: 0x00000000<br>DL information:<br> FMMU bit operation: no<br> Distributed clocks: yes, 64 bit<br> DC system time transmission delay: 0 ns<br>Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]<br> 0 MII up open yes - 1918471386 0 0<br> 1 MII down closed no - - - -<br> 2 N/A down closed no - - - -<br> 3 N/A down closed no - - - -<br>Mailboxes:<br> Bootstrap RX: 0x1800/140, TX: 0x1900/140<br> Standard RX: 0x1800/140, TX: 0x1900/140<br> Supported protocols: EoE, CoE, FoE<br>General:<br> Group: SimplIQ_GOLD<br> Image name: DRIVE<br> Order number: Elmo Drive<br> Device name: Gold EtherCAT GCON Drive Rev:0x000103F4<br> CoE details:<br> Enable SDO: yes<br> Enable SDO Info: yes<br> Enable PDO Assign: yes<br> Enable PDO Configuration: yes<br> Enable Upload at startup: no<br> Enable SDO complete access: yes<br> Flags:<br> Enable SafeOp: no<br> Enable notLRW: no<br> Current consumption: 0 mA<br><br><br><br>//Code relevant to PDO configuration/registration<br><br>#define SlavePos 0, 0<br>#define SLAVE 0x0000009a, 0x00030924<br><br>// offsets for PDO entries<br>static unsigned int off_slave_in;<br>static unsigned int off_slave_out;<br><br>const static ec_pdo_entry_reg_t domain1_regs[] = {<br> {SlavePos, SLAVE, 0x1600, 0,&off_slave_out},<br> {SlavePos, SLAVE, 0x1a00, 0,&off_slave_in},<br> {}<br>};<br><br>ec_pdo_entry_info_t slave_0_pdo_entries[] = {<br> {0x607a, 0x00, 32}, /* Target position */<br> {0x60fe, 0x01, 32}, /* Physical outputs */<br> {0x6040, 0x00, 16}, /* Controlword */<br> {0x6064, 0x00, 32}, /* Position actual value */<br> {0x60fd, 0x00, 32}, /* Digital inputs */<br> {0x6041, 0x00, 16}, /* Statusword */<br>};<br><br>ec_pdo_info_t slave_0_pdos[] = {<br> {0x1600, 3, slave_0_pdo_entries + 0}, /* RPDO1 Mapping */<br> {0x1a00, 3, slave_0_pdo_entries + 3}, /* TPDO1 Mapping */<br>};<br><br>ec_sync_info_t slave_0_syncs[] = {<br> {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},<br> {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},<br> {2, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_DISABLE},<br> {3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},<br> {0xff}<br>};<br><br><br>int main(int argc, char **argv)<br>{<br> ec_slave_config_t *sc;<br> <br> master = ecrt_request_master(0);<br> if (!master)<br> return -1;<br><br> domain1 = ecrt_master_create_domain(master);<br> if (!domain1)<br> return -1;<br><br> if (!(sc= ecrt_master_slave_config(<br> master, SlavePos, SLAVE))) {<br> fprintf(stderr, "Failed to get slave configuration.\n");<br> return -1;<br> }<br><br> printf("Configuring PDOs...\n");<br><br> if (ecrt_slave_config_pdos(sc, EC_END, slave_0_syncs)) {<br> fprintf(stderr, "Failed to configure PDOs.\n");<br> return -1;<br> }<br><br><br>//Error happens here<br> if (ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs)) {<br> fprintf(stderr, "PDO entry registration failed!\n");<br> return -1;<br> }<br><br>//code continues from here<br></div></body></html>