Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Invalid FMMU Configuration, not skipping unused SyncManagers #878

Open
Guistac opened this issue Dec 15, 2024 · 3 comments
Open

Bug: Invalid FMMU Configuration, not skipping unused SyncManagers #878

Guistac opened this issue Dec 15, 2024 · 3 comments

Comments

@Guistac
Copy link

Guistac commented Dec 15, 2024

Hello,

I'm encountering an issue with a Beckhoff EtherCat device (ELM7231-9016)
This device calls for the mandatory use of SM 6&7 for transmission of FSOE PDUs (as per the .xml datasheet)
Though its regular process data is still expected to be exchanged through SM 2&3.

By selecting my PDOs through objects x1C12 x1C13 x1C16 x1C17 and also setting the correct Sync0 and Sync1 times, I am able to bring my device into Operational State. SOEM correctly reports the configured process data length to be the sum of all four SyncManager sizes, and process data is written/read successfully for SM 2&3. But process data sent to SM 6&7 is not received by the device, and the data received from the slave seems to be misaligned or faulty (though it is consistent and not random)

My understanding of how SOEM works is still a bit limited, but I have the impression that the library does not configure FMMUs above the first 4, which would cause process data for SM6&7 to not be mapped to any particular slave memory.

Could you give me some pointers on how and where I could implement a workaround ?

Thank you !

@Guistac
Copy link
Author

Guistac commented Dec 15, 2024

After some digging I found out that SOEM actually tries to configure FMMU[1,3] for use with SM[6,7].
The data lengths are correct, but it seems that the Physical Start Addresses are mismatched.

ELM7231-9016_ESI

After looking at the ESI file again, SOEM actually takes default values for SM[4,5] instead of those from SM[6,7].
FMMU[1,3] get configured with physical Start Addresses 0x1A00 and 0x1C00 instead of 0x1E00 and 0x1F00.
This is surprising since SM[4,5] should not be enabled by default, but it would explain the misaligned data.

Is there some patch I can apply to the library to fix this or is it better to somehow manually override this in my startup sequence?

@Guistac Guistac changed the title Use of SM/FMMU 6&7 for Process Data Bug: Invalid FMMU Configuration, not skipping unused SyncManagers Dec 16, 2024
@ArthurKetels
Copy link
Contributor

Could you show the output of slaveinfo -map to see what the information given by the slave is?

@Guistac
Copy link
Author

Guistac commented Dec 18, 2024

Hi ! Of course, here's the output after a power cycle, with none of my configuration of the process data in SM6,7

Slave:2
 Name:ELM7231-9016
 Output size: 48bits
 Input size: 80bits
 State: 18
 Delay: 145[ns]
 Has DC: 1
 DCParentport:1
 Activeports:1.1.0.0
 Configured address: 1002
 Man: 00000002 ID: 502275f9 Rev: 00122338
 SM0 A:1000 L: 256 F:00010026 Type:1
 SM1 A:1100 L: 256 F:00010022 Type:2
 SM2 A:1200 L:   6 F:00010024 Type:3
 SM3 A:1600 L:  10 F:00010020 Type:4
 SM4 A:1a00 L:   0 F:00000024 Type:3
 SM5 A:1c00 L:   0 F:00000020 Type:4
 SM6 A:1e00 L:  10 F:00010024 Type:3
 SM7 A:1f00 L:  10 F:00010020 Type:4
 FMMU0 Ls:00000000 Ll:   6 Lsb:0 Leb:7 Ps:1200 Psb:0 Ty:02 Act:01
 FMMU1 Ls:00000015 Ll:  10 Lsb:0 Leb:7 Ps:1600 Psb:0 Ty:01 Act:01
 FMMUfunc 0:1 1:2 2:3 3:1
 MBX length wr: 256 rd: 256 MBX protocols : 0c
 CoE details: 2f FoE details: 01 EoE details: 00 SoE details: 00
 Ebus current: 160[mA]
 only LRD/LWR:0
PDO mapping according to CoE :
  SM2 outputs
     addr b   index: sub bitl data_type    name
  [0x0000.0] 0x7010:0x01 0x10 UNSIGNED16   Controlword
  [0x0002.0] 0x7010:0x05 0x20 UNSIGNED32   Target position
  SM3 inputs
     addr b   index: sub bitl data_type    name
  [0x0015.0] 0x6000:0x11 0x20 UNSIGNED32   Position
  [0x0019.0] 0x6010:0x01 0x10 UNSIGNED16   Statusword
  [0x001B.0] 0x6010:0x06 0x20 INTEGER32    Following error actual value
  SM4 outputs
     addr b   index: sub bitl data_type    name
  SM5 inputs
     addr b   index: sub bitl data_type    name
  SM6 outputs
     addr b   index: sub bitl data_type    name
  SM7 inputs
     addr b   index: sub bitl data_type    name

The device won't go to operational if the process data in SM6,7 is not configured completely right, this is the output of slaveinfo after my configuration to operational state:

