[etherlab-users] Reading cyclic data from Unidrive SP 1404 - configuration problem

Olaf Holowenko holowenko at iwm.mw.tu-dresden.de
Fri Jan 29 13:06:37 CET 2010


Hello,

I would like to configure a ControlTechniques / Emerson Unidrive SP 1404 
(including SM-EtherCAT module) for cyclic read and write of process data. 
Therefore I'm using the IgH EtherCAT master 1.4.0 r1611 on a RTAI-Linux 
system (kernel: 2.6.24.7, RTAI 3.7.1). 

Problem: After configuring the slave I can only write to the drive, reading is 
impossible.

More informations:

The result of typing "/opt/etherlab/bin/ethercat slave -v" is appended 
as "01_slaveInfos.txt".

You can find an extract of the module-init-function appended 
as "02_initcodeExtract.txt". For this extract I removed error-handeling, 
initializing threads, fifos, shm etc.

After loading my module (ec_master.ko / ec_8139too.ko inserted, SDO 
dictionaries loaded successfully to the master) the messages appeded 
as "03_kern_log.txt" are logged in "/var/log/kern.log".  What I am missing 
ist the passage 
  EtherCAT: Domain 1: Working counter changed to 1/1.
at the end (line 81+).

Now i can type "/opt/etherlab/bin/ethercat domain -v"...

Domain0: LogBaseAddr 0x00000000, Size   4, WorkingCounter 1/1
  SlaveConfig 0:0, SM2 (Output), LogAddr 0x00000000, Size 4
    0xbb 0x0c 0x00 0x00
Domain1: LogBaseAddr 0x00000004, Size   8, WorkingCounter 0/1
  SlaveConfig 0:0, SM3 ( Input), LogAddr 0x00000004, Size 8
    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

... , "/opt/etherlab/bin/ethercat pdos" ...

SM0: PhysAddr 0x1000, DefaultSize  128, ControlRegister 0x26, Enable 1
SM1: PhysAddr 0x1080, DefaultSize  128, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1100, DefaultSize    0, ControlRegister 0x24, Enable 1
  RxPDO 0x1605 "Receive PDO mapping 6"
    PDO entry 0x2014:0f, 16 bit, "Parameter"
    PDO entry 0x2014:10, 16 bit, "Parameter"
SM3: PhysAddr 0x1280, DefaultSize    0, ControlRegister 0x20, Enable 1
  TxPDO 0x1a05 "Transmit PDO mapping 6"
    PDO entry 0x2014:1e, 32 bit, "Parameter"
    PDO entry 0x2014:15, 32 bit, "Parameter"

or "/opt/etherlab/bin/ethercat sdos" (extract):

SDO 0x2014, "Menu"
  0x2014:00, r-r-r-, uint8, 8 bit, "Parameter"
...
  0x2014:0f, rwrwrw, int16, 16 bit, "Parameter"
  0x2014:10, rwrwrw, int16, 16 bit, "Parameter"
...
  0x2014:15, rwrwrw, int32, 32 bit, "Parameter"
...
  0x2014:1e, rwrwrw, int32, 32 bit, "Parameter"

Cyclic writing of data to the slave ist possible, reading ist impossible. 

I tried using the IgH-Master version 1.5.0 r1770 -- the problem remains.


======================================


My Question:
What could be the problem? Any idea how to solve it?


Many thanks in advance! Best regards, 

Olaf Holowenko

-----------------------------------------------------------------------------

Attached documents:
	01_slaveInfos.txt
	02_initcodeExtract.txt
	03_kern_log.txt




-------------- next part --------------
=== Slave 0 ===
State: OP
Flag: +
Identity:
  Vendor Id:       0x000000f9
  Product code:    0x00040003
  Revision number: 0x00000068
  Serial number:   0xfe9d6583
Mailboxes:
  RX: 0x1000/128, TX: 0x1080/128
  Supported protocols: CoE
