Closed SamuelJamesFisher closed 3 years ago
One common mistake for this sample code is not removing the cyclicly adding of ++ to IOmap byte 0. For you it means the controlword of drive 1 will alter every RTthread call. If you also experience issues with drive 2, a wireshark would help, NOTE: Windows is not ideal when it comes to realtime, and you might experience "glitches" in communcation on NICs.
void CALLBACK RTthread(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) .. IOmap[0]++; <--- this will alter your slave 1 control word
@SamuelJamesFisher, Still a problem?
Sorry for the delay. I have solved it. "IOmap[0]++" Was not helping. Other things I learned to help others out, Don't bother trying to do sync or any Realtime stuff with a windows laptop, Panasonic minas a6 servo driver and probably others need constant communication, READ READ the servo driver ethercat manual THOROUGHLY there could be a small line that you hadn't done which causes the whole thing not to work.
Hello, I'm new to SOEM, trying to control actuator with a Panasonic minas a6 servo driver. My issue is that the relay is clicking on and off, I know there will be something simple wrong in my code which i have been bashing my head on for the last week. Please could you take some time out of your day and have a look at this hideous beast.
ecinit on \Device\NPF{BB694750-FBA8-4150-A229-0B3599800059} succeeded. 2 slaves found and configured. Calculated workcounter 6
Slave:1 Name:MDDLN55BE Output size: 72bits Input size: 184bits State: 4 Delay: 0[ns] Has DC: 1 DCParentport:0 Activeports:1.1.0.0 Configured address: 1001 Man: 0000066f ID: 60380009 Rev: 00010000 SM0 A:1000 L: 256 F:00010026 Type:1 SM1 A:1200 L: 256 F:00010022 Type:2 SM2 A:1400 L: 9 F:00010064 Type:3 SM3 A:1600 L: 23 F:00010020 Type:4 FMMU0 Ls:00000000 Ll: 9 Lsb:0 Leb:7 Ps:1400 Psb:0 Ty:02 Act:01 FMMU1 Ls:00000012 Ll: 23 Lsb:0 Leb:7 Ps:1600 Psb:0 Ty:01 Act:01 FMMUfunc 0:1 1:2 2:3 3:0 MBX length wr: 256 rd: 256 MBX protocols : 04 CoE details: 0f FoE details: 00 EoE details: 00 SoE details: 00 Ebus current: 0[mA] only LRD/LWR:0 PDO mapping according to CoE : SM2 outputs addr b index: sub bitl data_type name [0x0000.0] 0x6040:0x00 0x10 UNSIGNED16 Controlword [0x0002.0] 0x6060:0x00 0x08 INTEGER8 Modes of operation [0x0003.0] 0x607A:0x00 0x20 INTEGER32 Target position [0x0007.0] 0x60B8:0x00 0x10 UNSIGNED16 Touch probe function SM3 inputs addr b index: sub bitl data_type name [0x0012.0] 0x603F:0x00 0x10 UNSIGNED16 Error code [0x0014.0] 0x6041:0x00 0x10 UNSIGNED16 Statusword [0x0016.0] 0x6061:0x00 0x08 INTEGER8 Modes of operation display [0x0017.0] 0x6064:0x00 0x20 INTEGER32 Position actual value [0x001B.0] 0x60B9:0x00 0x10 UNSIGNED16 Touch probe status [0x001D.0] 0x60BA:0x00 0x20 INTEGER32 Touch probe pos1 pos value [0x0021.0] 0x60F4:0x00 0x20 INTEGER32 Following error actual value [0x0025.0] 0x60FD:0x00 0x20 UNSIGNED32 Digital inputs
Slave:2 Name:MDDLN55BE Output size: 72bits Input size: 184bits State: 4 Delay: 660[ns] Has DC: 1 DCParentport:1 Activeports:1.0.0.0 Configured address: 1002 Man: 0000066f ID: 60380009 Rev: 00010000 SM0 A:1000 L: 256 F:00010026 Type:1 SM1 A:1200 L: 256 F:00010022 Type:2 SM2 A:1400 L: 9 F:00010064 Type:3 SM3 A:1600 L: 23 F:00010020 Type:4 FMMU0 Ls:00000009 Ll: 9 Lsb:0 Leb:7 Ps:1400 Psb:0 Ty:02 Act:01 FMMU1 Ls:00000029 Ll: 23 Lsb:0 Leb:7 Ps:1600 Psb:0 Ty:01 Act:01 FMMUfunc 0:1 1:2 2:3 3:0 MBX length wr: 256 rd: 256 MBX protocols : 04 CoE details: 0f FoE details: 00 EoE details: 00 SoE details: 00 Ebus current: 0[mA] only LRD/LWR:0 PDO mapping according to CoE : SM2 outputs addr b index: sub bitl data_type name [0x0009.0] 0x6040:0x00 0x10 UNSIGNED16 Controlword [0x000B.0] 0x6060:0x00 0x08 INTEGER8 Modes of operation [0x000C.0] 0x607A:0x00 0x20 INTEGER32 Target position [0x0010.0] 0x60B8:0x00 0x10 UNSIGNED16 Touch probe function SM3 inputs addr b index: sub bitl data_type name [0x0029.0] 0x603F:0x00 0x10 UNSIGNED16 Error code [0x002B.0] 0x6041:0x00 0x10 UNSIGNED16 Statusword [0x002D.0] 0x6061:0x00 0x08 INTEGER8 Modes of operation display [0x002E.0] 0x6064:0x00 0x20 INTEGER32 Position actual value [0x0032.0] 0x60B9:0x00 0x10 UNSIGNED16 Touch probe status [0x0034.0] 0x60BA:0x00 0x20 INTEGER32 Touch probe pos1 pos value [0x0038.0] 0x60F4:0x00 0x20 INTEGER32 Following error actual value [0x003C.0] 0x60FD:0x00 0x20 UNSIGNED32 Digital inputs End slaveinfo, close socket End program