Canopen对象字典学习

对象字典

The object dictionary shall be structurally divided into three parts:
[MandatoryObjects] shall only contain the mandatory objects. These are at least the objects 1000h and 1001h. For devices, that have implemented version 4.0 of CANopen,
additionally the object 1018h.
[OptionalObjects] shall contain all other objects of the area 1000h-1FFFh and 6000HFFFFh.
[ManufacturerObjects] shall contain all manufacturer specific objects (located in the areaof 2000h-5FFFh).
目标词典在结构上应分为三部分:
•[mandatory objects]只能包含mandatory对象。这些至少是
对象1000h和1001h。对于已经实现CANopen 4.0版本的设备,此外,对象1018h。
•[可选对象]应包含1000h-1FFFh和6000HFFFFh区域的所有其他对象。
•[制造商物品]应包含所有制造商专用物品(位于区域内)
2000 h-5fffh)。

在这里插入图片描述

数据类型

The keyword ObjectType is optional. If the keyword ObjectType is missing, this is regarded as
“ObjectType=0x7” (=VAR).

关键字ObjectType是可选的。如果缺少关键字ObjectType,则将其视为“ObjectType = 0 x7”(= VAR)。

public enum DataType
    {
        UNKNOWN = 0,
        BOOLEAN = 1,
        INTEGER8 = 2,
        INTEGER16 = 3,
        INTEGER32 = 4,
        UNSIGNED8 = 5,
        UNSIGNED16 = 6,
        UNSIGNED32 = 7,
        REAL32 = 8,
        VISIBLE_STRING = 9,
        OCTET_STRING = 0x0A,
        UNICODE_STRING = 0x0B,
        TIME_OF_DAY = 0x0C,
        TIME_DIFFERENCE = 0x0D,
        DOMAIN = 0x0F,
        INTEGER24 = 0x10,
        REAL64 = 0x11,
        INTEGER40 = 0x12,
        INTEGER48 = 0x13,
        INTEGER56 = 0x14,
        INTEGER64 = 0x15,
        UNSIGNED24 = 0x16,
        UNSIGNED40 = 0x18,
        UNSIGNED48 = 0x19,
        UNSIGNED56 = 0x1A,
        UNSIGNED64 = 0x1B,

        PDO_COMMUNICATION_PARAMETER = 0x20,  //PDO_CommPar
        PDO_MAPPING  = 0x21, //PDO_Mapping
        SDO_PARAMETER = 0x22,
        IDENTITY = 0x23,

    }

对象类型

    public enum ObjectType
    {
        UNKNOWN = -1,
        NULL = 0,
        DOMAIN =2,
        DEFTYPE=5,
        DEFSTRUCT=6,
        VAR = 7,
        ARRAY = 8,
        REC = 9,
    }

访问类型

        public enum AccessType
        {
            rw = 0,
            ro = 1,
            wo = 2,
            rwr = 3,
            rww = 4,
            @const = 5,
            UNKNOWN
        }


    public enum AccessSDO
    {
        no,
        ro,
        wo,
        rw
    }

    public enum AccessPDO
    {
        no,
        t,
        r,
        tr
    }

    public enum AccessSRDO
    {
        no = 0,
        tx = 1,
        rx = 2,
        trx = 3
    }

默认值

DefaultValue=0x20192

PDOMapping

shall indicate, if it is possible to map this object into a PDO (Boolean, 0 = not mappable, 1 = mappable).

PDOMapping=0

ObjFlags

默认值0

Comments

Comments may be added to the EDS by using the Comments section. This section shall only
provide entries determining the line number and the line contents.
Lines - number of commentlines (Unsigned16)
Line - one line of comment (max. 249 characters). The number shall be decimal
coded.
Example:
[Comments]
Lines=3
Line1=|-------------|
Line2=| Don’t panic |
Line3=|-------------|

猜你喜欢

转载自blog.csdn.net/wojiuguowei/article/details/120435934