General:
  Group: Drives
  Image name:
  Order number:
  Device name: SM-EtherCAT (421)
  CoE details:
    Enable SDO: yes
    Enable SDO Info: yes
    Enable PDO Assign: yes
    Enable PDO Configuration: yes
    Enable Upload at startup: yes
    Enable SDO complete access: no
  Flags:
    Enable SafeOp: no
    Enable notLRW: yes
  Current consumption: 0 mA
-------------- next part --------------
Defines:
========


// Master
static SEM 			master_sem;
static ec_master_t 		*master = NULL;

// Domain
static ec_domain_t 		*domain_out = NULL, *domain_in = NULL;
static uint8_t 			*domain_out_pd, *domain_in_pd; // process data memory

// Slave 1
#define Max_Z2_AliasPos		0, 0
#define Emerson_SM_EtherCAT 	0xf9, 0x40003
static ec_slave_config_t 	*sc_z2 = NULL;

// PDO offsets
static unsigned int 	off_z2_S2M, off_z2_M2S;



// domains
const static ec_pdo_entry_reg_t domain_out_regs[] = {
	{Max_Z2_AliasPos,  Emerson_SM_EtherCAT, 0x2000 + 20, 15, off_z2_M2S},
	{}
};

const static ec_pdo_entry_reg_t domain_in_regs[] = {
	{Max_Z2_AliasPos,  Emerson_SM_EtherCAT, 0x2000 + 20, 0x15, off_z2_S2M},
	{}
};


// pdos
// mater -> slave
static ec_pdo_entry_info_t 	z2_channel_out[] = { 
	{0x2014, 15, 16}, 
	{0x2014, 16, 16},
	{0xff}
};

// slave -> master
static ec_pdo_entry_info_t 	z2_channel_in[] = {
	{0x2014, 30, 32 },
	{0x2014, 21, 32},
	{0xff}
};


static ec_pdo_info_t 	z2_pdos[] = {
	{ 0x1605, 2, z2_channel_out },
	{ 0x1a05, 2, z2_channel_in },
	{ 0xff }
};


// sync. manager
static ec_sync_info_t  z2_syncs[] = {
	{ 2, EC_DIR_OUTPUT, 1, &z2_pdos[0] },
	{ 3, EC_DIR_INPUT, 1, &z2_pdos[1] },
	{0xff}
};



Code (module-init):
=====
	
	AUSG_INIT("Starting");
	
	rt_sem_init(&master_sem, 1);
	
	master = ecrt_request_master(0);
	
	meine_ecrt_master_debug_level(master,1);
	
	// request_lock, release_lock -- see /examples/rtai/rtai_sample.c
	ecrt_master_callbacks(master, request_lock, release_lock, NULL);
	
	AUSG_INIT("Registering domain 1");
	domain_out = ecrt_master_create_domain(master);
	AUSG_INIT("Registering domain 2");
	domain_in = ecrt_master_create_domain(master);
	
	sc_z2 = ecrt_master_slave_config(master, Max_Z2_AliasPos, Emerson_SM_EtherCAT);
	
	AUSG_INIT("Configuring PDOs");
	ecrt_slave_config_pdos(sc_z2, EC_END, z2_syncs);
	
	AUSG_INIT("Registering PDO entries -- domain 1");
	ecrt_domain_reg_pdo_entry_list(domain_out, domain_out_regs);
	AUSG_INIT("Registering PDO entries -- domain 2");
	ecrt_domain_reg_pdo_entry_list(domain_in, domain_in_regs);
	
	AUSG_INIT("Activating master");
	ecrt_master_activate(master);
	
	// Get internal process data for domain
	domain_out_pd = ecrt_domain_data(domain_out);
	domain_in_pd = ecrt_domain_data(domain_in);
