DataTypesSimulink.asn 3.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
MY-MODULE DEFINITIONS AUTOMATIC TAGS ::= BEGIN

-- Original definition by Alain
--T-POS ::= BOOLEAN

MyInt ::= INTEGER (0 .. 20)

My2ndInt ::= MyInt ( 1 .. 18)

AType ::= SEQUENCE {
    blArray	SEQUENCE (SIZE(10)) OF BOOLEAN
}

My2ndAType ::= AType

TypeEnumerated ::= ENUMERATED {
    red(0),
    green(1),
    blue(2)
}

My2ndEnumerated ::= TypeEnumerated

TypeNested ::= SEQUENCE {
    intVal	INTEGER(0..10),
    int2Val	INTEGER(-10..10),
    int3Val	MyInt (10..12),
    intArray	SEQUENCE (SIZE (10)) OF INTEGER (0..3),
    realArray	SEQUENCE (SIZE (10)) OF REAL (0.1 .. 3.14),
    octStrArray	SEQUENCE (SIZE (10)) OF OCTET STRING (SIZE(1..10)),
    boolArray	SEQUENCE (SIZE (10)) OF T-BOOL,
    enumArray	SEQUENCE (SIZE (10)) OF TypeEnumerated,
    enumValue	TypeEnumerated,
    enumValue2	ENUMERATED {
	truism(0),
	falsism(1)
    },
    label	OCTET STRING (SIZE(10..40)),
    bAlpha	T-BOOL,
    bBeta	BOOLEAN,
    sString	T-STRING,
    arr		T-ARR,
    arr2	T-ARR2
}

My2ndTypeNested ::= TypeNested

-- A more realistic definition
T-POS ::= CHOICE {
    longitude	REAL(-180.0..180.0),
    latitude	REAL(-90.0..90.0),
    height	REAL(30000.0..45000.0),
    subTypeArray SEQUENCE (SIZE(10..15)) OF TypeNested,
    label	OCTET STRING (SIZE(50)),
    intArray	T-ARR,
    myIntSet	T-SET,
    myIntSetOf	T-SETOF,
    anInt	My2ndInt
}

T-POS-SET ::= SET {
    longitude	REAL(-180.0..180.0),
    latitude	REAL(-90.0..90.0),
    height	REAL(30000.0..45000.0),
    subTypeArray SEQUENCE (SIZE(10..15)) OF TypeNested,
    label	OCTET STRING (SIZE(20..50)),
    intArray	T-ARR,
    myIntSet	T-SET,
    myIntSetOf	T-SETOF

}

T-ARR ::= SEQUENCE (SIZE (5..6)) OF INTEGER (0..32764)

My2ndArr ::= T-ARR

T-ARR2 ::= SEQUENCE (SIZE (5..6)) OF REAL (0.1 .. 4.2)

T-ARR3 ::= SEQUENCE (SIZE (5..6)) OF SEQUENCE (SIZE(7)) OF REAL (0.1 .. 4.2)

T-ARR4 ::= SEQUENCE (SIZE (5..6)) OF SEQUENCE (SIZE(7)) OF REAL (0.1 .. 4.3)

T-SET ::= SET {
    data1   INTEGER(0..131071),
    data2   REAL(-100.0 .. 10.0),
    data3   INTEGER(-1024..1024),
    data4   INTEGER(-1310720..131071)
}

T-SETOF ::= SET (SIZE (5..6)) OF INTEGER (0..4)

T-BOOL ::= BOOLEAN

My2ndBool ::= T-BOOL

T-INT ::= INTEGER (0..50)
T-REAL ::= REAL (-3.14..3.14)
My2ndReal ::= T-REAL
T-STRING ::= OCTET STRING (SIZE(10..15))
My2ndString ::= T-STRING
T-FIXEDSTRING ::= OCTET STRING (SIZE(15))

T-META ::= T-POS

myVar MyInt ::= 4

ConfigString ::= IA5String (SIZE(1..20))
myStrVar ConfigString ::= "This is a test"

110 111 112 113
FixedLenConfigString ::= IA5String (SIZE (5))
myStrFixed FixedLenConfigString ::= "Hello"

T-TypeThatMustNotBeMappedExceptInPython ::= SEQUENCE {
114
    config  ConfigString,
115 116
    param   INTEGER (0..10),
   fixstr  FixedLenConfigString DEFAULT "Hello"
117
}
118 119 120 121
E ::= INTEGER (0..255|1299)(5)
TypeWithOptional ::= SEQUENCE {
   a BOOLEAN OPTIONAL,
   b INTEGER (0..255|1299),
122 123
   c INTEGER (0..255),
   d T-TypeThatMustNotBeMappedExceptInPython DEFAULT {config "Config", param 5, fixstr "World"}
124 125
}

126 127
push-it T-TypeThatMustNotBeMappedExceptInPython ::= {config "Config", param 5, fixstr "World"}

128 129 130 131 132 133 134 135 136 137 138
SubTypeWithOptional ::= TypeWithOptional (WITH COMPONENTS {a ABSENT, c (42), b (1299)})

SuperChoice ::= CHOICE {
   first-choice BOOLEAN,
   second-choice INTEGER (0..255),
   third-choice TypeWithOptional
}

-- Choice items can be removed in subtypes
SuperRestrictedChoice ::= SuperChoice (WITH COMPONENTS {second-choice ABSENT})

139 140

END