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

Request Data Type Additions #320

Closed
HuckleberryYogi opened this issue May 26, 2022 · 1 comment · Fixed by #440
Closed

Request Data Type Additions #320

HuckleberryYogi opened this issue May 26, 2022 · 1 comment · Fixed by #440

Comments

@HuckleberryYogi
Copy link

Requesting support for more Object Dictionary Data Type Support.
Specific interest in "UNSIGNED24".
Data Types are described in CAN-in-Automation Design Specification 301, section 7.4.7.1 (Table 44) (page 85, see attached image)

I believe this would require add to this list found in https://github.com/christiansandberg/canopen/blob/c7ad0a822a20a765f0fc7c43be0f4450b7a536ef/canopen/objectdictionary/__init__.py

`class Variable(object):
"""Simple variable."""

STRUCT_TYPES = {
    BOOLEAN: struct.Struct("?"),
    INTEGER8: struct.Struct("b"),
    INTEGER16: struct.Struct("<h"),
    INTEGER32: struct.Struct("<l"),
    INTEGER64: struct.Struct("<q"),
    UNSIGNED8: struct.Struct("B"),
    UNSIGNED16: struct.Struct("<H"),
    UNSIGNED32: struct.Struct("<L"),
    UNSIGNED64: struct.Struct("<Q"),
    REAL32: struct.Struct("<f"),
    REAL64: struct.Struct("<d")
}`

Full Copy of Table 44 from CiA Documentation:
Index Object Name
0001h DEFTYPE BOOLEAN
0002h DEFTYPE INTEGER8
0003h DEFTYPE INTEGER16
0004h DEFTYPE INTEGER32
0005h DEFTYPE UNSIGNED8
0006h DEFTYPE UNSIGNED16
0007h DEFTYPE UNSIGNED32
0008h DEFTYPE REAL32
0009h DEFTYPE VISIBLE_STRING
000Ah DEFTYPE OCTET_STRING
000Bh DEFTYPE UNICODE_STRING
000Ch DEFTYPE TIME_OF_DAY
000Dh DEFTYPE TIME_DIFFERENCE
000Eh reserved
000Fh DEFTYPE DOMAIN
0010h DEFTYPE INTEGER24
0011h DEFTYPE REAL64
0012h DEFTYPE INTEGER40
0013h DEFTYPE INTEGER48
0014h DEFTYPE INTEGER56
0015h DEFTYPE INTEGER64
0016h DEFTYPE UNSIGNED24
0017h reserved
0018h DEFTYPE UNSIGNED40
0019h DEFTYPE UNSIGNED48
001Ah DEFTYPE UNSIGNED56
001Bh DEFTYPE UNSIGNED64
001Ch – 001Fh reserved
0020h DEFSTRUCT PDO_COMMUNICATION_PARAMETER
0021h DEFSTRUCT PDO_MAPPING
0022h DEFSTRUCT SDO_PARAMETER
0023h DEFSTRUCT IDENTITY
0024h – 003Fh reserved
0040h – 005Fh DEFSTRUCT Manufacturer-specific Complex Data types
0060h – 007Fh DEFTYPE Device profile specific Standard Data types 1st logical device
0080h – 009Fh DEFSTRUCT Device profile specific Complex Data types 1st logical device
00A0h – 00BFh DEFTYPE Device profile specific Standard Data types 2nd logical device
00C0h – 00DFh DEFSTRUCT Device profile specific Complex Data types 2nd logical device
00E0h – 00FFh DEFTYPE Device profile specific Standard Data types 3rd logical device
0100h – 011Fh DEFSTRUCT Device profile specific Complex Data types 3rd logical device
0120h – 013Fh DEFTYPE Device profile specific Standard Data types 4th logical device
0140h – 015Fh DEFSTRUCT Device profile specific Complex Data types 4th logical device
0160h – 017Fh DEFTYPE Device profile specific Standard Data types 5th logical device
0180h – 019Fh DEFSTRUCT Device profile specific Complex Data types 5th logical device
01A0h – 01BFh DEFTYPE Device profile specific Standard Data types 6th logical device
01C0h – 01DFh DEFSTRUCT Device profile specific Complex Data types 6th logical device
01E0h – 01FFh DEFTYPE Device profile specific Standard Data types 7th logical device
0200h – 021Fh DEFSTRUCT Device profile specific Complex Data types 7th logical device
0220h – 023Fh DEFTYPE Device profile specific Standard Data types 8th logical device
0240h – 025Fh DEFSTRUCT Device profile specific Complex Data types 8th logical device

@sveinse
Copy link
Collaborator

sveinse commented May 19, 2024

canopen supports UNSIGNED24. With PR #440 canopen will get support for the remaining data types.

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

Successfully merging a pull request may close this issue.

2 participants