[etherlab-users] problems with data exchange to slaves

dclark at mmto.org dclark at mmto.org
Thu Mar 18 00:36:13 CET 2010


Hi list:

I should report that my earlier thread on "errors with make modules" is
SOLVED, and I thank Florian for his suggestion on use of boostrap.sh...I
now can use the mercurial repo for updates to the codebase pretty easily
now, it works great!

But now to a NEW set of problems...I'm trying a sort of kindergarten
version of the /examples/user application to just read and write to a pair
of digital i/o slaves on my bus. Relevant information for this --

The current hg parent is 1872:23d4e121faaf

I can't seem to exchange any data with the slaves, here is my program
output --
Activating master...pd: 0 <-- ?? stray print from ecrt_master_activate() ??
ok!
Domain data registered ok.
3 slave(s).
AL states: 0x02.
Link is up.
DigOut: State 0x02.
DigIn: State 0x02.
Output data: 0
Input data is: 0
DigOut: State 0x02.
DigIn: State 0x02.
Output data: 1
Input data is: 0
...Done. Releasing the master!

Clearly the slaves never reach OP state, so I must be missing something in
the bus configuration step (sync managers?).

And here is the dmesg output:

EtherCAT: Starting EtherCAT-IDLE thread.
EtherCAT: Link state changed to UP.
EtherCAT: 3 slave(s) responding.
EtherCAT: Slave states: PREOP.
EtherCAT: Scanning bus.
EtherCAT: Bus scanning completed in 300 ms.
EtherCAT: Master debug level set to 1.
EtherCAT: Requesting master 0...
EtherCAT DEBUG: IDLE -> OPERATION.
EtherCAT: Successfully requested master 0.
EtherCAT DEBUG: ecrt_master_create_domain(master = 0xc1092000)
EtherCAT DEBUG: Created domain 0.
EtherCAT DEBUG: ecrt_master_slave_config(master = 0xc1092000, alias = 0,
position = 0, vendor_id = 0x00000002, product_code = 0x044c2c52)
EtherCAT DEBUG: Creating slave configuration for 0:0, 0x00000002/0x044C2C52.
EtherCAT DEBUG: Attached slave 0 to config 0:0.
EtherCAT DEBUG: ecrt_master_slave_config(master = 0xc1092000, alias = 0,
position = 1, vendor_id = 0x00000002, product_code = 0x07d43052)
EtherCAT DEBUG: Creating slave configuration for 0:1, 0x00000002/0x07D43052.
EtherCAT DEBUG: Attached slave 1 to config 0:1.
EtherCAT DEBUG: ecrt_slave_config_reg_pdo_entry(sc = 0xc6f08400, index =
0x7000, subindex = 0x01, domain = 0xe9c4f900, bit_position = 0xf39dfee4)
EtherCAT DEBUG: Domain 0: Added 1 bytes, total 1.
EtherCAT DEBUG: ecrt_master_slave_config(master = 0xc1092000, alias = 0,
position = 2, vendor_id = 0x00000002, product_code = 0x03f63052)
EtherCAT DEBUG: Creating slave configuration for 0:2, 0x00000002/0x03F63052.
EtherCAT DEBUG: Attached slave 2 to config 0:2.
EtherCAT DEBUG: ecrt_slave_config_reg_pdo_entry(sc = 0xc6f09000, index =
0x6000, subindex = 0x01, domain = 0xe9c4f900, bit_position = 0xf39dfee4)
EtherCAT DEBUG: Domain 0: Added 1 bytes, total 2.
EtherCAT DEBUG: ecrt_domain_external_memory(domain = 0xe9c4f900, mem =
0xf7cf6000)
EtherCAT DEBUG: ecrt_master_callbacks(master = 0xc1092000, send_cb =
0xf9227e54,  receive_cb = 0xf9227234, cb_data = 0xc1092000)
EtherCAT DEBUG: ecrt_master_activate(master = 0xc1092000)
EtherCAT: Domain0: Logical address 0x00000000, 2 byte, expected working
counter 3.
EtherCAT:   Datagram domain0-0: Logical offset 0x00000000, 2 byte, type LRW.
EtherCAT DEBUG: Stopping master thread.
EtherCAT DEBUG: Master IDLE thread exiting...
EtherCAT: Master thread exited.
EtherCAT DEBUG: FSM datagram is c10923d0.
EtherCAT: Starting EtherCAT-OP thread.
EtherCAT DEBUG: Operation thread running with fsm interval = 1000 us, max
data size=11250
EtherCAT DEBUG: mmap()
EtherCAT DEBUG: Vma fault, virtual_address = b7838000, offset = 0, page =
c18913e0   ?? Why is there a fault reported here ??