-------------- next part --------------
EtherCAT - V01>> Starting
EtherCAT: Requesting master 0...
EtherCAT: Successfully requested master 0.
EtherCAT: Master debug level set to 1.
EtherCAT DEBUG: ecrt_master_callbacks(master = 0xdfa51800, request_cb = 0xf92e3020,  release_cb = 0xf92e3000, cb_data = 0x0)
EtherCAT - V01>> Registering domain 1
EtherCAT DEBUG: ecrt_master_create_domain(master = 0xdfa51800)
EtherCAT DEBUG: Created domain 0.
EtherCAT - V01>> Registering domain 2
EtherCAT DEBUG: ecrt_master_create_domain(master = 0xdfa51800)
EtherCAT DEBUG: Created domain 1.
EtherCAT DEBUG: ecrt_master_slave_config(master = 0xdfa51800, alias = 0, position = 0, vendor_id = 0xf9, product_code = 0x40003)
EtherCAT DEBUG: Creating slave configuration for 0:0, 0x000000F9/0x00040003.
EtherCAT DEBUG: Attached slave 0 to config 0:0.
EtherCAT - V01>> Configuring PDOs
EtherCAT DEBUG: ecrt_slave_config_pdos(sc = 0xf77df800, n_syncs = 4294967295, syncs = 0xf92e5e20)
EtherCAT DEBUG: ecrt_slave_config_sync_manager(sc = 0xf77df800, sync_index = 2, dir = 1)
EtherCAT DEBUG: ecrt_slave_config_pdo_assign_clear(sc = 0xf77df800, sync_index = 2)
EtherCAT DEBUG: ecrt_slave_config_pdo_assign_add(sc = 0xf77df800, sync_index = 2, pdo_index = 0x1605)
EtherCAT DEBUG: Loading default mapping for PDO 0x1605 in config 0:0.
EtherCAT DEBUG: Found PDO name "Receive PDO mapping 6".
EtherCAT DEBUG: Entry 0x2014:0F.
EtherCAT DEBUG: Entry 0x2014:10.
EtherCAT DEBUG: ecrt_slave_config_pdo_mapping_clear(sc = 0xf77df800, pdo_index = 0x1605)
EtherCAT DEBUG: ecrt_slave_config_pdo_mapping_add(sc = 0xf77df800, pdo_index = 0x1605, entry_index = 0x2014, entry_subindex = 0x0F, entry_bit_length = 16)
EtherCAT DEBUG: ecrt_slave_config_pdo_mapping_add(sc = 0xf77df800, pdo_index = 0x1605, entry_index = 0x2014, entry_subindex = 0x10, entry_bit_length = 16)
EtherCAT DEBUG: ecrt_slave_config_sync_manager(sc = 0xf77df800, sync_index = 3, dir = 2)
EtherCAT DEBUG: ecrt_slave_config_pdo_assign_clear(sc = 0xf77df800, sync_index = 3)
EtherCAT DEBUG: ecrt_slave_config_pdo_assign_add(sc = 0xf77df800, sync_index = 3, pdo_index = 0x1A05)
EtherCAT DEBUG: Loading default mapping for PDO 0x1A05 in config 0:0.
EtherCAT DEBUG: Found PDO name "Transmit PDO mapping 6".
EtherCAT DEBUG: Entry 0x2014:1E.
EtherCAT DEBUG: Entry 0x2014:15.
EtherCAT DEBUG: ecrt_slave_config_pdo_mapping_clear(sc = 0xf77df800, pdo_index = 0x1A05)
EtherCAT DEBUG: ecrt_slave_config_pdo_mapping_add(sc = 0xf77df800, pdo_index = 0x1A05, entry_index = 0x2014, entry_subindex = 0x1E, entry_bit_length = 32)
EtherCAT DEBUG: ecrt_slave_config_pdo_mapping_add(sc = 0xf77df800, pdo_index = 0x1A05, entry_index = 0x2014, entry_subindex = 0x15, entry_bit_length = 32)
EtherCAT - V01>> Registering PDO entries -- domain 1
EtherCAT DEBUG: ecrt_domain_reg_pdo_entry_list(domain = 0xf64ebe60, regs = 0xf92e4660)
EtherCAT DEBUG: ecrt_master_slave_config(master = 0xdfa51800, alias = 0, position = 0, vendor_id = 0xf9, product_code = 0x40003)
EtherCAT DEBUG: ecrt_slave_config_reg_pdo_entry(sc = 0xf77df800, index = 0x2014, subindex = 0x0F, domain = 0xf64ebe60, bit_position = 0x0)
EtherCAT DEBUG: Domain 0: Added 4 bytes, total 4.
EtherCAT - V01>> Registering PDO entries -- domain 2
EtherCAT DEBUG: ecrt_domain_reg_pdo_entry_list(domain = 0xf64eb4e0, regs = 0xf92e46a0)
EtherCAT DEBUG: ecrt_master_slave_config(master = 0xdfa51800, alias = 0, position = 0, vendor_id = 0xf9, product_code = 0x40003)
EtherCAT DEBUG: ecrt_slave_config_reg_pdo_entry(sc = 0xf77df800, index = 0x2014, subindex = 0x15, domain = 0xf64eb4e0, bit_position = 0x0)
EtherCAT DEBUG: Domain 1: Added 8 bytes, total 8.
EtherCAT - V01>> Activating master
EtherCAT DEBUG: ecrt_master_activate(master = 0xdfa51800)
EtherCAT: Domain0: Logical address 0x00000000, 4 byte, expected working counter 1.
EtherCAT:   Datagram domain0-0: Logical offset 0x00000000, 4 byte, type LWR.
EtherCAT: Domain1: Logical address 0x00000004, 8 byte, expected working counter 1.
EtherCAT:   Datagram domain1-4: Logical offset 0x00000004, 8 byte, type LRD.
EtherCAT DEBUG: Stopping master thread.
EtherCAT DEBUG: Master IDLE thread exiting...
EtherCAT: Master thread exited.
EtherCAT DEBUG: FSM datagram is dfa51ac4.
EtherCAT: Starting EtherCAT-OP thread.
EtherCAT DEBUG: Operation thread running.

   -- Starting cyclic RTAI-task, FIFOs, SHM... --

