<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 14px;" lang="x-unicode">Hi all,
<br>
<br>
I'm trying to communicate with bus coupler module Lenze EPM-S130
which containts one module EPM−S300(2 digital ouputs). I'm using
EtherCAT Master in version 1.5.1. The code of program is based on
the "mini.c" example. In the code I change the slave configuration
according my module. After the insertion ec_mini.ko (insmod
ec_mini.ko) the program doesn't work. In the kernel message buffer
I can see that there is
problem with changing state from PREOP to SAFEOP due to "Invalid
input configuration".
<br>
<br>
I was trying the same program with Beckhoff EL2004 module(4DO) and
it worked perfect.
<br>
<br>
On the end of this mail I attach the slave informations('ethercat
slaves -a 1 -v'), PDO entries ('ethercat pdos -a 1'),
configuration code which was generated by 'ethercat cstruct -a 1',
configuration part of the code and kernel message buffer.
<br>
<br>
Does anyone any problem witch Lenze modules configuration? I
appreciate any hints. Thank you for your help.
<br>
<br>
Best regards,
<br>
Eugen
Viszus<br>
-----------------------------------------------------------
<br>
'ethercat slaves -a 1 -v'
<br>
<br>
=== Master 0, Slave 0 ===
<br>
Alias: 1
<br>
State: PREOP
<br>
Flag: +
<br>
Identity:
<br>
Vendor Id: 0x0000003b
<br>
Product code: 0x00000514
<br>
Revision number: 0x00000011
<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 - 1373391132 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: 0x1200/532, TX: 0x1500/532
<br>
Standard RX: 0x1c00/512, TX: 0x1e00/512
<br>
Supported protocols: CoE, FoE
<br>
General:
<br>
Group: Coupler
<br>
Image name:
<br>
Order number: Lenze EPM-S130
<br>
Device name: Lenze EPM-S130 EtherCAT Buskoppler (MDP)
<br>
CoE details:
<br>
Enable SDO: yes
<br>
Enable SDO Info: yes
<br>
Enable PDO Assign: no
<br>
Enable PDO Configuration: no
<br>
Enable Upload at startup: yes
<br>
Enable SDO complete access: yes
<br>
Flags:
<br>
Enable SafeOp: no
<br>
Enable notLRW: no
<br>
Current consumption: 0 mA
<br>
<br>
-----------------------------------------------------------
<br>
'ethercat pdos -a 1'
<br>
<br>
SM0: PhysAddr 0x1c00, DefaultSize 512, ControlRegister 0x26,
Enable 1
<br>
SM1: PhysAddr 0x1e00, DefaultSize 512, ControlRegister 0x22,
Enable 1
<br>
SM2: PhysAddr 0x1000, DefaultSize 0, ControlRegister 0x24, Enable
0
<br>
RxPDO 0x1600 "RxPDO Map"
<br>
PDO entry 0x7000:01, 1 bit, "Output "
<br>
PDO entry 0x7000:02, 1 bit, "Output "
<br>
PDO entry 0x0000:00, 6 bit, "Gap"
<br>
SM3: PhysAddr 0x1600, DefaultSize 0, ControlRegister 0x00, Enable
0
<br>
TxPDO 0x1aff "Status PDO"
<br>
PDO entry 0xf100:01, 32 bit, "Hardware Interrupt Counter "
<br>
PDO entry 0xf100:02, 32 bit, "Diagnostic Interrupt Counter "
<br>
<br>
-----------------------------------------------------------
<br>
'ethercat cstruct -a 1'
<br>
<br>
/* Master 0, Slave 0, "Lenze EPM-S130"
<br>
* Vendor ID: 0x0000003b
<br>
* Product code: 0x00000514
<br>
* Revision number: 0x00000011
<br>
*/
<br>
<br>
ec_pdo_entry_info_t slave_0_pdo_entries[] = {
<br>
{0x7000, 0x01, 1}, /* Output */
<br>
{0x7000, 0x02, 1}, /* Output */
<br>
{0x0000, 0x00, 6}, /* Gap */
<br>
{0xf100, 0x01, 32}, /* Hardware Interrupt Counter */
<br>
{0xf100, 0x02, 32}, /* Diagnostic Interrupt Counter */
<br>
};
<br>
<br>
ec_pdo_info_t slave_0_pdos[] = {
<br>
{0x1600, 3, slave_0_pdo_entries + 0}, /* RxPDO Map */
<br>
{0x1aff, 2, slave_0_pdo_entries + 3}, /* Status PDO */
<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>
the configuration part of my code
<br>
<br>
// process data
<br>
static uint8_t *domain1_pd; // process data memory
<br>
<br>
<br>
#define DigOutSlavePos 1, 0
<br>
<br>
#define Lenze_EPMS130 0x0000003B, 0x00000514
<br>
<br>
<br>
// offsets for PDO entries
<br>
static unsigned int off_dig_out;
<br>
<br>
const static ec_pdo_entry_reg_t domain1_regs[] = {
<br>
{DigOutSlavePos, Lenze_EPMS130, 0x7000,0x01, &off_dig_out},
<br>
{}
<br>
};
<br>
<br>
static unsigned int counter = 0;
<br>
static unsigned int blink = 0;
<br>
<br>
<br>
#if CONFIGURE_PDOS
<br>
<br>
// Digital out ------------------------
<br>
<br>
/* Master 0, Slave 0, "Lenze EPM-S130"
<br>
* Vendor ID: 0x0000003b
<br>
* Product code: 0x00000514
<br>
* Revision number: 0x00000011
<br>
*/
<br>
<br>
ec_pdo_entry_info_t s130_channels[] = {
<br>
{0x7000, 0x01, 1}, /* Output */
<br>
{0x7000, 0x02, 1}, /* Output */
<br>
{0x0000, 0x00, 6}, /* Gap */
<br>
{0xf100, 0x01, 32}, /* Hardware Interrupt Counter */
<br>
{0xf100, 0x02, 32}, /* Diagnostic Interrupt Counter */
<br>
};
<br>
<br>
ec_pdo_info_t s130_pdos[] = {
<br>
{0x1600, 3, s130_channels + 0}, /* RxPDO Map */
<br>
{0x1aff, 2, s130_channels + 3}, /* Status PDO */
<br>
};
<br>
<br>
ec_sync_info_t s130_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, s130_pdos + 0, EC_WD_DISABLE},
<br>
{3, EC_DIR_INPUT, 1, s130_pdos + 1, EC_WD_DISABLE},
<br>
{0xff}
<br>
};
<br>
<br>
#endif
<br>
-----------------------------------------------------------
<br>
kernel message buffer
<br>
<br>
[13787.239527] ec_mini: Starting...
<br>
[13787.239533] EtherCAT: Requesting master 0...
<br>
[13787.239535] EtherCAT DEBUG 0: IDLE -> OPERATION.
<br>
[13787.239538] EtherCAT: Successfully requested master 0.
<br>
[13787.239542] EtherCAT DEBUG 0: ecrt_master_callbacks(master =
0xffff88003c27d000, send_cb = 0xffffffffa0095040, receive_cb =
0xffffffffa0095000, cb_data = 0xffff88003c27d000)
<br>
[13787.239546] ec_mini: Registering domain...
<br>
[13787.239549] EtherCAT DEBUG 0: ecrt_master_create_domain(master
= 0xffff88003c27d000)
<br>
[13787.239552] EtherCAT DEBUG 0: Created domain 0.
<br>
[13787.239555] EtherCAT DEBUG 0: ecrt_master_slave_config(master =
0xffff88003c27d000, alias = 1, position = 0, vendor_id =
0x0000003b, product_code = 0x00000514)
<br>
[13787.239559] EtherCAT DEBUG 0: Creating slave configuration for
1:0, 0x0000003B/0x00000514.
<br>
[13787.239564] EtherCAT DEBUG 0 1:0: Attached slave 0.
<br>
[13787.239575] EtherCAT DEBUG 0 1:0: ecrt_slave_config_pdos(sc =
0xffff880039647000, n_syncs = 4294967295, syncs =
0xffffffffa0095880)
<br>
[13787.239579] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_sync_manager(sc = 0xffff880039647000, sync_index
= 0, dir = 1, watchdog_mode = 2)
<br>
[13787.239583] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_sync_manager(sc = 0xffff880039647000, sync_index
= 1, dir = 2, watchdog_mode = 2)
<br>
[13787.239588] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_sync_manager(sc = 0xffff880039647000, sync_index
= 2, dir = 1, watchdog_mode = 2)
<br>
[13787.239592] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_assign_clear(sc = 0xffff880039647000,
sync_index = 2)
<br>
[13787.239597] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_assign_add(sc = 0xffff880039647000,
sync_index = 2, pdo_index = 0x1600)
<br>
[13787.239601] EtherCAT DEBUG 0 1:0: Loading default mapping for
PDO 0x1600.
<br>
[13787.239604] EtherCAT DEBUG 0 1:0: Found PDO name "RxPDO Map".
<br>
[13787.239607] EtherCAT DEBUG 0 1:0: Entry 0x7000:01.
<br>
[13787.239609] EtherCAT DEBUG 0 1:0: Entry 0x7000:02.
<br>
[13787.239611] EtherCAT DEBUG 0 1:0: Entry 0x0000:00.
<br>
[13787.239614] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_mapping_clear(sc = 0xffff880039647000,
pdo_index = 0x1600)
<br>
[13787.239619] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_mapping_add(sc = 0xffff880039647000,
pdo_index = 0x1600, entry_index = 0x7000, entry_subindex = 0x01,
entry_bit_length = 1)
<br>
[13787.239625] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_mapping_add(sc = 0xffff880039647000,
pdo_index = 0x1600, entry_index = 0x7000, entry_subindex = 0x02,
entry_bit_length = 1)
<br>
[13787.239630] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_mapping_add(sc = 0xffff880039647000,
pdo_index = 0x1600, entry_index = 0x0000, entry_subindex = 0x00,
entry_bit_length = 6)
<br>
[13787.239635] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_sync_manager(sc = 0xffff880039647000, sync_index
= 3, dir = 2, watchdog_mode = 2)
<br>
[13787.239639] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_assign_clear(sc = 0xffff880039647000,
sync_index = 3)
<br>
[13787.239644] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_assign_add(sc = 0xffff880039647000,
sync_index = 3, pdo_index = 0x1AFF)
<br>
[13787.239648] EtherCAT DEBUG 0 1:0: Loading default mapping for
PDO 0x1AFF.
<br>
[13787.239650] EtherCAT DEBUG 0 1:0: Found PDO name "Status PDO".
<br>
[13787.239653] EtherCAT DEBUG 0 1:0: Entry 0xF100:01.
<br>
[13787.239656] EtherCAT DEBUG 0 1:0: Entry 0xF100:02.
<br>
[13787.239658] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_mapping_clear(sc = 0xffff880039647000,
pdo_index = 0x1AFF)
<br>
[13787.239663] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_mapping_add(sc = 0xffff880039647000,
pdo_index = 0x1AFF, entry_index = 0xF100, entry_subindex = 0x01,
entry_bit_length = 32)
<br>
[13787.239668] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_pdo_mapping_add(sc = 0xffff880039647000,
pdo_index = 0x1AFF, entry_index = 0xF100, entry_subindex = 0x02,
entry_bit_length = 32)
<br>
[13787.239673] ec_mini: Registering PDO entries...
<br>
[13787.239675] EtherCAT DEBUG 0:
ecrt_domain_reg_pdo_entry_list(domain = 0xffff880032b9f240, regs =
0xffffffffa0095400)
<br>
[13787.239679] EtherCAT DEBUG 0: ecrt_master_slave_config(master =
0xffff88003c27d000, alias = 1, position = 0, vendor_id =
0x0000003b, product_code = 0x00000514)
<br>
[13787.239684] EtherCAT DEBUG 0 1:0:
ecrt_slave_config_reg_pdo_entry(sc = 0xffff880039647000, index =
0x7000, subindex = 0x01, domain = 0xffff880032b9f240, bit_position
= 0x (null))
<br>
[13787.239690] EtherCAT DEBUG 0: Domain 0: Added 1 bytes, total 1.
<br>
[13787.239693] EtherCAT DEBUG 0:
ecrt_domain_external_memory(domain = 0xffff880032b9f240, mem =
0xffff88000f11c520)
<br>
[13787.239696] ec_mini: Activating master...
<br>
[13787.239698] EtherCAT DEBUG 0: ecrt_master_activate(master =
0xffff88003c27d000)
<br>
[13787.239703] EtherCAT 0: Domain0: Logical address 0x00000000, 1
byte, expected working counter 1.
<br>
[13787.239706] EtherCAT 0: Datagram domain0-0: Logical offset
0x00000000, 1 byte, type LWR.
<br>
[13787.239709] EtherCAT DEBUG 0: Stopping master thread.
<br>
[13787.239714] EtherCAT DEBUG 0: Master IDLE thread exiting...
<br>
[13787.239739] EtherCAT 0: Master thread exited.
<br>
[13787.239741] EtherCAT DEBUG 0: FSM datagram is ffff88003c27d648.
<br>
[13787.239743] EtherCAT 0: Starting EtherCAT-OP thread.
<br>
[13787.239789] ec_mini: Starting cyclic sample thread.
<br>
[13787.239791] ec_mini: Started.
<br>
[13787.243169] EtherCAT DEBUG 0: Operation thread running with fsm
interval = 1000 us, max data size=11250
<br>
[13787.243175] EtherCAT WARNING 0: 1 datagram UNMATCHED!
<br>
[13787.249023] ec_mini: 1 slave(s).
<br>
[13787.249026] ec_mini: AL states: 0x02.
<br>
[13787.249028] ec_mini: Link is up.
<br>
[13787.249037] EtherCAT DEBUG 0: Configuration changed (aborting
state check).
<br>
[13787.249040] EtherCAT DEBUG 0: Writing system time offsets...
<br>
[13787.249042] EtherCAT WARNING 0: No app_time received up to now,
but master already active.
<br>
[13787.249045] EtherCAT DEBUG 0: Requesting OP...
<br>
[13787.289031] EtherCAT DEBUG 0-0: Changing state from PREOP to
OP.
<br>
[13787.289036] EtherCAT DEBUG 0-0: Configuring...
<br>
[13787.329025] EtherCAT DEBUG 0-0: Now in INIT.
<br>
[13787.329029] EtherCAT DEBUG 0-0: Clearing FMMU configurations...
<br>
[13787.349021] EtherCAT DEBUG 0-0: Clearing sync manager
configurations...
<br>
[13787.369026] EtherCAT DEBUG 0-0: Clearing DC assignment...
<br>
[13787.389024] EtherCAT DEBUG 0-0: Configuring mailbox sync
managers...
<br>
[13787.389030] EtherCAT DEBUG 0-0: SM0: Addr 0x1C00, Size 512,
Ctrl 0x26, En 1
<br>
[13787.389033] EtherCAT DEBUG 0-0: SM1: Addr 0x1E00, Size 512,
Ctrl 0x22, En 1
<br>
[13787.449029] EtherCAT DEBUG 0-0: Now in PREOP.
<br>
[13787.449050] EtherCAT DEBUG 0-0: SM2: Addr 0x1000, Size 1, Ctrl
0x24, En 1
<br>
[13787.449053] EtherCAT DEBUG 0-0: SM3: Addr 0x1600, Size 8, Ctrl
0x00, En 0
<br>
[13787.469026] EtherCAT DEBUG 0 1:0: FMMU: LogAddr 0x00000000,
Size 1, PhysAddr 0x1000, SM2, Dir out
<br>
[13787.499019] EtherCAT 0: Domain 0: Working counter changed to
1/1.
<br>
[13787.499023] ec_mini: Domain1: WC 1.
<br>
[13787.499025] ec_mini: Domain1: State 2.
<br>
[13787.529023] EtherCAT ERROR 0-0: Failed to set SAFEOP state,
slave refused state change (PREOP + ERROR).
<br>
[13787.549024] EtherCAT ERROR 0-0: AL status message 0x001E:
"Invalid input configuration".
<br>
[13787.589025] EtherCAT 0-0: Acknowledged state PREOP.
<br>
</div>
</body>
</html>