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

master.config_map() - Dynamic PDO Mappings; some can be configured, some cannot #159

Open
hatilima opened this issue Sep 26, 2024 · 0 comments

Comments

@hatilima
Copy link

hatilima commented Sep 26, 2024

For our device, the default (ESI-defined) PDO mappings are done as follows:
Sync Manager 2 (SM2) is 0x1C12 and is for output PDO mappings that are detailed as follows:
0x1600 contains a mapping for default Output PDOs (5 PDOs, total of 6 bytes)
0x1601 contains a mapping for USER DEFINED Output PDOs (19 PDOs, total of 48 bytes)
Total Output SM2 bytes = 54 bytes

Sync Manager 3 (SM3) is 0x1C13 and is for input PDO mappings that are detailed as follows:
0x1A00 contains a mapping for default Input PDOs (13 PDOs, total of 18 bytes)
0x1A01 contains a mapping for USER DEFINED Input PDOs (35 PDOs, total of 82 bytes)
Total Input SM3 bytes = 100 bytes

ISSUE:
We use pysoem to configure the USER DEFINED PDOs (input and output) by first creating a tuple of the PDOs that we want to include in each mapping (input or output) and then we write the mapping by using:

slave.sdo_write(index, subindex, struct-packed-data, complete_access=TRUE)

where index is either 0x1C12 or 0x1C13 or 0x1601 or 0x1A01 and subindex is 0 for all of them.
The data that is sent is of the format (number of objects in mapping, object1_byte_size, object1_subindex, object1_index_little_endian, ..., objectZ__byte_size, objectZ_subindex,...)
After slave.sdo_write(index, subindex, struct-packed-data_of_pdo_mapping, complete_access=TRUE), we then run:

master.config_map()

And we check if the PDOs mappings have been written and if the Sync Manager size has been updated. STRANGELY, this works for all dynamic PDOs EXCEPT 0x1A01.
So 0x1C12 and 0x1C13 and 0x1601 all work just fine, we check the slave device and we see the new mapping of the dynamic PDOs. But 0x1A01 fails with an error that that Sync Manager (SM3) byte size has not been written and therefore the byte size of the written data is different from the Sync Manager byte size (which is stubbornly the original from the ESI during initial configuration = 100 bytes ... check numbers in my intro).

Is there anyone who has encountered a similar problem? Is there anyone who may have a solution to this?

Does anyone do dynamic PDO mapping using pysoem and it works just fine?

Is it sufficient to just do:

slave.sdo_write(index, subindex, struct-packed-data_of_pdo_mapping, complete_access=TRUE)
master.config_map()

for dynamic pdo mappings in 0x1601, 0x1A01, 0x1C12 and 0x1C13??

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

1 participant