EtherCAT DEBUG: ecrt_master_slave_config(master = 0xc1092000, alias = 0,
position = 1, vendor_id = 0x00000002, product_code = 0x07d43052)
EtherCAT DEBUG: ecrt_master_slave_config(master = 0xc1092000, alias = 0,
position = 2, vendor_id = 0x00000002, product_code = 0x03f63052)
EtherCAT DEBUG: Changing state of slave 0 from PREOP to OP.
EtherCAT DEBUG: Configuring slave 0...
EtherCAT: Releasing master 0...
EtherCAT DEBUG: ecrt_master_deactivate(master = 0xc1092000)
EtherCAT DEBUG: Stopping master thread.
EtherCAT DEBUG: Master OP thread exiting...
EtherCAT: Master thread exited.
EtherCAT: Starting EtherCAT-IDLE thread.
EtherCAT DEBUG: OPERATION -> IDLE.
EtherCAT: Released master 0.
EtherCAT DEBUG: Idle thread running with send interval = 1000 us, max data
size=11250
EtherCAT DEBUG: Slave 0 is now in INIT.
EtherCAT DEBUG: Clearing FMMU configurations of slave 0...
EtherCAT DEBUG: Clearing sync manager configurations of slave 0...
EtherCAT DEBUG: Clearing DC assignment of slave 0...
EtherCAT DEBUG: Slave 0: DC system_time=98464183880
old_offset=18446733211451281926, app_time=0,
new_offset=18446733112987098046
EtherCAT DEBUG: Slave 0 does not support mailbox communication.
EtherCAT DEBUG: Slave 0 is now in PREOP.
EtherCAT DEBUG: Finished configuration of slave 0.
EtherCAT DEBUG: Changing state of slave 1 from PREOP to PREOP (forced).
EtherCAT DEBUG: Configuring slave 1...
EtherCAT DEBUG: Slave 1 is now in INIT.
EtherCAT DEBUG: Clearing FMMU configurations of slave 1...
EtherCAT DEBUG: Clearing sync manager configurations of slave 1...
EtherCAT DEBUG: Clearing DC assignment of slave 1...
EtherCAT DEBUG: Slave 1: DC system_time=98470246345
old_offset=18446733210763658096, app_time=0,
new_offset=18446733112293411751
EtherCAT DEBUG: Slave 1 does not support mailbox communication.
EtherCAT DEBUG: Slave 1 is now in PREOP.
EtherCAT DEBUG: Finished configuration of slave 1.
EtherCAT DEBUG: Changing state of slave 2 from PREOP to PREOP (forced).
EtherCAT DEBUG: Configuring slave 2...
EtherCAT DEBUG: Slave 2 is now in INIT.
EtherCAT DEBUG: Clearing FMMU configurations of slave 2...
EtherCAT DEBUG: Clearing sync manager configurations of slave 2...
EtherCAT DEBUG: Clearing DC assignment of slave 2...
EtherCAT DEBUG: Slave 2: DC system_time=98470342375
old_offset=18446733210755153406, app_time=0,
new_offset=18446733112284811031
EtherCAT DEBUG: Slave 2 does not support mailbox communication.
EtherCAT DEBUG: Slave 2 is now in PREOP.
EtherCAT DEBUG: Finished configuration of slave 2.

So it appears to me that the configuration got attached, but the slaves
never went to OP state, so data never can be exchanged -- what in the
world am I doing wrong?

I've attached the C source code for your review. Thanks!
-- 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: demo1.c
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20100317/46a3dcad/attachment-0002.c>


More information about the Etherlab-users mailing list