etherlab/EthercatCFileGenerator.py
changeset 2121 11102245e1d4
parent 2117 accc4cbca8d3
child 2137 b65abacdbdf9
equal deleted inserted replaced
2120:8e6e6364087e 2121:11102245e1d4
    24 """
    24 """
    25 
    25 
    26 SLAVE_CONFIGURATION_TEMPLATE = """
    26 SLAVE_CONFIGURATION_TEMPLATE = """
    27     if (!(slave%(slave)d = ecrt_master_slave_config(master, %(alias)d, %(position)d, 0x%(vendor).8x, 0x%(product_code).8x))) {
    27     if (!(slave%(slave)d = ecrt_master_slave_config(master, %(alias)d, %(position)d, 0x%(vendor).8x, 0x%(product_code).8x))) {
    28         SLOGF(LOG_CRITICAL, "EtherCAT failed to get slave %(device_type)s configuration at alias %(alias)d and position %(position)d.");
    28         SLOGF(LOG_CRITICAL, "EtherCAT failed to get slave %(device_type)s configuration at alias %(alias)d and position %(position)d.");
    29         return -1;
    29         goto ecat_failed;
    30     }
    30     }
    31 
    31 
    32     if (ecrt_slave_config_pdos(slave%(slave)d, EC_END, slave_%(slave)d_syncs)) {
    32     if (ecrt_slave_config_pdos(slave%(slave)d, EC_END, slave_%(slave)d_syncs)) {
    33         SLOGF(LOG_CRITICAL, "EtherCAT failed to configure PDOs for slave %(device_type)s at alias %(alias)d and position %(position)d.");
    33         SLOGF(LOG_CRITICAL, "EtherCAT failed to configure PDOs for slave %(device_type)s at alias %(alias)d and position %(position)d.");
    34         goto ecat_failed;
    34         goto ecat_failed;