kjcho Posted May 21, 2013 Share Posted May 21, 2013 Hi, I'm using TI ICE Board to implement EtherCAT Slave Controller. To use PPMAC as EtherCAT Master, I set configure file manually. But there's a problem. SDO data was not downloaded correctly. For example, when I wrote "0x4444" to 0x607D:1(32bit object), slave receive only lower 8bit (0x44). This problem isn't occurred when I use TwinCAT as EtherCAT Master. As I know, TI ICE Board has been conformed by EtherCAT Technology Group. And I use TI sample EtherCAT CiA402 implemented source. I attached wireshark packet capture file and PPMAC slave configure source. Please help. ECAT[0].Enable=0 sys.maxEcats=1 ECAT[0].SlaveCount=1 ECAT[0].RTnotLRW = 1 ECAT[0].ServoExtension = 1 ECAT[0].DistrClocks = 1 ECAT[0].DistrClocksCount = 0 ECAT[0].DCRefSlave = 0 ECAT[0].DcRefPlus = 2 ECAT[0].DcRefMinus = 2 ECAT[0].DcRefBand = 50000 ECAT[0].Slave[0].VendorID = $59d ECAT[0].Slave[0].ProductCode = $54490001 ECAT[0].Slave[0].Alias = 0 ECAT[0].Slave[0].Position = 0 ECAT[0].Slave[0].Enable = 1 ECAT[0].Slave[0].AssignActivate=$300 ECAT[0].Slave[0].Sync0Cycle = 500000 ECAT[0].Slave[0].Sync0Shift = 0 ECAT[0].Slave[0].Sync1Cycle = 500000 ECAT[0].Slave[0].Sync1Shift = 0 ECAT[0].Slave[0].PDO[0].index = $6040 ECAT[0].Slave[0].PDO[0].subindex = 0 ECAT[0].Slave[0].PDO[0].BitLength = 16 ECAT[0].Slave[0].PDO[0].Input = 0 ECAT[0].Slave[0].PDO[1].index = $60FF ECAT[0].Slave[0].PDO[1].subindex = 0 ECAT[0].Slave[0].PDO[1].BitLength = 32 ECAT[0].Slave[0].PDO[1].Input = 0 ECAT[0].Slave[0].PDO[2].index = $6041 ECAT[0].Slave[0].PDO[2].subindex = 0 ECAT[0].Slave[0].PDO[2].BitLength = 16 ECAT[0].Slave[0].PDO[2].Input = 1 ECAT[0].Slave[0].PDO[3].index = $6064 ECAT[0].Slave[0].PDO[3].subindex = 0 ECAT[0].Slave[0].PDO[3].BitLength = 32 ECAT[0].Slave[0].PDO[3].Input = 1 ECAT[0].Slave[0].PDOMapping[0].index = $1602; ECAT[0].Slave[0].PDOMapping[0].PDOCount = 2; ECAT[0].Slave[0].PDOMapping[0].pPDO = ECAT[0].Slave[0].PDO[0].a ECAT[0].Slave[0].PDOMapping[1].index = $1A02; ECAT[0].Slave[0].PDOMapping[1].PDOCount = 2; ECAT[0].Slave[0].PDOMapping[1].pPDO = ECAT[0].Slave[0].PDO[2].a ECAT[0].Slave[0].SyncManager[0].index = 2; ECAT[0].Slave[0].SyncManager[0].dir= 1; ECAT[0].Slave[0].SyncManager[0].PDOMappingCount = 1; ECAT[0].Slave[0].SyncManager[0].pPDOMapping = ECAT[0].Slave[0].PDOMapping[0].a ECAT[0].Slave[0].SyncManager[0].watchdogmode = 0; ECAT[0].Slave[0].SyncManager[1].index=3; ECAT[0].Slave[0].SyncManager[1].dir= 2; ECAT[0].Slave[0].SyncManager[1].PDOMappingCount = 1; ECAT[0].Slave[0].SyncManager[1].pPDOMapping = ECAT[0].Slave[0].PDOMapping[1].a ECAT[0].Slave[0].SyncManager[1].watchdogmode = 0; ECAT[0].IO[0].Slave = 0 ECAT[0].IO[0].Index = ECAT[0].Slave[0].PDO[0].index ECAT[0].IO[0].SubIndex = 0 ECAT[0].IO[0].BitLength = $10 ECAT[0].IO[0].Input = 0 ECAT[0].IO[1].Slave = 0 ECAT[0].IO[1].Index = ECAT[0].Slave[0].PDO[1].index ECAT[0].IO[1].SubIndex = 0 ECAT[0].IO[1].BitLength = $20 ECAT[0].IO[1].Input = 0 ECAT[0].IO[2].Slave = 0 ECAT[0].IO[2].Index = ECAT[0].Slave[0].PDO[2].index ECAT[0].IO[2].SubIndex = 0 ECAT[0].IO[2].BitLength = $10 ECAT[0].IO[2].Input = 1 ECAT[0].IO[3].Slave = 0 ECAT[0].IO[3].Index = ECAT[0].Slave[0].PDO[3].index ECAT[0].IO[3].SubIndex = 0 ECAT[0].IO[3].BitLength = $20 ECAT[0].IO[3].Input = 1 ECAT[0].IOCount=4 ECAT[0].Enable=1tmdxice3359.zipplc1.zip Link to comment Share on other sites More sharing options...
hbausley Posted May 22, 2013 Share Posted May 22, 2013 How are you setting 0x607D? Are you using an ecatsdo command? P0=ecatsdo(0,0,$607D,0,$4444,0) If so try the native command system ethercat -m0 -p0 -t int16 download 0x607D 0 0x4444 then read back system ethercat -m0 -p0 -t int16 upload 0x607D 0 If you find the native linux command works I suspect it is because if the incorrect length is requested an error is not being returned by your device. Our ecatsdo attempts the ethercat command above and if no error is returned it returns. It first attempts an 8 bit write, then a 16 bit, then 32 bit write. I think ecatsdo may be doing an 8 bit write and gets no error and returns. I have found most devices obey this. We will consider adding a new command ecatsdotype(0,0,$607D,0,$4444,0,bitlength) that forces you to specify the bit length for future firmware updates. Hi, I'm using TI ICE Board to implement EtherCAT Slave Controller. To use PPMAC as EtherCAT Master, I set configure file manually. But there's a problem. SDO data was not downloaded correctly. For example, when I wrote "0x4444" to 0x607D:1(32bit object), slave receive only lower 8bit (0x44). This problem isn't occurred when I use TwinCAT as EtherCAT Master. As I know, TI ICE Board has been conformed by EtherCAT Technology Group. And I use TI sample EtherCAT CiA402 implemented source. I attached wireshark packet capture file and PPMAC slave configure source. Please help. ECAT[0].Enable=0 sys.maxEcats=1 ECAT[0].SlaveCount=1 ECAT[0].RTnotLRW = 1 ECAT[0].ServoExtension = 1 ECAT[0].DistrClocks = 1 ECAT[0].DistrClocksCount = 0 ECAT[0].DCRefSlave = 0 ECAT[0].DcRefPlus = 2 ECAT[0].DcRefMinus = 2 ECAT[0].DcRefBand = 50000 ECAT[0].Slave[0].VendorID = $59d ECAT[0].Slave[0].ProductCode = $54490001 ECAT[0].Slave[0].Alias = 0 ECAT[0].Slave[0].Position = 0 ECAT[0].Slave[0].Enable = 1 ECAT[0].Slave[0].AssignActivate=$300 ECAT[0].Slave[0].Sync0Cycle = 500000 ECAT[0].Slave[0].Sync0Shift = 0 ECAT[0].Slave[0].Sync1Cycle = 500000 ECAT[0].Slave[0].Sync1Shift = 0 ECAT[0].Slave[0].PDO[0].index = $6040 ECAT[0].Slave[0].PDO[0].subindex = 0 ECAT[0].Slave[0].PDO[0].BitLength = 16 ECAT[0].Slave[0].PDO[0].Input = 0 ECAT[0].Slave[0].PDO[1].index = $60FF ECAT[0].Slave[0].PDO[1].subindex = 0 ECAT[0].Slave[0].PDO[1].BitLength = 32 ECAT[0].Slave[0].PDO[1].Input = 0 ECAT[0].Slave[0].PDO[2].index = $6041 ECAT[0].Slave[0].PDO[2].subindex = 0 ECAT[0].Slave[0].PDO[2].BitLength = 16 ECAT[0].Slave[0].PDO[2].Input = 1 ECAT[0].Slave[0].PDO[3].index = $6064 ECAT[0].Slave[0].PDO[3].subindex = 0 ECAT[0].Slave[0].PDO[3].BitLength = 32 ECAT[0].Slave[0].PDO[3].Input = 1 ECAT[0].Slave[0].PDOMapping[0].index = $1602; ECAT[0].Slave[0].PDOMapping[0].PDOCount = 2; ECAT[0].Slave[0].PDOMapping[0].pPDO = ECAT[0].Slave[0].PDO[0].a ECAT[0].Slave[0].PDOMapping[1].index = $1A02; ECAT[0].Slave[0].PDOMapping[1].PDOCount = 2; ECAT[0].Slave[0].PDOMapping[1].pPDO = ECAT[0].Slave[0].PDO[2].a ECAT[0].Slave[0].SyncManager[0].index = 2; ECAT[0].Slave[0].SyncManager[0].dir= 1; ECAT[0].Slave[0].SyncManager[0].PDOMappingCount = 1; ECAT[0].Slave[0].SyncManager[0].pPDOMapping = ECAT[0].Slave[0].PDOMapping[0].a ECAT[0].Slave[0].SyncManager[0].watchdogmode = 0; ECAT[0].Slave[0].SyncManager[1].index=3; ECAT[0].Slave[0].SyncManager[1].dir= 2; ECAT[0].Slave[0].SyncManager[1].PDOMappingCount = 1; ECAT[0].Slave[0].SyncManager[1].pPDOMapping = ECAT[0].Slave[0].PDOMapping[1].a ECAT[0].Slave[0].SyncManager[1].watchdogmode = 0; ECAT[0].IO[0].Slave = 0 ECAT[0].IO[0].Index = ECAT[0].Slave[0].PDO[0].index ECAT[0].IO[0].SubIndex = 0 ECAT[0].IO[0].BitLength = $10 ECAT[0].IO[0].Input = 0 ECAT[0].IO[1].Slave = 0 ECAT[0].IO[1].Index = ECAT[0].Slave[0].PDO[1].index ECAT[0].IO[1].SubIndex = 0 ECAT[0].IO[1].BitLength = $20 ECAT[0].IO[1].Input = 0 ECAT[0].IO[2].Slave = 0 ECAT[0].IO[2].Index = ECAT[0].Slave[0].PDO[2].index ECAT[0].IO[2].SubIndex = 0 ECAT[0].IO[2].BitLength = $10 ECAT[0].IO[2].Input = 1 ECAT[0].IO[3].Slave = 0 ECAT[0].IO[3].Index = ECAT[0].Slave[0].PDO[3].index ECAT[0].IO[3].SubIndex = 0 ECAT[0].IO[3].BitLength = $20 ECAT[0].IO[3].Input = 1 ECAT[0].IOCount=4 ECAT[0].Enable=1 Link to comment Share on other sites More sharing options...
kjcho Posted May 23, 2013 Author Share Posted May 23, 2013 The native command works. Is this slaves's problem?? What is "-m0"? If I want to write SDO to 2nd slave, do I have to change "-m1"? And when "ecatsdotype" command is updated? Thanks. How are you setting 0x607D? Are you using an ecatsdo command? P0=ecatsdo(0,0,$607D,0,$4444,0) If so try the native command system ethercat -m0 -p0 -t int16 download 0x607D 0 0x4444 then read back system ethercat -m0 -p0 -t int16 upload 0x607D 0 If you find the native linux command works I suspect it is because if the incorrect length is requested an error is not being returned by your device. Our ecatsdo attempts the ethercat command above and if no error is returned it returns. It first attempts an 8 bit write, then a 16 bit, then 32 bit write. I think ecatsdo may be doing an 8 bit write and gets no error and returns. I have found most devices obey this. We will consider adding a new command ecatsdotype(0,0,$607D,0,$4444,0,bitlength) that forces you to specify the bit length for future firmware updates. Hi, I'm using TI ICE Board to implement EtherCAT Slave Controller. To use PPMAC as EtherCAT Master, I set configure file manually. But there's a problem. SDO data was not downloaded correctly. For example, when I wrote "0x4444" to 0x607D:1(32bit object), slave receive only lower 8bit (0x44). This problem isn't occurred when I use TwinCAT as EtherCAT Master. As I know, TI ICE Board has been conformed by EtherCAT Technology Group. And I use TI sample EtherCAT CiA402 implemented source. I attached wireshark packet capture file and PPMAC slave configure source. Please help. ECAT[0].Enable=0 sys.maxEcats=1 ECAT[0].SlaveCount=1 ECAT[0].RTnotLRW = 1 ECAT[0].ServoExtension = 1 ECAT[0].DistrClocks = 1 ECAT[0].DistrClocksCount = 0 ECAT[0].DCRefSlave = 0 ECAT[0].DcRefPlus = 2 ECAT[0].DcRefMinus = 2 ECAT[0].DcRefBand = 50000 ECAT[0].Slave[0].VendorID = $59d ECAT[0].Slave[0].ProductCode = $54490001 ECAT[0].Slave[0].Alias = 0 ECAT[0].Slave[0].Position = 0 ECAT[0].Slave[0].Enable = 1 ECAT[0].Slave[0].AssignActivate=$300 ECAT[0].Slave[0].Sync0Cycle = 500000 ECAT[0].Slave[0].Sync0Shift = 0 ECAT[0].Slave[0].Sync1Cycle = 500000 ECAT[0].Slave[0].Sync1Shift = 0 ECAT[0].Slave[0].PDO[0].index = $6040 ECAT[0].Slave[0].PDO[0].subindex = 0 ECAT[0].Slave[0].PDO[0].BitLength = 16 ECAT[0].Slave[0].PDO[0].Input = 0 ECAT[0].Slave[0].PDO[1].index = $60FF ECAT[0].Slave[0].PDO[1].subindex = 0 ECAT[0].Slave[0].PDO[1].BitLength = 32 ECAT[0].Slave[0].PDO[1].Input = 0 ECAT[0].Slave[0].PDO[2].index = $6041 ECAT[0].Slave[0].PDO[2].subindex = 0 ECAT[0].Slave[0].PDO[2].BitLength = 16 ECAT[0].Slave[0].PDO[2].Input = 1 ECAT[0].Slave[0].PDO[3].index = $6064 ECAT[0].Slave[0].PDO[3].subindex = 0 ECAT[0].Slave[0].PDO[3].BitLength = 32 ECAT[0].Slave[0].PDO[3].Input = 1 ECAT[0].Slave[0].PDOMapping[0].index = $1602; ECAT[0].Slave[0].PDOMapping[0].PDOCount = 2; ECAT[0].Slave[0].PDOMapping[0].pPDO = ECAT[0].Slave[0].PDO[0].a ECAT[0].Slave[0].PDOMapping[1].index = $1A02; ECAT[0].Slave[0].PDOMapping[1].PDOCount = 2; ECAT[0].Slave[0].PDOMapping[1].pPDO = ECAT[0].Slave[0].PDO[2].a ECAT[0].Slave[0].SyncManager[0].index = 2; ECAT[0].Slave[0].SyncManager[0].dir= 1; ECAT[0].Slave[0].SyncManager[0].PDOMappingCount = 1; ECAT[0].Slave[0].SyncManager[0].pPDOMapping = ECAT[0].Slave[0].PDOMapping[0].a ECAT[0].Slave[0].SyncManager[0].watchdogmode = 0; ECAT[0].Slave[0].SyncManager[1].index=3; ECAT[0].Slave[0].SyncManager[1].dir= 2; ECAT[0].Slave[0].SyncManager[1].PDOMappingCount = 1; ECAT[0].Slave[0].SyncManager[1].pPDOMapping = ECAT[0].Slave[0].PDOMapping[1].a ECAT[0].Slave[0].SyncManager[1].watchdogmode = 0; ECAT[0].IO[0].Slave = 0 ECAT[0].IO[0].Index = ECAT[0].Slave[0].PDO[0].index ECAT[0].IO[0].SubIndex = 0 ECAT[0].IO[0].BitLength = $10 ECAT[0].IO[0].Input = 0 ECAT[0].IO[1].Slave = 0 ECAT[0].IO[1].Index = ECAT[0].Slave[0].PDO[1].index ECAT[0].IO[1].SubIndex = 0 ECAT[0].IO[1].BitLength = $20 ECAT[0].IO[1].Input = 0 ECAT[0].IO[2].Slave = 0 ECAT[0].IO[2].Index = ECAT[0].Slave[0].PDO[2].index ECAT[0].IO[2].SubIndex = 0 ECAT[0].IO[2].BitLength = $10 ECAT[0].IO[2].Input = 1 ECAT[0].IO[3].Slave = 0 ECAT[0].IO[3].Index = ECAT[0].Slave[0].PDO[3].index ECAT[0].IO[3].SubIndex = 0 ECAT[0].IO[3].BitLength = $20 ECAT[0].IO[3].Input = 1 ECAT[0].IOCount=4 ECAT[0].Enable=1 Link to comment Share on other sites More sharing options...
hbausley Posted May 23, 2013 Share Posted May 23, 2013 I believe this is an omission of error checking in the sample slave code. In the slave code firmware you can check to make sure that you are receiving the correct number of bytes and if you do not return an error. This is how almost all the slaves we have tested seem to work. -m0 is for the master number. If you have a ethercat master card with two ports you need to specify -m0 or -m1 to indicate which master to use. If you have an ethercat master card with a single port you may omit the -m0 To write to the second slave use the -p parameter. -p0 is the first slave, -p1 the second slave, -p2 the third etc. issue the command system ethercat -- help and you will see all of the possible parameters The new command being considered could appear in the next release of the firmware release which we do not yet have scheduled but I can only guess will be in Q4 of this year. In the mean time you can use the system command to work around the issue or modify the slave firmware. The native command works. Is this slaves's problem?? What is "-m0"? If I want to write SDO to 2nd slave, do I have to change "-m1"? And when "ecatsdotype" command is updated? Thanks. How are you setting 0x607D? Are you using an ecatsdo command? P0=ecatsdo(0,0,$607D,0,$4444,0) If so try the native command system ethercat -m0 -p0 -t int16 download 0x607D 0 0x4444 then read back system ethercat -m0 -p0 -t int16 upload 0x607D 0 If you find the native linux command works I suspect it is because if the incorrect length is requested an error is not being returned by your device. Our ecatsdo attempts the ethercat command above and if no error is returned it returns. It first attempts an 8 bit write, then a 16 bit, then 32 bit write. I think ecatsdo may be doing an 8 bit write and gets no error and returns. I have found most devices obey this. We will consider adding a new command ecatsdotype(0,0,$607D,0,$4444,0,bitlength) that forces you to specify the bit length for future firmware updates. Hi, I'm using TI ICE Board to implement EtherCAT Slave Controller. To use PPMAC as EtherCAT Master, I set configure file manually. But there's a problem. SDO data was not downloaded correctly. For example, when I wrote "0x4444" to 0x607D:1(32bit object), slave receive only lower 8bit (0x44). This problem isn't occurred when I use TwinCAT as EtherCAT Master. As I know, TI ICE Board has been conformed by EtherCAT Technology Group. And I use TI sample EtherCAT CiA402 implemented source. I attached wireshark packet capture file and PPMAC slave configure source. Please help. ECAT[0].Enable=0 sys.maxEcats=1 ECAT[0].SlaveCount=1 ECAT[0].RTnotLRW = 1 ECAT[0].ServoExtension = 1 ECAT[0].DistrClocks = 1 ECAT[0].DistrClocksCount = 0 ECAT[0].DCRefSlave = 0 ECAT[0].DcRefPlus = 2 ECAT[0].DcRefMinus = 2 ECAT[0].DcRefBand = 50000 ECAT[0].Slave[0].VendorID = $59d ECAT[0].Slave[0].ProductCode = $54490001 ECAT[0].Slave[0].Alias = 0 ECAT[0].Slave[0].Position = 0 ECAT[0].Slave[0].Enable = 1 ECAT[0].Slave[0].AssignActivate=$300 ECAT[0].Slave[0].Sync0Cycle = 500000 ECAT[0].Slave[0].Sync0Shift = 0 ECAT[0].Slave[0].Sync1Cycle = 500000 ECAT[0].Slave[0].Sync1Shift = 0 ECAT[0].Slave[0].PDO[0].index = $6040 ECAT[0].Slave[0].PDO[0].subindex = 0 ECAT[0].Slave[0].PDO[0].BitLength = 16 ECAT[0].Slave[0].PDO[0].Input = 0 ECAT[0].Slave[0].PDO[1].index = $60FF ECAT[0].Slave[0].PDO[1].subindex = 0 ECAT[0].Slave[0].PDO[1].BitLength = 32 ECAT[0].Slave[0].PDO[1].Input = 0 ECAT[0].Slave[0].PDO[2].index = $6041 ECAT[0].Slave[0].PDO[2].subindex = 0 ECAT[0].Slave[0].PDO[2].BitLength = 16 ECAT[0].Slave[0].PDO[2].Input = 1 ECAT[0].Slave[0].PDO[3].index = $6064 ECAT[0].Slave[0].PDO[3].subindex = 0 ECAT[0].Slave[0].PDO[3].BitLength = 32 ECAT[0].Slave[0].PDO[3].Input = 1 ECAT[0].Slave[0].PDOMapping[0].index = $1602; ECAT[0].Slave[0].PDOMapping[0].PDOCount = 2; ECAT[0].Slave[0].PDOMapping[0].pPDO = ECAT[0].Slave[0].PDO[0].a ECAT[0].Slave[0].PDOMapping[1].index = $1A02; ECAT[0].Slave[0].PDOMapping[1].PDOCount = 2; ECAT[0].Slave[0].PDOMapping[1].pPDO = ECAT[0].Slave[0].PDO[2].a ECAT[0].Slave[0].SyncManager[0].index = 2; ECAT[0].Slave[0].SyncManager[0].dir= 1; ECAT[0].Slave[0].SyncManager[0].PDOMappingCount = 1; ECAT[0].Slave[0].SyncManager[0].pPDOMapping = ECAT[0].Slave[0].PDOMapping[0].a ECAT[0].Slave[0].SyncManager[0].watchdogmode = 0; ECAT[0].Slave[0].SyncManager[1].index=3; ECAT[0].Slave[0].SyncManager[1].dir= 2; ECAT[0].Slave[0].SyncManager[1].PDOMappingCount = 1; ECAT[0].Slave[0].SyncManager[1].pPDOMapping = ECAT[0].Slave[0].PDOMapping[1].a ECAT[0].Slave[0].SyncManager[1].watchdogmode = 0; ECAT[0].IO[0].Slave = 0 ECAT[0].IO[0].Index = ECAT[0].Slave[0].PDO[0].index ECAT[0].IO[0].SubIndex = 0 ECAT[0].IO[0].BitLength = $10 ECAT[0].IO[0].Input = 0 ECAT[0].IO[1].Slave = 0 ECAT[0].IO[1].Index = ECAT[0].Slave[0].PDO[1].index ECAT[0].IO[1].SubIndex = 0 ECAT[0].IO[1].BitLength = $20 ECAT[0].IO[1].Input = 0 ECAT[0].IO[2].Slave = 0 ECAT[0].IO[2].Index = ECAT[0].Slave[0].PDO[2].index ECAT[0].IO[2].SubIndex = 0 ECAT[0].IO[2].BitLength = $10 ECAT[0].IO[2].Input = 1 ECAT[0].IO[3].Slave = 0 ECAT[0].IO[3].Index = ECAT[0].Slave[0].PDO[3].index ECAT[0].IO[3].SubIndex = 0 ECAT[0].IO[3].BitLength = $20 ECAT[0].IO[3].Input = 1 ECAT[0].IOCount=4 ECAT[0].Enable=1 Link to comment Share on other sites More sharing options...
Recommended Posts