Closed edokkir closed 5 years ago
I think it is a signed/unsigned issue with the vendorID. We never tested with slaves where the vendor ID is that big.
If you have the ability to run from source, please test against the latest "master". I created a bugfix commit here https://github.com/ihmcrobotics/ihmc-ethercat-master/commit/61897557625238b2fcae6a21b71158985de64c60
In your code, change vendor ID and productCode to
static final long vendorID = 0xE0000044L; static final long productCode = 0x0000002EL;
note the (L) at the end of the variable, which forces it to be a long value. This avoids integer overflow and wrapping to a negative value.
If you can't use the code from source, please let me know and I'll try to push a new release later today
Thank you for the prompt reply, I have done the relevant changes, now I get this right out on the first line:
Exception in thread "main" java.lang.NoSuchMethodError: us.ihmc.etherCAT.master.Slave.<init>(JJII)V
You're still linking to the old version of the master. Make sure you updated to the master version from source.
If you can't get it to work from source I'll have to make a release, but that'll take some time.
Yes, I had missed the last gradlew jar part, now it seems to be working. At least this case is over, thank you for the prompt and precise help.
Awesome. I'll make a release including this fix soon then.
OS, running in virtualbox: (experimental test) Linux vbox-ubuntu 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux Jdk: java version "1.8.0_191" Java(TM) SE Runtime Environment (build 1.8.0_191-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
Slave object: netHat 52 from Hilscher
Steps to reproduce issue
Can you please guide me to resolve coding a slave module and accessing its registers? Is there an error in mapping the slaveInfo output to the java slave file? Is it mandatory to run from a native computer, not a virtual machine? (for test purposes)
I have gone through the steps in ihmc-ethercat-master to create the environment. Managed to get slaveInfo to produce the information of the slave:
Found 1 slaves 1 - 0:0 netX Manufacturer: 0xe0000044 Product code: 0x0000002e Revision: 262149 Distributed Clocks: yes SM(0) Address: 0x1000, length: 128 Flags: 65590 Type: Mailbox messages receive SM(1) Address: 0x1080, length: 128 Flags: 65586 Type: Mailbox messages transmit SM(2) Address: 0x1100, length: 200 Flags: 65652 Type: Cyclic process data receive RxPDO 0x1600 RxPDO 0x2000:0x01 UNSIGNED8 1 Byte Out (0) 0x2000:0x02 UNSIGNED8 1 Byte Out (1) 0x2000:0x03 UNSIGNED8 1 Byte Out (2) 0x2000:0x04 UNSIGNED8 1 Byte Out (3) 0x2000:0x05 UNSIGNED8 1 Byte Out (4) 0x2000:0x06 UNSIGNED8 1 Byte Out (5) 0x2000:0x07 UNSIGNED8 1 Byte Out (6) 0x2000:0x08 UNSIGNED8 1 Byte Out (7) 0x2000:0x09 UNSIGNED8 1 Byte Out (8) 0x2000:0x0a UNSIGNED8 1 Byte Out (9) 0x2000:0x0b UNSIGNED8 1 Byte Out (10) 0x2000:0x0c UNSIGNED8 1 Byte Out (11) 0x2000:0x0d UNSIGNED8 1 Byte Out (12) 0x2000:0x0e UNSIGNED8 1 Byte Out (13) 0x2000:0x0f UNSIGNED8 1 Byte Out (14) 0x2000:0x10 UNSIGNED8 1 Byte Out (15) 0x2000:0x11 UNSIGNED8 1 Byte Out (16) 0x2000:0x12 UNSIGNED8 1 Byte Out (17) 0x2000:0x13 UNSIGNED8 1 Byte Out (18) 0x2000:0x14 UNSIGNED8 1 Byte Out (19) 0x2000:0x15 UNSIGNED8 1 Byte Out (20) 0x2000:0x16 UNSIGNED8 1 Byte Out (21) 0x2000:0x17 UNSIGNED8 1 Byte Out (22) 0x2000:0x18 UNSIGNED8 1 Byte Out (23) 0x2000:0x19 UNSIGNED8 1 Byte Out (24) 0x2000:0x1a UNSIGNED8 1 Byte Out (25) 0x2000:0x1b UNSIGNED8 1 Byte Out (26) 0x2000:0x1c UNSIGNED8 1 Byte Out (27) 0x2000:0x1d UNSIGNED8 1 Byte Out (28) 0x2000:0x1e UNSIGNED8 1 Byte Out (29) 0x2000:0x1f UNSIGNED8 1 Byte Out (30) 0x2000:0x20 UNSIGNED8 1 Byte Out (31) SM(3) Address: 0x1d00, length: 200 Flags: 65584 Type: Cyclic process data transmit TxPDO 0x1a00 TxPDO 0x3000:0x01 UNSIGNED8 1 Byte In (0) 0x3000:0x02 UNSIGNED8 1 Byte In (1) 0x3000:0x03 UNSIGNED8 1 Byte In (2) 0x3000:0x04 UNSIGNED8 1 Byte In (3) 0x3000:0x05 UNSIGNED8 1 Byte In (4) 0x3000:0x06 UNSIGNED8 1 Byte In (5) 0x3000:0x07 UNSIGNED8 1 Byte In (6) 0x3000:0x08 UNSIGNED8 1 Byte In (7) 0x3000:0x09 UNSIGNED8 1 Byte In (8) 0x3000:0x0a UNSIGNED8 1 Byte In (9) 0x3000:0x0b UNSIGNED8 1 Byte In (10) 0x3000:0x0c UNSIGNED8 1 Byte In (11) 0x3000:0x0d UNSIGNED8 1 Byte In (12) 0x3000:0x0e UNSIGNED8 1 Byte In (13) 0x3000:0x0f UNSIGNED8 1 Byte In (14) 0x3000:0x10 UNSIGNED8 1 Byte In (15) 0x3000:0x11 UNSIGNED8 1 Byte In (16) 0x3000:0x12 UNSIGNED8 1 Byte In (17) 0x3000:0x13 UNSIGNED8 1 Byte In (18) 0x3000:0x14 UNSIGNED8 1 Byte In (19) 0x3000:0x15 UNSIGNED8 1 Byte In (20) 0x3000:0x16 UNSIGNED8 1 Byte In (21) 0x3000:0x17 UNSIGNED8 1 Byte In (22) 0x3000:0x18 UNSIGNED8 1 Byte In (23) 0x3000:0x19 UNSIGNED8 1 Byte In (24) 0x3000:0x1a UNSIGNED8 1 Byte In (25) 0x3000:0x1b UNSIGNED8 1 Byte In (26) 0x3000:0x1c UNSIGNED8 1 Byte In (27) 0x3000:0x1d UNSIGNED8 1 Byte In (28) 0x3000:0x1e UNSIGNED8 1 Byte In (29) 0x3000:0x1f UNSIGNED8 1 Byte In (30) 0x3000:0x20 UNSIGNED8 1 Byte In (31)
Created a slave java file to run: ` import us.ihmc.etherCAT.master.RxPDO; import us.ihmc.etherCAT.master.Slave; import us.ihmc.etherCAT.master.SyncManager; import us.ihmc.etherCAT.master.TxPDO;
public class NetHat extends Slave {
Expected behavior
No exceptions so that the doControl loop runs.
Actual behavior
Attaching native thread 13975 with priority 50 to JVM [9230434750219] Master: Setting up fast IRQ [9230454179216] Master: Creating context [9230456023885] Master: Opening interface
*
[9230477200711] Master: Initializing slaves [9230514861661] Master: DC Enabled [9230514965239] Master: Configured slaves Exception in thread "realtime-thread-1" java.lang.RuntimeException: java.io.IOException: Invalid slave configuration for slave 0:0. Invalid vendor and/or product code at us.ihmc.etherCAT.master.EtherCATRealtimeThread.run(EtherCATRealtimeThread.java:220) at us.ihmc.etherCAT.master.EtherCATRealtimeThread.access$000(EtherCATRealtimeThread.java:25) at us.ihmc.etherCAT.master.EtherCATRealtimeThread$1.run(EtherCATRealtimeThread.java:87) at us.ihmc.realtime.RealtimeThread.run(RealtimeThread.java:172) at us.ihmc.realtime.RealtimeThread.runFromNative(RealtimeThread.java:164) Caused by: java.io.IOException: Invalid slave configuration for slave 0:0. Invalid vendor and/or product code at us.ihmc.etherCAT.master.Master.init(Master.java:337) at us.ihmc.etherCAT.master.EtherCATRealtimeThread.run(EtherCATRealtimeThread.java:216) ... 4 more
Contributors with relevant knowledge or expertise (optional)