[etherlab-users] further investigations on NetX500 slave

Phil Sutter sutter at informatik.hs-furtwangen.de
Thu Mar 13 01:29:56 CET 2008


Hi!

On Fri, Mar 07, 2008 at 02:34:07AM +0100, Phil Sutter wrote:
> Ok, I'll try to reach someone via phone tomorrow.

I did talk to Hilscher support today. Basically they told me to have a
deeper look at the information about the slave shown in TwinCAT. My last
state was that SDO information could not have been read out by the
EtherLAB master.

Before going further, I reviewed my first changes to the master code and
then added the missing information. This is what I did:

* disable the code inside ec_fsm_slave_scan_state_eeprom_size() for
  getting the EEPROM size. I doubt this will ever work for my slave,
  because it's EEPROM data is just 128 Bytes of size and scanning for
  the end-marker 0xffff starts at 0x80 (128).
  Instead I inserted the following line:
| slave->eeprom_size = 128;

* in ec_fsm_slave_scan_state_eeprom_data(), right below filling the
  ec_slave_t with the data from the EEPROM, I manually filled in the
  missing values:
| // mailbox
| slave->sii.mailbox_protocols = EC_MBOX_COE;
| slave->sii.coe_details.enable_sdo = 1;
| slave->sii.coe_details.enable_sdo_info = 1;
| // sync managers
| slave->sii.sync_count = 4;
| slave->sii.syncs = kmalloc(sizeof(ec_sync_t) * 4, GFP_KERNEL);
| ec_sync_init(&(slave->sii.syncs[0]), slave, 0);
| slave->sii.syncs[0].physical_start_address = 0x1000; // 2 bytes
| slave->sii.syncs[0].length = 0x0080; // 128
| slave->sii.syncs[0].control_register = 0x26;
| slave->sii.syncs[0].enable = 0x01;
| ec_sync_init(&(slave->sii.syncs[1]), slave, 1);
| slave->sii.syncs[1].physical_start_address = 0x1100; // 2 bytes
| slave->sii.syncs[1].length = 0x0080; // 128
| slave->sii.syncs[1].control_register = 0x22;
| slave->sii.syncs[1].enable = 0x01;
| ec_sync_init(&(slave->sii.syncs[2]), slave, 2);
| slave->sii.syncs[2].physical_start_address = 0x1200; // 2 bytes
| slave->sii.syncs[2].length = 0x0004; // 128
| slave->sii.syncs[2].control_register = 0x64;
| slave->sii.syncs[2].enable = 0x01;
| ec_sync_init(&(slave->sii.syncs[3]), slave, 3);
| slave->sii.syncs[3].physical_start_address = 0x1280; // 2 bytes
| slave->sii.syncs[3].length = 0x0004; // 128
| slave->sii.syncs[3].control_register = 0x20;
| slave->sii.syncs[3].enable = 0x01;
| // pdo mappings
| ec_pdo_init(&txpdo);
| txpdo.dir = EC_DIR_OUTPUT;
| txpdo.index = 0x1600;
| txpdo.sync_index = 0x02;
| ec_pdo_set_name(&txpdo, "wOut0");
| pdoentry = ec_pdo_add_entry(&txpdo, 0x2003, 0x07, 0x20);
| ec_pdo_entry_set_name(pdoentry, "Output");
| ec_sync_add_pdo(&(slave->sii.syncs[3]), &txpdo);
| ec_pdo_init(&rxpdo);
| rxpdo.dir = EC_DIR_INPUT;
| rxpdo.index = 0x1a00;
| rxpdo.sync_index = 0x03;
| ec_pdo_set_name(&rxpdo, "wIn0");
| pdoentry = ec_pdo_add_entry(&rxpdo, 0x2003, 0x04, 0x20);
| ec_pdo_entry_set_name(pdoentry, "Input");
| ec_sync_add_pdo(&(slave->sii.syncs[2]), &rxpdo);

the only thing which is still strange at this point is a timeout when
checking an sdo entry. After adding debug output when requesting the sdo
entry, I get the following output:
| DEBUG: Fetching Sdo dictionary from slave 0.
| DEBUG: fetching sdo entry at index 0x1000, subindex 0x0
| DEBUG: fetching sdo entry at index 0x1008, subindex 0x0
| DEBUG: fetching sdo entry at index 0x1009, subindex 0x0
| DEBUG: fetching sdo entry at index 0x100a, subindex 0x0
| DEBUG: fetching sdo entry at index 0x1018, subindex 0x0
| DEBUG: fetching sdo entry at index 0x1600, subindex 0x0
| DEBUG: fetching sdo entry at index 0x1a00, subindex 0x0
| DEBUG: fetching sdo entry at index 0x1c12, subindex 0x0
| DEBUG: fetching sdo entry at index 0x1c13, subindex 0x0
| DEBUG: fetching sdo entry at index 0x2000, subindex 0x0
| DEBUG: fetching sdo entry at index 0x2001, subindex 0x0
| DEBUG: fetching sdo entry at index 0x2002, subindex 0x0
| DEBUG: fetching sdo entry at index 0x2003, subindex 0x0
| ERROR: Timeout while checking Sdo entry on slave 0.
there are four more sdo entries at 2004, 2005, 2010 and 2020, which are
not being initialised then.

Greetings, Phil



More information about the Etherlab-users mailing list