EtherCAT DEBUG: Changing state of slave 0 from PREOP to OP.
EtherCAT DEBUG: Configuring slave 0...
EtherCAT DEBUG: Slave 0 is now in INIT.
EtherCAT DEBUG: Clearing FMMU configurations of slave 0...
EtherCAT DEBUG: Configuring mailbox sync managers of slave 0.
EtherCAT DEBUG: SM0: Addr 0x1000, Size 128, Ctrl 0x26, En 1
EtherCAT DEBUG: SM1: Addr 0x1080, Size 128, Ctrl 0x22, En 1
EtherCAT DEBUG: Slave 0 is now in PREOP.
EtherCAT DEBUG: PDO assignment for SM0 is already configured correctly.
EtherCAT DEBUG: PDO assignment for SM1 is already configured correctly.
EtherCAT DEBUG: Mapping of PDO 0x1605 is already configured correctly.
EtherCAT DEBUG: PDO assignment for SM2 is already configured correctly.
EtherCAT DEBUG: Mapping of PDO 0x1A05 is already configured correctly.
EtherCAT DEBUG: PDO assignment for SM3 is already configured correctly.
EtherCAT DEBUG: SM2: Addr 0x1100, Size   4, Ctrl 0x24, En 1
EtherCAT DEBUG: SM3: Addr 0x1280, Size   8, Ctrl 0x20, En 1
EtherCAT DEBUG: FMMU: LogAddr 0x00000000, Size   4, PhysAddr 0x1100, SM2, Dir out
EtherCAT DEBUG: FMMU: LogAddr 0x00000004, Size   8, PhysAddr 0x1280, SM3, Dir in
EtherCAT DEBUG: Slave 0 is now in SAFEOP.
EtherCAT: Domain 0: Working counter changed to 1/1.
EtherCAT DEBUG: Slave 0 is now in OP.
EtherCAT DEBUG: Finished configuration of slave 0.
EtherCAT: Slave states: OP.


More information about the Etherlab-users mailing list