Hi, 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 ;)
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. 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". Any ideas are welcome and I'll gladly provide any additional information needed. Thanks in advance! johnc@ubuntu:~$ sudo /opt/etherlab/bin/ethercat config -p0 -v Alias: 0 Position: 0 Vendor Id: 0x0000009a Product code: 0x00030924 Attached slave: 0 (PREOP) Watchdog divider: (Default) Watchdog intervals: (Default) SM2, Dir: Output, Watchdog: Disable PDO 0x1600 PDO entry 0x607a:00, 32 bit PDO entry 0x60fe:01, 32 bit PDO entry 0x6040:00, 16 bit SM3, Dir: Input, Watchdog: Disable PDO 0x1a00 PDO entry 0x6064:00, 32 bit PDO entry 0x60fd:00, 32 bit PDO entry 0x6041:00, 16 bit SDO configuration: None. IDN configuration: None. johnc@ubuntu:~$ sudo /opt/etherlab/bin/ethercat pdos -p0 -v SM0: PhysAddr 0x1800, DefaultSize 140, ControlRegister 0x26, Enable 1 SM1: PhysAddr 0x1900, DefaultSize 140, ControlRegister 0x22, Enable 1 SM2: PhysAddr 0x1100, DefaultSize 128, ControlRegister 0x24, Enable 1 RxPDO 0x1600 "RPDO1 Mapping" PDO entry 0x607a:00, 32 bit, "Target position" PDO entry 0x60fe:01, 32 bit, "Physical outputs" PDO entry 0x6040:00, 16 bit, "Controlword" SM3: PhysAddr 0x1180, DefaultSize 128, ControlRegister 0x20, Enable 1 TxPDO 0x1a00 "TPDO1 Mapping" PDO entry 0x6064:00, 32 bit, "Position actual value" PDO entry 0x60fd:00, 32 bit, "Digital inputs" PDO entry 0x6041:00, 16 bit, "Statusword" === Master 0, Slave 0 === State: PREOP Flag: + Identity: Vendor Id: 0x0000009a Product code: 0x00030924 Revision number: 0x000103f6 Serial number: 0x00000000 DL information: FMMU bit operation: no Distributed clocks: yes, 64 bit DC system time transmission delay: 0 ns Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns] 0 MII up open yes - 1918471386 0 0 1 MII down closed no - - - - 2 N/A down closed no - - - - 3 N/A down closed no - - - - Mailboxes: Bootstrap RX: 0x1800/140, TX: 0x1900/140 Standard RX: 0x1800/140, TX: 0x1900/140 Supported protocols: EoE, CoE, FoE General: Group: SimplIQ_GOLD Image name: DRIVE Order number: Elmo Drive Device name: Gold EtherCAT GCON Drive Rev:0x000103F4 CoE details: Enable SDO: yes Enable SDO Info: yes Enable PDO Assign: yes Enable PDO Configuration: yes Enable Upload at startup: no Enable SDO complete access: yes Flags: Enable SafeOp: no Enable notLRW: no Current consumption: 0 mA //Code relevant to PDO configuration/registration #define SlavePos 0, 0 #define SLAVE 0x0000009a, 0x00030924 // offsets for PDO entries static unsigned int off_slave_in; static unsigned int off_slave_out; const static ec_pdo_entry_reg_t domain1_regs[] = { {SlavePos, SLAVE, 0x1600, 0,&off_slave_out}, {SlavePos, SLAVE, 0x1a00, 0,&off_slave_in}, {} }; ec_pdo_entry_info_t slave_0_pdo_entries[] = { {0x607a, 0x00, 32}, /* Target position */ {0x60fe, 0x01, 32}, /* Physical outputs */ {0x6040, 0x00, 16}, /* Controlword */ {0x6064, 0x00, 32}, /* Position actual value */ {0x60fd, 0x00, 32}, /* Digital inputs */ {0x6041, 0x00, 16}, /* Statusword */ }; ec_pdo_info_t slave_0_pdos[] = { {0x1600, 3, slave_0_pdo_entries + 0}, /* RPDO1 Mapping */ {0x1a00, 3, slave_0_pdo_entries + 3}, /* TPDO1 Mapping */ }; 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, 1, slave_0_pdos + 0, EC_WD_DISABLE}, {3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE}, {0xff} }; int main(int argc, char **argv) { ec_slave_config_t *sc; master = ecrt_request_master(0); if (!master) return -1; domain1 = ecrt_master_create_domain(master); if (!domain1) return -1; if (!(sc= ecrt_master_slave_config( master, SlavePos, SLAVE))) { fprintf(stderr, "Failed to get slave configuration.\n"); return -1; } printf("Configuring PDOs...\n"); if (ecrt_slave_config_pdos(sc, EC_END, slave_0_syncs)) { fprintf(stderr, "Failed to configure PDOs.\n"); return -1; } //Error happens here if (ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs)) { fprintf(stderr, "PDO entry registration failed!\n"); return -1; } //code continues from here
_______________________________________________ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users