Slave:2
 Name:ELM7231-9016
 Output size: 184bits
 Input size: 232bits
 State: 18
 Delay: 145[ns]
 Has DC: 1
 DCParentport:1
 Activeports:1.1.0.0
 Configured address: 1002
 Man: 00000002 ID: 502275f9 Rev: 00122338
 SM0 A:1000 L: 256 F:00010026 Type:1
 SM1 A:1100 L: 256 F:00010022 Type:2
 SM2 A:1200 L:  13 F:00010024 Type:3
 SM3 A:1600 L:  19 F:00010020 Type:4
 SM4 A:1a00 L:   0 F:00000024 Type:3
 SM5 A:1c00 L:   0 F:00000020 Type:4
 SM6 A:1e00 L:  10 F:00010024 Type:3
 SM7 A:1f00 L:  10 F:00010020 Type:4
 FMMU0 Ls:00000000 Ll:  13 Lsb:0 Leb:7 Ps:1200 Psb:0 Ty:02 Act:01
 FMMU1 Ls:0000000d Ll:  10 Lsb:0 Leb:7 Ps:1a00 Psb:0 Ty:02 Act:01
 FMMU2 Ls:00000026 Ll:  19 Lsb:0 Leb:7 Ps:1600 Psb:0 Ty:01 Act:01
 FMMU3 Ls:00000039 Ll:  10 Lsb:0 Leb:7 Ps:1c00 Psb:0 Ty:01 Act:01
 FMMUfunc 0:1 1:2 2:3 3:1
 MBX length wr: 256 rd: 256 MBX protocols : 0c
 CoE details: 2f FoE details: 01 EoE details: 00 SoE details: 00
 Ebus current: 160[mA]
 only LRD/LWR:0
PDO mapping according to CoE :
  SM2 outputs
     addr b   index: sub bitl data_type    name
  [0x0000.0] 0x7010:0x01 0x10 UNSIGNED16   Controlword
  [0x0002.0] 0x7010:0x05 0x20 UNSIGNED32   Target position
  [0x0006.0] 0x7010:0x06 0x20 INTEGER32    Target velocity
  [0x000A.0] 0x7010:0x09 0x10 INTEGER16    Target torque
  [0x000C.0] 0x7010:0x03 0x08 Type 0x0803  Modes of operation
  SM3 inputs
     addr b   index: sub bitl data_type    name
  [0x0026.0] 0x6000:0x11 0x20 UNSIGNED32   Position
  [0x002A.0] 0x0000:0x00 0x0D
  [0x002B.5] 0x6000:0x0E 0x01 BOOLEAN      TxPDO State
  [0x002B.6] 0x6000:0x0F 0x02 BIT2         Input cycle counter
  [0x002C.0] 0x6010:0x01 0x10 UNSIGNED16   Statusword
  [0x002E.0] 0x6010:0x06 0x20 INTEGER32    Following error actual value
  [0x0032.0] 0x6010:0x07 0x20 INTEGER32    Velocity actual value
  [0x0036.0] 0x6010:0x08 0x10 INTEGER16    Torque actual value
  [0x0038.0] 0x6010:0x03 0x08 Type 0x0802  Modes of operation display
  SM4 outputs
     addr b   index: sub bitl data_type    name
  SM5 inputs
     addr b   index: sub bitl data_type    name
  SM6 outputs
     addr b   index: sub bitl data_type    name
  [0x000D.0] 0x7200:0x01 0x08 UNSIGNED8    FSoE Receive Cmd
  [0x000E.0] 0xF701:0x01 0x01 BOOLEAN      SubIndex 001
  [0x000E.1] 0x0000:0x00 0x07
  [0x000F.0] 0xF701:0x02 0x01 BOOLEAN      SubIndex 002
  [0x000F.1] 0x0000:0x00 0x07
  [0x0010.0] 0x7200:0x03 0x10 UNSIGNED16   FSoE Receive CRC_0
  [0x0012.0] 0x7200:0x02 0x10 UNSIGNED16   FSoE Receive ConnID
  [0x0014.0] 0xF706:0x01 0x01 BOOLEAN      SubIndex 001
  [0x0014.1] 0xF706:0x02 0x01 BOOLEAN      SubIndex 002
  [0x0014.2] 0xF706:0x03 0x01 BOOLEAN      SubIndex 003
  [0x0014.3] 0xF706:0x04 0x01 BOOLEAN      SubIndex 004
  [0x0014.4] 0xF706:0x05 0x01 BOOLEAN      SubIndex 005
  [0x0014.5] 0xF706:0x06 0x01 BOOLEAN      SubIndex 006
  [0x0014.6] 0xF706:0x07 0x01 BOOLEAN      SubIndex 007
  [0x0014.7] 0xF706:0x08 0x01 BOOLEAN      SubIndex 008
  [0x0015.0] 0x0000:0x00 0x10
  SM7 inputs
     addr b   index: sub bitl data_type    name
  [0x0039.0] 0x6200:0x01 0x08 UNSIGNED8    FSoE Send Cmd
  [0x003A.0] 0xF601:0x01 0x01 BOOLEAN      SubIndex 001
  [0x003A.1] 0x0000:0x00 0x07
  [0x003B.0] 0xF601:0x02 0x01 BOOLEAN      SubIndex 002
  [0x003B.1] 0x0000:0x00 0x07
  [0x003C.0] 0x6200:0x03 0x10 UNSIGNED16   FSoE Send CRC_0
  [0x003E.0] 0x6200:0x02 0x10 UNSIGNED16   FSoE Send ConnID
  [0x0040.0] 0xF606:0x01 0x01 BOOLEAN      SubIndex 001
  [0x0040.1] 0xF606:0x02 0x01 BOOLEAN      SubIndex 002
  [0x0040.2] 0xF606:0x03 0x01 BOOLEAN      SubIndex 003
  [0x0040.3] 0xF606:0x04 0x01 BOOLEAN      SubIndex 004
  [0x0040.4] 0xF606:0x05 0x01 BOOLEAN      SubIndex 005
  [0x0040.5] 0xF606:0x06 0x01 BOOLEAN      SubIndex 006
  [0x0040.6] 0xF606:0x07 0x01 BOOLEAN      SubIndex 007
  [0x0040.7] 0xF606:0x08 0x01 BOOLEAN      SubIndex 008
  [0x0041.0] 0xF100:0x01 0x08 UNSIGNED8    Safe Logic State
  [0x0042.0] 0xF100:0x02 0x08 UNSIGNED8    Cycle Counter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants