Closed starofsky closed 7 years ago
Get a wireshark log and you'll see, sounds like a slower cycle in the slave, One would expect 2 cycles if the slave cycle is at least as fast as the EtherCAT cycle. What type of slave is it?
hi I m also having a problem with reading and writing some of the slaves. I m using the simple_test code. it writes and reads from some slaves but not all. do you have any idea?
@waeltut I suggest you write your own issue, otherwise we'll hi-jack this and it will get mixed answers.
But for now.. Check the working counter, in OP it should be current working counter == expected working counter at all times. Otherwise you have slaves that for some reason have stepped down to SAFEOP. Then you need to find which one and read out its AlStatus and AlStatusCode
Hi @nakarlsson thanks for your reply. My slave have type 2, i set output1 and read input1 but I need three time send and receive function to get expect value on input1 ( =output1 ).
add more information, I sleep a time between cycles in master for sure my slave faster than master, but i also need three cycle to get right result.
@starofsky : Please provide a wireshark dump of your system.
@starofsky : thanks, could you also describe which data in the process image is being written/read (preferably with an output from slaveinfo
with the -map
option) as well as the expected behavior?
SM2 outputs
addr b index: sub bitl data_type name
[0x0035.0] 0x7030:0x01 0x10 UNSIGNED16 AO0
SM3 inputs
addr b index: sub bitl data_type name
[0x008D.0] 0x6030:0x02 0x10 INTEGER16 AI0
I set AO0 and get AI0.
From your wireshark dump it looks like it takes the slave around 40ms to latch the analog inputs and provide it to the bus:
Excerpt:
354. 0.184371 01:01:01:01:01:01 [LWR:00000000] DO: ['00', '00', '00', '00'] ( 0) AO0: ['d7', '64'] (25815) <-- set value
355. 0.185122 03:01:01:01:01:01 [LRD:00000055] DI: ['00', '00', '00', '00'] ( 0) AI0: ['15', '08'] ( 2069)
358. 0.202575 01:01:01:01:01:01 [LWR:00000000] DO: ['00', '00', '00', '00'] ( 0) AO0: ['d7', '64'] (25815)
359. 0.203299 03:01:01:01:01:01 [LRD:00000055] DI: ['00', '00', '00', '00'] ( 0) AI0: ['16', '08'] ( 2070)
362. 0.220647 01:01:01:01:01:01 [LWR:00000000] DO: ['00', '00', '00', '00'] ( 0) AO0: ['d7', '64'] (25815)
363. 0.221362 03:01:01:01:01:01 [LRD:00000055] DI: ['00', '00', '00', '00'] ( 0) AI0: ['88', '64'] (25736) <-- slave responds
I would say that this does not have to do with SOEM but a property of the slave. What slave is it? Have you checked the specification?
@mheden thank you for your help. I will test again on my slave.
Hi, I'm a beginner in EtherCAT. I used SOEM to test my slave. In slave code I put input = output. But I must use three time send and receive to get right input.
Do you have any idea?