Its been a few years but I recall only doing a complete access for index 0x8000 and it started working.
On Thu, 2014-04-24 at 17:00 +0200, Felix Barth wrote: > > Hi all, > > I am currently trying to connect a Siemens S7 SPS to a Beckhoff > 6731-0010 via ProfiBus. This setup works fine while using TwinCAT and I > am able to send data from the 6731 slave and receive it on the SPS. > Nonetheless, the project is set to be realized using "Etherlab", > therefore the TwinCAT setup only serves as a test run. In the attempt to > convert it to Etherlab, I used the TwinCAT configuration and exported it > as XML-file (the same way it was already described some years past in > this mailing list). This file contained the following information about > the PDO register at startup (read from the devices PDO during "run mode"): > > 0x8000 2D 00 03 00 00 00 00 00 00 00 00 00 00 00 A8 01 00 00 F4 F0 00 > 00 00 00 0A 01 00 00 00 00 88 01 14 0B 09 5F 00 80 00 08 10 > 0x1A7F 03 00 08 01 00 F1 07 00 00 00 01 07 00 18 > 0x1600 01 00 08 01 00 70 > 0x1C12 01 00 00 16 > 0x1C13 00 00 > > > I composed a small program to write the gained data into the 6731's PDO. > The following code snipped shows the initialization process: > > > //Start initialization > master = ecrt_request_master(0); > if (!master) return -1; > > domain1 = ecrt_master_create_domain(master); > if (!domain1) return -1; > > /* EK1100 */ > if (!(sc = ecrt_master_slave_config(master, MasterPos, > Beckhoff_EK1100))) return -1; > > /* EL6731 Slave */ > if (!(sc = ecrt_master_slave_config(master, ProfiPosSlave, > Beckhoff_EL6731))) return -1; > > //SDO entries, exported from TwinCAT > static uint8_t sdo_0x8000[] = {0x2d, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0xf4, > 0xf0, 0x00, > 0x00, 0x00, 0x00, 0x0a, 0x01, > 0x00, 0x00, 0x00, 0x00, 0x88, 0x01, 0x14, 0x0b, 0x09, 0x5f, 0x00, 0x80, > 0x00, 0x08, 0x10}; > static uint8_t sdo_0x1A7F[] = {0x03, 0x00, 0x08, 0x01, 0x00, 0xf1, 0x07, > 0x00, 0x00, 0x00, 0x01, 0x07, 0x00, 0x18}; > static uint8_t sdo_0x1600[] = {0x01, 0x00, 0x08, 0x01, 0x00, 0x70}; > static uint8_t sdo_0x1C12[] = {0x01, 0x00, 0x00, 0x16}; > static uint8_t sdo_0x1C13[] = {0x00, 0x00}; > > int size_0x8000 = sizeof(sdo_0x8000); > int size_0x1A7F = sizeof(sdo_0x1A7F); > int size_0x1600 = sizeof(sdo_0x1600); > int size_0x1C12 = sizeof(sdo_0x1C12); > int size_0x1C13 = sizeof(sdo_0x1C13); > > //Setting the SDO entries of the EL6731 > ecrt_slave_config_complete_sdo(sc, 0x8000, sdo_0x8000, size_0x8000); > ecrt_slave_config_complete_sdo(sc, 0x1a7f, sdo_0x1A7F, size_0x1A7F); > ecrt_slave_config_complete_sdo(sc, 0x1600, sdo_0x1600, size_0x1600); > ecrt_slave_config_complete_sdo(sc, 0x1c12, sdo_0x1C12, size_0x1C12); > ecrt_slave_config_complete_sdo(sc, 0x1c13, sdo_0x1C13, size_0x1C13); > > if (ecrt_slave_config_pdos(sc, EC_END, slave_6_syncs)) return -1; > if (ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs)) return -1; > if (ecrt_master_activate(master)) return -1; > if (!(domain1_pd = ecrt_domain_data(domain1))) return -1; > //End initialization > > > However, the initialization of the Beckhoff 6731-0010 fails and aborts > when attempting to switch from "PREOP" to "SAFEOP". The following > messages where extracted using the "dmesg" command: > > > [177982.104485] EtherCAT: Requesting master 0... > [177982.104494] EtherCAT: Successfully requested master 0. > [177982.104648] EtherCAT 0: Domain0: Logical address 0x00000000, 6 byte, > expected working counter 3. > [177982.104654] EtherCAT 0: Datagram domain0-0: Logical offset > 0x00000000, 6 byte, type LRW. > [177982.104690] EtherCAT 0: Master thread exited. > [177982.104696] EtherCAT 0: Starting EtherCAT-OP thread. > [177982.104765] EtherCAT WARNING 0: 1 datagram UNMATCHED! > [177983.117019] EtherCAT WARNING 0: No app_time received up to now, but > master already active. > [177983.205117] No response. > [177983.765121] EtherCAT WARNING 0-6: Slave does not support changing > the PDO mapping! > [177983.765126] EtherCAT WARNING 0-6: Currently mapped PDO entries: > 0x7000:01/8 0x0000:00/8. Entries to map: 0x7000:01/16 > [177983.895118] EtherCAT WARNING 0-6: Slave does not support changing > the PDO mapping! > [177983.895122] EtherCAT WARNING 0-6: Currently mapped PDO entries: > (none). Entries to map: 0x6000:01/16 > [177983.995118] EtherCAT WARNING 0-6: Slave does not support changing > the PDO mapping! > [177983.995122] EtherCAT WARNING 0-6: Currently mapped PDO entries: > 0xF100:01/8 0x0000:00/8. Entries to map: 0xA000:01/8 0xF100:02/1 > 0xA000:02/1 0x0000:00/6 > [177984.165119] EtherCAT ERROR 0-6: Failed to set SAFEOP state, slave > refused state change (PREOP + ERROR). > [177984.175117] EtherCAT ERROR 0-6: AL status message 0x001E: "Invalid > input configuration". > [177984.195117] EtherCAT 0-6: Acknowledged state PREOP. > [177984.209014] EtherCAT 0: Slave states: PREOP, OP. > [177989.049742] EtherCAT 0: Releasing master... > [177989.049779] EtherCAT 0: Master thread exited. > [177989.049793] EtherCAT 0: Starting EtherCAT-IDLE thread. > [177989.049843] EtherCAT 0: Released. > [177989.050286] EtherCAT ERROR 0-2: Failed to receive AL state datagram: > Datagram initialized. > [177989.060155] No response. > [177989.156206] EtherCAT 0: Slave states: PREOP. > [177989.853019] EtherCAT WARNING: Datagram f64424b0 (master-fsm) was > SKIPPED 2 times. > > > The main problem seems to be the "Invalid input configuration". > Unfortunately, I wasn't able to determine which part of the > configuration causes the fault. In the process of investigating these > errors, I used Wireshark on both the TwinCAT and the Etherlab > configuration. The comparison was puzzling since the transmitted > packages to the Beckhoff device seem to be identical in both cases. > > Did anyone encounter similar problems while initializing a Beckhoff > 6731-0010? Or has any idea where I made a mistake? I would be grateful > for any tip, this issue has been keeping me busy for quite some time now. > > > Thanks in advance, > > Felix > _______________________________________________ > etherlab-users mailing list > etherlab-users@etherlab.org > http://lists.etherlab.org/mailman/listinfo/etherlab-users Outbound scan for Spam or Virus by Barracuda at Delta Tau _______________________________________________ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users