Bacnet协议报文格式详解(三)

十二、差错报文的表述

1. BACnetAbortReason

BACnetAbortReason :: = ENUMERATED {

                             Other                                                   (0) ,

                              buffer-overflow                                   (1) ,

                              invalid-apdu-in-this-state                    (2) ,

                             preempted-by-higher-Priority-task       (3) ,

                              segmentation-not-supported              (4) ,

                                …….

}

--枚举值 0-63 保留为 ASHRAE 用作定义中。

2. BACnet-Error

BACnet-Error :: = CHOICE {

 other                                                      [127] Error,

-- 本表述其余的选择表示对有证实服务所定义的‘Result(-) ’ 参数。

-- Alarm and Event Services

                           acknowledgeAlarm                                 [0] Error,

                           confirmedCOVNotification                       [1] Error,

                           confirmedEventNotification                       [2] Error,

                            getAlarmSummary                                    [3] Error,

                            getEnrollmentSummary                            [4] Error,

                             subscribeCOV                                         [5]Error,

-- File Access Services

                             atomicReadFile                                       [6]Error,

                             atomicWriteFile                                         [7] Error,

-- Object Access Services

                              addListElement                                       [8] ChangeList-Error,

                               removeListElement                                [9] ChangeList-Error,

                               createObject                                            [l0] CreateObject-Error,

                               deleteObject                                           [11] Error,

                               readProPerty                                          [l2] Error,

                               readPropertyConditional                         [l3] Error,

                                readPropertyMultiple                              [l4] Error,

                                writeProperty                                          [15] Error,

                                writeProPertyMultiPle                             [16] WritePropertyMultiPle-Error,

-- Remote Device Management Services

                                 deviceCornmunicationControl               [l7] Error,

                                  confirmedPrivateTransfer                     [18]ConfirmedPrivateTransfer- Error,

                                  confirmedTextMessage                        [19] Error,

                                  reinitializeDevice                                   [20] Error,

-- Virtual Terminal Services

                                  vtOPen                                                  [21] Error,

                                   vtClose                                                  [22] VTClose-Error,

                                   vtData                                                    [23] Error,

-- Security Services

                                   authenicate                                             [24] Error,

                                   requestKey                                              [25] Error

}

-- 在编码中没有使用上下文特定标记 0. . 25 和 127。 标记编号在 BACnet 差错 PDU 中作为差错选择参数传送。

--新定义的服务可以增加到上述的枚举类型中。 本表述中的所有枚举值都保留为 ASHRAE 用作定义中。

3. BACnetRejectReason

BACnetRejectReason : : = ENUMERATED {

                                    other                                                       (0) ,

                                    buffer-overflow                                        (1) ,

                                    inconsistent-Parameters                         (2) ,

                                    invalid-Parameter-datatype                     (3) ,

                                    invalid-tag                                                (4) ,

                                    missing-required-parameter                      (5) ,

                                     parameter-out-of range                            (6) ,

                                     too-man-arguments                                  (7) ,

                                       undefined-enumeration                           (8) ,

                                     unrecognized-service                                (9) ,

}

--枚举值 0-63 保留为 ASHRAE 用作定义中。枚举值 64-65535 可以被其它机构根据 23 节中的规定使用。

4. ChangeLiSt-Error

ChangeLiSt-Error : : = SEQUENCE {

                                         errorType                                                [0] Error,

                                         firstFailedElementNumber                      [1] Unsigned

}

5. CreateObect-Error

CreateObect-Error :: = SEQUENCE {

                                          errorType                                               [0] Error,

                                          firstFailedElementNumber                      [1] Unsigned

}

6. ConfirmedPrivateTransfor-Error

ConfirmedPrivateTransfor-Error :: =SEQUENCE{

                                            errorType                                             [0] Error,

                                            vendorID                                              [1] Unsigned,

                                           serviceNumber                                      [2] Unsigned,

                                             errorParameters                                      [3] ABSTRACT-SYNTAX. &Type OPTIONAL

}

7. Error

Error : : = SEQUENCE {

                                     error-class  ENUMERATED {

                                                                    device      (0) ,

                                                                     object      (1) ,

                                                                     property   (2) ,

                                                                    resources  (3) ,

                                                                    security     (4) ,

                                                                    services    (5) ,

                                                                     vt             (6) ,

                                                                    …

                                       } ,

                                        --枚举值 0-63 保留为 ASHRAE 用作定义中。

                                       error-code ENUMERATED {

                                                                    other          (0) ,

                                                                    authentication-failed     (1) ,

                                                                    character-set-not-supported   (41) ,

                                                                    configuration-in-progress    (2) ,

                                                                    device-busy         (3) ,

                                                                    dynamic-creation-not-supported (4) ,

                                                                    file-access-denied      (5) ,

                                                                    incompatible-security-levels   (6) ,

                                                                    inconsistent-parameters     (7) ,

                                                                    inconsistent-selection-criterion (8) ,

                                                                    Invalid-array-index    (42) ,

                                                                    Invalid-data-type      (9) ,

                                                                    invalid-file-access-method    (10) ,

                                                                    invalid-file-start-position   (11) ,

                                                                    operator-name (12) ,

                                                                    invalid-parameter-data-type     (13) ,

                                                                    invalid-time-stamp      (14) ,

                                                                    key-generation-error     (15) ,

                                                                    missing-required-parameter   (16) ,

                                                                    no-objects-of-specified-type   (17) ,

                                                                    no-space-for-object       (18) ,

                                                                    no-space-to-add-list-element   (19) ,

                                                                    no-space-to-write-property    (20) ,

                                                                    no-vt-sessions-available    (21) ,

                                                                    object-deletion-not-permitted   (23) ,

                                                                    object-identifier-already-exists (24) ,

                                                                    operational-problem    (25) ,

                                                                    password-failure       (26) ,

                                                                    property-is-not-a-list (22) ,

                                                                    read-access-denied    (27) ,

                                                                    security-not-supported (28) ,

                                                                    service-request-denied    (29) ,

                                                                    timeout    (30) ,

                                                                    unknown-object (31) ,

                                                                    unknown-property       (32) ,

                                                                    this enumeration was removed   (33) ,

                                                                    unknown-vt-class       (34) ,

                                                                    unknown-vt-session    (35) ,

                                                                    unsupported-object-type      (36) ,

                                                                    value-out-of range      (37) ,

                                                                    vt-session-already-closed   (38) ,

                                                                    vt-session-termination-failure   (39) ,

                                                                    write-access-denied (40) ,

                                                                    …

                                  }

                                   --枚举值 0-255 保留为 ASHRAE 用作定义中。 本版本使用的最后一个枚举值是 42。

}

8. WritePropertyMultiple-Error

WritePropertyMultiple-Error : : = SEQUENCE {

                                  errorType                            [0] Error,

                                  firstFailedWriteAttempt      [1] BACnet Object Property Reference

}

9. VTClose-Error

VTClose-Error :: = SEQUENCE {

                                  errorType                            [0] Error,

                                  listOfVTSessionIdentifiers   [1] SEQUENCE OF Unsigned8 OPTIONAL

}

十三、应用类型

编码的 BACnet 应用标记的标记编号域表示应用数据类型, 参数分配如下:

标记编号:

0 = Null

1 = Boolean

2 = Unsigned Integer

3 = Signed Integer (2’ complement notation)

4 = Real (ANSI/IEEE-754 floating point)

5 = Double (ANSI/IEEE-754 double precision floating point)

6 = Octet String

7 = Character String

8 = Bit String

9 = Enumerated

10 = Data

11 = Time

12 = BACnetObjectIdentifier

13, 14, 15 = Reserved for ASHRAE

 

-- 下面的表述是关于应用数据类型的定义。

NULL                          [APPLICATION 0], equivalent to [UNIVERSAL 5]

BOOLEAN                  [APPLICATION 1], equivalent to [UNIVERSAL 1]

Unsigned                    : : = [APPLICATION 21 INTEGER (0. . MAX)

UnSigned8                  : : = Unsigned (0. . 255)

UnSigned16                 :: = Unsigned (0. . 65535)

Unsigned32                 : : = Unsigned (0. . 4294967295)

INTEGER                    [APPLICATION 3], equivalent to [UNIVERSAL 2]

REAL                          [APPLICATION 4] , equivalent to [UNIVERSAL9] ANSI/IEEE-754

single precision floating point

Double                          : : = [APPLICATION 51 OCTET STRING (SIZE(8) ) -- ANSI/IEEE-754

double                          precision floating point

OCTET STRING           [APPLICATION 6], equivalent to [UNIVERSAL 4]

CharacterString            : : = [APPLICATION 71 OCTET STRING

BIT STRING                 [APPLICATION 8], equivalent to [UNIVERSAL 3]

ENUMERATED             [APPLICATION 9], equivalent to [UNIVERSAL 10]

Date                              : : = [APPLICATION 10] OCTET STRING (SIZE(4) )

                                        -- first octet   year minus 1900    X ‘ FF' =unspecified

                                       - - second octet month (1. . 12)     l = January

                                                    X‘FF' = unspecified

                                      -- third octet  day of month (l. . 31) , X‘FF' = unspecified

                                      -- fourth octet day of week (1. . 7)  1 = Monday

                                      --            7 = Sunday

                                       --            X‘FF' = unspecified

Time                            : : = [APPLICATION 1l] OCTET STRING (SIZE(4) )

                                     -- first octet   hour    (0. . 23) , (X ‘ FF' ) =Unspecified

                                     -- second octet minute    (0. . 59) , (X ‘ FF' ) =Unspecified

                                   -- third octet  second    (0. . 59) , (X ‘ FF' ) =unspeCified

                                   -- fourth octet hunredths   (0. . 99) , (X ‘ FF' ) =Unspecified

BACnetObjectIdentifier   : : = [APPLICATION 12] OCTET STRING (SIZE(4) )

十四、基本类型

BACnetAction : : = ENUMERATED {

direct        (0) ,

reverse     (l)

}

 

BACnetActionCommand :: = SEQUENCE {

deviceIdentifier [0] BACnetObjectIdentifier OPTIONAL,

objectIdentifier [1] BACnetObjectIdenifier,

propertyIdenifier [2] BACnetPropertyIdentifier,

propertyArrayIndex [3] Unsigned OPTIONAL, --只与数组数据类型一起使用

propertyValue [4] ABSTRACT-SYNTAX. &Type,

priority   [5] Unsigned (l. . l6) OPTIONAL, --只与命令属性一起使用

postDelay [6] Unsigned OPTIONAL,

quitOnFailure [7] BOOLEAN,

writeSuccessful   [8] BOOLEAN

}

 

BACnetActionList : : = SEQUENCE{

action [0] SEQUENCE OF BACnetActionCommand

}

 

BACnetAddress : : = SEQUENCE {

network-number Unsigned16,

mac-address   OCTET STRING --长度为 0 的字节串表示广播

}

 

BACnetAddressBinding : : = SEQUENCE {

deviceObjectIdentifier BACnetObjectIdentifier,

deviceAddress   BACnetAddress

}

 

BACnetBinaryPV : : = ENUMERATED {

inactive (0) ,

active (l)

}

 

BACnetCalendarEntry :: = CHOICE {

date [0] Date,

dateRange [l] BACnetDateRange,

weekNDay [2] BACnetWeekNDay

}

 

BACnetDailySchedule :: = SEQUENCE {

day-schedule [0] SEQUENCE OF BACnetTimeValue

}

 

BACnetDateRange : : = SEQUENCE {

startDate Date,

endDate   Date

}

 

BACnetDateTime : : = SEQUENCE {

date Date,

time Time

}

 

BACnetDaysOfWeek : : = BIT STRING {

monday (0) ,

tuesday   (1) ,

wednesday (2) ,

thursday (3) ,

friday (4) ,

saturday (5) ,

sundav (6)

}

 

BACnetDestination :: = SEQUENCE {

validDays    BACnetDaysOfWeek,

fromTime    Time,

toTime    Time,

recipient    BACnetRecipient,

processIdentifier    Unsigned,

issueConfirmedNotifications BOOLEAN,

transitions     BACnetEventTransitionBits

}

 

BACnetDeviceStatus : : = ENUMERATED {

Operational (0) ,

operational-read-only (1) ,

download-required (2) ,

download-in-progress (3) ,

non-operational   (4) ,

}

 

BACnetEngineeringUnits : : = ENUMERATED {

--Area

square-meters   (0) ,

square-feet (1) ,

--currency

currencyl (105) ,

currency2    (106) ,

currency3    (l07) ,

currency4    (l08) ,

currency5    (109) ,

currency6    (l10) ,

currency7 (1ll) ,

currency8    (ll2) ,

currency9 (ll3) ,

currency10    (ll4) ,

--Electrical

milliamperes    (2) ,

amperes     (3) ,

ohms    (4) ,

kilohms     (l22) ,

megohms (123) ,

vo1ts    (5) ,

millivolts      (l24) ,

kilovolts      (6) ,

megavolts      (7) ,

volt-amperes      (8) ,

kilovolt-amperes (9) ,

megavolt-amperes (l0) ,

volt-amperes-reactive    (1l) ,

kilovolt-amperes-reactive (l2) ,

megavolt-amperes-reactive   (l3) ,

degrees-phase   (l4) ,

power-factor      (l5) ,

--Energy

joules      (16) ,

kilojoules      (17) ,

kilojoules-per-kilogram     (l25) ,

megajoules      (l26) ,

watt-hours    (l8) ,

kilowatt-hours   (19) ,

btus (20) ,

therms (21) ,

ton-hours      (22) ,

--Enthalpy

joules-per-kilogram-dry-air   (23) ,

btus-per-pound-dry-air    (24) ,

--Entropy

joules-per-degree-Kelvin   (127) ,

joules-per-kilogram-degree-Kelvin (128) ,

--Frequency

cycles-per-hour     (25 ) ,

cycles-per-minute (26) ,

hertz     (27) ,

kilohertz     (129) ,

megahertz      (130) ,

per-hour (131) ,

--Humidity

grams-of-water-per-kilogram-dry-air (28) , .

percent-relative-humidity    (29) ,

--Length

millimeters (30) ,

meters      (31) ,

inches    (32) ,

feet      (33) ,

--Light

watts-per-square-foot    (34) ,

Watts-per-square-meter   (35) ,

lumens      (36) ,

luxes      (37) ,

foot-candles      (38) ,

--Mass

kilograms   (39) ,

pounds-mass      (40) ,

tons   (41) ,

--Mass Flow

kilograms-per-second    (42) ,

kilograms -per-minute (43) ,

kilograms-per-hour     (44) ,

pounds-mass-per-minute    (45 ) ,

pounds – mass-per-hour     (46) ,

--Power

milliwatts (132) ,

watts      (47) ,

kilowatts      (48) ,

megawatts (49) ,

btus-per-hour      (50) ,

horsepower      (51) ,

tons-refrigeration     (52) ,

--Pressure

pascals       (53) ,

hectopascals (l33) ,

kilopascals     (54) ,

millibars     (134) ,

bars      (55) ,

pounds-force-per-square-inch (56) ,

centimeters-of-water    (57) ,

inches-of water     (58) ,

millimeters-of-mercury    (59) ,

centimeters-of-mercury    (60) ,

inches-of mercury (6l) ,

--Temperature

degrees-Celsius    (62) ,

degrees-Kelvin (63) ,

degrees-Fahrenheit    (64) ,

degree-days-Celsius     (65) ,

degree-days-Fahrenheit    (66) ,

--Time

years     (67) ,

months      (68) ,

weeks (69) ,

days      (70) ,

hours      (7l) ,

minutes       (72) ,

seconds       (73) ,

--Velocity

meters-per-second     (74) ,

kilometers-per-hour     (75) ,

feet-per-second      (76) ,

feet-per-minute      (77) ,

miles-per-hour     (78) ,

--volume

cubic-feet      (79) ,

cubic-meters      (80) ,

imperial-gallons     (8l) ,

liters      (82) ,

us-gallons      (83) ,

--Volumetric Flow

cubic-feet-per-minute    (84) ,

cubic-meters-per-second    (85) ,

cubic-meters-per-hour    (135) ,

imperial-gallons-per-minute    (86) ,

liters-per-second     (87) ,

liters-per-minute     (88) ,

liters-per-hour      (l36) ,

us-gallons-per-minute    (89) ,

--Other

degrees-angular      (90) ,

degrees-Celsius-per-hour   (91) ,

degrees-Celsius-per-minute   (92) ,

degrees-Fahrenheit-per-hour    (93) ,

degrees-Fahrenheit-per-minute (94) ,

kilowatt-hours-per-square-meter   (137) ,

kilowatt-hours-per-square-foot (l38) ,

megajoules-per-square-meter   (l39) ,

megajoules-per-square-foot   (l40) ,

no-units      (95) ,

parts-per-million     (96) ,

parts-per-billion     (97) ,

percent        (98) ,

percent-per-second    (99) ,

per-minute      (l00) ,

per-second      (10l) ,

psi-per-degree-Fahrenheit   (l02) ,

radians (l03) ,

revolutions-per-minute    (l04) ,

watts-per-square-meter-degree-kelvin (14l) ,

}

--枚举值 0-255 保留为 ASHRAE 用作定义中。本版本使用的最后一个枚举值是 141, 枚举值 115-121 已经被删除。

 

BACnetEventParameter : : = CHOICE {

-- 这些选择与事件类型枚举值一一对应。

change-of-bitstring        [0] SEQUENCE {

                                       time-delay                          [0] Unsigned,

                                       bitmask                               [1] BIT STRING,

                                       list-of-bitstring-values          [2] SEQUENCE OF BIT STRING

} ,

change-of state            [1] SEQUENCE {

                                      time-delay                           [0] Unsigned,

                                       list-of-values                       [1] SEQUENCE OF BACnetPropertyStates

} ,

change-of-value             [2] SEQUENCE {

                                      time-delay                          [0] Unsigned,

                                      cov-criteria                         [1] CHOICE {

                                                                                    bitmask                                                   [0] BIT STRING,

                                                                                    referencd-property-increment                  [1] REAL

                                       }

} ,

command-failure               [3] SEQUENCE {

                                          time-delay                                    [0] Unsigned,

                                           feedback-property-reference       [l]BACnetObjectPropertyReference

} ,

floating-limit                      [4] SEQUENCE {

                                           time-del4y                                  [0] Unsigned,

                                            setpoint-reference                     [l]BACnetObjectPropertyReference,

                                              low-diff-limit                             [2] REAL,

                                             high-diff-limit                             [3] REAL,

                                            deadband                                    [4] REAL

} ,

out-of-range                        [5] SEQUENCE {

                                             time-delay                                [0] Unsigned,

                                             low-limit                                    [l] REAL,

                                             high-limit                                   [2] REAL,

                                            deadband                                  [3] REAL

}

}

 

BACnetEventState : : = ENUMERATED {

normal (0) ,

fault   (l) ,

offnormal (2) ,

high-limit (3) ,

low-limit (4) ,

}

--枚举值 0-63 保留为 ASHRAE 用作定义中。

 

BACnetEventTransitionBits : : == BIT STRING {

to-offnormal (0) ,

o-fault (1) ,

to-normal (2)

}

 

BACnetEventType : : = ENUMERATED {

change-of-bitstring   (0) ,

change-of-state (l) ,

change-of-value   (2) ,

command-failure   (3) ,

floating-limit (4) ,

out-of range (5) ,

}

 

BACnetFileAccessMethod : : = ENUMERATED {

record-access   (0) ,

stream-access   (1) ,

record-and-stream-access (2)

}

 

BACnetLimitEnable :: = BIT STRING {

lowLimitEnable   (0) ,

highLimitAnatile   (l)

}

 

BACnetNotificationParamsters : : = CHOICE {

-- 这些选择与事件类型枚举值一一对应。

change-of-bitstring            [0] SEQUENCE {

                                              referened-bitstring       [0] BIT STRING,

                                              status-flags                  [1] BACnetStatusFlags

} ,

change-of-state                  [1] SEQUENCE {

                                            new-state                       [0] BACneProPertyStates,

                                            status-flags                    [1] BACnetStatusFlags

} ,

change-of-value                  [2] SEQUENCE {

                                             new-value                     [0] CHOICE {

                                                                           changed-bits                  [0] BIT STRING,

                                                                            changed-value                [1] REAL

                                              } ,

                                             status-flags                  [1] BACnetStatusFlags

} ,

command-failure                 [3] SEQUENCE {

                                                command-value         [0] ABSTRACT-SYNTAX. &Type,  -- 与引用属性有关

                                                 status-flags               [1] BACnetStatusFlags,

                                                 feedback-value          [2] ABSTRACT-SYNTAX. &Type -- 与引用属性有关

} ,

floating-limit                            [4] SEQUENCE {

                                                  reference-value       [0] REAL,

                                                  status-flags              [l] BACnetStatusFlags,

                                                   setpoint-value         [2] REAL,

                                                    error-limit                [3] REAL

} ,

out-of-range                            [5] SEQUENCE {

                                                  exceeding-value        [0] REAL,

                                                  status-flags               [1] BACnetStatusFlags,

                                                    deadband                [2] REAL,

                                                   exceeded-limit         [3] REAL

} ,

complex-event-type                [6] SEQUENCE OF BACnetPropertyValue

}

 

BACnetNotifyType : : = ENUMERATED {

alarm (0) ,

event (1) ,

ack-notification (2)

}

 

BACnetObjectPropertyReference :: = SEQUENCE {

objectIdentifier [0] BACnetObjectIdentifier,

propertyIdentifier [1]BACnetPropertyIdentifier,

propertyArrayIndex [2] Unsigned OPTIONAL--只与数组数据类型一起使用

--如果数组中省略这个参数, 表示引用整个数组

}

 

BACnetObjectPrOpertyValue : : = SEQUENCE {

objectIdentifier [0] BACnetObjectIdenifier,

propertyIdenifier [l] BACnetPropertyIdentifier,

propertyArrayIndex [2] Unsigned OPTIONAL, --只与数组数据类型一起使用

--如果数组中省略这个参数, 表示引用整个数组

value [3] ABSTRACT-SYNTAX. &Type,

--任何适合指定属性的数据类型

priority [4] Unsigned (l. . l6) OPTIONAL

}

 

BACnetObjectIdentifier的编码分为两个部分:

Object type

Instance  Number

占用了10Bits

占用了22Bits

 

BACnetObjectType : : = ENUMERATED {

analog-input (0) ,

analog-output (l) ,

analog-value (2) ,

binary-input   (3) ,

binary-output   (4) ,

binary-value (5) ,

calendar (6) ,

command   (7) ,

device (8) ,

event-enrollment (9) ,

file (10) ,

group (l1) ,

loop (12) ,

multistate-input (l3) ,

multistate-output (l4) ,

notification-class (l5) ,

program (16) ,

schedule (17) ,

}

 

BACnetObjectTypesSupported : : = BIT STRING {

analog-input (0) ,

analog-output (1) ,

analog-value (2) ,

binary-input (3) ,

binary-output (4) ,

binary-value (5) ,

calendar (6) ,

command (7) ,

device (8) ,

event-enrollment (9) ,

file (10) ,

group (11) ,

loop (12) ,

multistate-input (13) ,

multistate-output (14) ,

notification-class (15) ,

program (16) ,

schedule (l7)

}

 

BACnetPolarity : : = ENUMERATED {

normal   (0) ,

reverse (l)

}

 

BACnetProrityArray : : = SEQUENCE SIZE (1. . l6) OF BACnetPriorityValue

-- 作为一个 BACnet 数组被访问

 

BACnetPriorityValue :: = CHOICE {

null NULL,

real REAL,

binary BACnetBinaryPV,

integer Unsigned,

constructedValue      [0] ABSTRACT-SYNTAX. &Type

}

 

BACnetProgramError : : = ENUMERATED {

normal (0) ,

load-failed (1) ,

internal (2) ,

program (3) ,

other (4) ,

}

BACnetProgramRequest : : = ENUMERATED {

ready (0) ,

load (1) ,

run (2) ,

halt   (3) ,

restart (4) ,

unload (5)

}

 

BACnetProgramState : : = ENUMERATED {

idle (0) ,

loading (l) ,

running (2) ,

waiting (3) ,

halted (4) ,

unloading (5)

}

 

BACnetPropertyIdentifier :: = ENUMERATED {

acked-transitions (0) ,

ack-required (1) ,

action (2) ,

action-text (3) ,

active-text (4) ,

active-vt-sessions (5) ,

alarm-value (6) ,

alarm-values (7) ,

all (8) ,

all-writes-successful (9) ,

apdu-segment-timeout (10) ,

apdu-timeout (1l) ,

application-software-version (l2) ,

archive (l3) ,

bias (l4) ,

change-of-state-count (l5) ,

change-of-state-time (16) ,

-- see notification-class (17) ,

-- the property in this place was deleted (18) ,

controlled-variable-reference (19) ,

controlled-variable-units (20) ,

controlled-variable-value (21) ,

cov -increment (22) ,

datelist (23 ) ,

daylight-savings- status (24) ,

deadband (25) ,

derivative-constant (26) ,

derivative-constant-units (27) ,

description (28) ,

description-of-halt (29) ,

device-address-binding (30) ,

device-type (31) ,

effective-period (32) ,

elapsed-active-time (33) ,

error-limit (34) ,

event-enable (35) ,

event-state (36) ,

event-type (37) ,

event-parameters (83) , -- 从以前的版本重命名而来

exception-schedule (38) ,

fault-values (39) ,

feedback-value (40) ,

file-access-method (41) ,

file-size (42) ,

file-type (43 ) ,

firmware-revision (44) ,

high-limit (45) ,

inactive-text (46) ,

in-process (47) ,

instance-of (48) ,

integral -constant (49) ,

integral -constant-units (50) ,

issue-confirmed-notifications (51) ,

limit-enable   (52) ,

list-of-group-members (53) ,

list-of-object-property-references (54) ,

list-of-session-keys (55) ,

local-date   (56) ,

local -time (57) ,

location (58) ,

low-limit (59) ,

manipulated-variable-reference (60) ,

maximum-output (61) ,

max-apdu-length-accepted (62) ,

max-info-frames (63) ,

max-master (64) ,

max-pres-value (65 ) ,

minimum-of-time (66) ,

minimum-on-time (67 ) ,

minimum-output (68) ,

min-pres-value (69) ,

model-name (70) ,

odification-date (71) ,

notification-class (17) , --从以前的版本重命名而来

notify-type (72) ,

number-of APDU-retries (73) ,

number-of states (74) ,

object-identifier (75) ,

object-list (76) ,

object-name (77) ,

object-property-reference (78) ,

object-type (79) ,

optional (80) ,

out-of-service (8l) ,

output-units (82) ,

-- see event-parameters (83) ,

polarity (84) ,

present-value (85) ,

priority (86) ,

priority-array (87) ,

priority-for-writing (88) ,

process-identifier (89) ,

program-change (90) ,

program-location (9l) ,

program-state (92) ,

proportional-constant (93) ,

proportional-constant-units (94) ,

protocol-conformance-class (95) ,

protocol-object-types-supported (96) ,

protocol-services-supported (97) ,

protocol-version (98) ,

read-only (99) ,

reason-for-halt (l00) ,

recipient   (101) ,

recipient-list (l02) ,

reliability (l03) ,

relinquish-default (l04) ,

required (l05) ,

resolution (l06) ,

segmentation-supported (107) ,

setpoint (108) ,

setpoint-reference (l09) ,

state-text (ll0) ,

status-flags (1l1) ,

system-status (112) ,

time-delay (l13) ,

time-of-active-time-reset (l14) ,

time-of-state-count-reset (l15) ,

ime-synchronization-recipients (1l6) ,

units (ll7) ,

update-interval (l18) ,

utc-offset (119) ,

vendor-identifier (120) ,

vendor-name (12l) ,

vt-classes-supported (l22) ,

weekly-schedule (l23) ,

}

-- 特定的属性标识符, 不论是所有、 可选、 还是必需, 保留为条件读属性服务和读多个属性服务所用, 或者为本标准没有定义的其它服务所用。

--本版本使用的最高枚举值是 123。

 

BACnetPropertyReference : : = SEQUENCE{

PropertyIdentifier [0] BACnetPropertyIdentifier,

PropertyArrayIndex [l] Unsigned OPTIONAL --只与数组数据类型一起使用

--如果数组中省略这个参数, 表示引用整个数组

}

 

BACnetPropertyStates : : = CHOICE {

-- 本表述表示属性可能的数据类型, 这些属性具有离散值或枚举值。 这个选择必须与事件登记对象中引用属性的数据类型一致。

boolean-value [0] BOOLEAN,

binary-value [1] BACnetBinaryPV,

event-type [2] BACnetEventType,

Polarity [3] BACnetPolarity,

program-change [4] BACnetProgramRquest,

Program-state [5] BACnetProgramState,

reason-for-halt [6] BACnetProgramErmr,

reliability [7] BACnetReliability,

state [8] BACnetEventState,

system-status [9] BACnetDeviceStatus,

units [l0] BACnetEngineeringUnits,

}

 

BACnetProperityValue :: == SEQUENCE {

propertyIdenifier [0] BACnetPropertyIdentifier,

propertyArrayIndx [l] Unsigned OPTIONAL, --只与数组数据类型一起使用

--如果数组中省略这个参数, 表示引用整个数组

value [2] ABSTRACT-SYNTAX. &Type,

 -- 任何适合指定属性的数据类型

priority [3] Unsigned (1. . l6) OPTIONAL --只与命令属性一起使用

}

 

BACnetRecipient : : = CHOICE {

device [0] BACnetObjectIdentifier,

address [1] Bacnetaddress

}

 

BACnetRecipientPrcoess : : = SEQUENCE {

recipient [0] BACnetRecipient,

processIdentifier [l] Unsigned

}

 

BACnetReliability :: = ENUMERATED {

no-fault-detected (0) ,

no-sensor (1) ,

over-range (2) ,

under-range (3) ,

open-loop (4) ,

shorted-loop (5) ,

no-output (6) ,

unreliable-other (7) ,

process-error (8) ,

}

 

BACnetSegmentation : : = ENUMERATED {

segmented-both (0) ,

segmented-transmit (1) ,

segmented-receive (2) ,

no-segmentation (3)

}

 

BACnetServicesSupported : : == BIT STRING {

--Alarm and Event Service

acknledgeAlarm (0) ,

confirmedCOVNotifiotfon (l) ,

confirmedEventNotification (2 ) ,

getAlarmSummary (3) ,

getEnrollmentSummary (4) ,

subscribeCOV (5) ,

-- File Access Services

atomicReadFile (6) ,

atomicWriteFile (7) ,

-- Object Access Services

addListElement (8) ,

removeListElement (9) ,

createObject (l0) ,

deleteObject (l1) ,

readProperty (12) ,

readPropertyConditional (13) ,

readPropertyMultiple (l4) ,

writeProperty (15) ,

writePropertyMultiple (16) ,

-- Remote Device Management Services

deviceCommunicationControl (17) ,

confirmedPrivateTransfer (l8) ,

confirmedTextMessage (l9) ,

reinitializeDevice (20) ,

-- Virtual Terminal Services

vtOpen (21) ,

vtClose (22) ,

vtData (23) ,

-- Security Services

authenticate (24) ,

requestKey (25) ,

-- Unconfirmed Services

i-Am (26) ,

i-Have (27) ,

unconfirmedCOVNotification (28) ,

unconfirmedEventNotification (29) ,

unconfirmedPrivateTransfer (30) ,

unconfirmedTextMessage (3l) ,

timeSynchronization (32) ,

who-Has (33) ,

who-Is (34)

}

 

BACnetSessionKey : : = SEQUENCE {

sessionKey           OCTET STRING (SIZE(8) ) ,

-- 56 比特作为密钥, 8 比特作为校验和

peerAddress         BACnetAddress

}

 

BACnetSetpointReference : : = SEQUENCE {

setpointReference            [0] BACnetObjectPropertyReferene OPTIONAL

}

 

BACnetSpecialEvent : : = SEQUENCE {

period             CHOICE {

                          calendarEntry                       [0] BACnetCalendarEnry,

                          calendarReference               [1] BACnetObjectIdentifier

} ,

listOfTimeValues    [2] SEQUENCE OF BACnetTimeValue,

evenPriority          [3] Unsigned (l. . l6)

}

 

BACnetStatusFlags :: = BIT STRING {

in-alarm (0) ,

fault (l) ,

overridden (2) ,

out-of-service (3)

}

 

BACnetTimeStamp : : = CHOICE {

time [0] Time,

sequenceNumber [l] Unsigned (0. . 65535) ,

dateTime [2] BACnetDateTime

}

 

BACnetTimeValue : : = SEQUENCE {

time Time,

value ABSTRACT-SYNTAX. &Type

}

 

BACnetVTClass : : = ENUMERATED {

default-terminal (0) ,

ansi-x3-64 (1) ,

dec-vt52 (2) ,

dec-vtl00 (3) ,

dec-vt220 (4) ,

hP-700-94 (5) ,

ibm-3130   (6) ,

}

 

BACnetVTSession : : = SEQUENCE {

local-vtSessionID Unsigned8,

remote-vtSessionID Unsigned8,

remote-vtAddress BACnetAddress

}

 

BACnetWeekNDay : : = OCTET STRING (SIZE (3) )

-- first octet month (l. . 12) January = 1, X' FF' = any month

-- second octet weekOfMonth where: 1 = days numbered 1-7

-- 2 = days numbered 8-14

-- 3 = days numbered 15-21

-- 4 = days numbered 22-28

-- 5 = days numbered 29-31

-- 6 = last 7 days of this month.

-- 255 = any week of this month

-- third octet dayOfWeek (l. . 7) where : l = Monday

-- 7 = Sunday

-- X‘FF' = any day of week

 

ReadAccessResult : : = SEQUENCE {

objectIdentifier [0] BACnetObjectIdentifier,

listOfResults [1] SEQUENCE OF SEQUENCE {

      propertyIdentifier [2] BACnetPropertyIdentifier,

      propertyArrayIndex [3] Unsigned OPTIONAL,

– -只与数组数据类型一起使用

--如果数组中省略这个参数, 表示引用整个数组

     readResult CHOICE {

                propertyValue [4] ABSTRACT-SYNTAX. &Type,

                 propertyAccessError [5] Error

             }

        } OPTIONAL

}

 

ReadAccessSpecification : : = SEQUENCE{

objectIdentifier [0] BACnetObjectIdentifier,

listOfPropertyReferences [1] SEQUENCE OF BACnetPropertyReference

}

 

WriteAccessSpecification : : = SEQUENCE {

ObectIdenifier   [0] BACnetObjectIdentifier,

listOfProperties [1] SEQUENCE OF BACnetPropertyValue

}

十五、BACnet APDU可变部分的编码

这部分的数据编码通常分为两个部分:数据类型描述部分和数据部分。描述部分主要描述接下来的数据是什么类型,如何编码,所占长度等信息;关于这部分需要详细的说明如下:

 

首先描述部分含有一个Tags,主要分为两类:应用Tag和上下文Tag,前者的结构如下:

BIT7---BIT4

Bit3

Bit2—Bit0

Tag number

Class

Length/Value/Type

Tag number: 指出了数据的类型(0-14只占据4位数据,当高四位置为‘1111’时表示接

下来的一个字节作为Tag的描述)

Class: 0时表示数据位应用数据类型,1表示上下文数据类型;此种情况下Tag Number为上下文Tag

Length/Value/Type:当(0-4)时表示数据的长度,当为’101’时表示后边的octor代表数据

  的长度.如果为’110’表示为一个opening tag,那么必然需要一个closeing

    Tag( ‘111’)

Application tags:

0: NULL

1: Boolean

2: unsigned integer

3: signed interger

4: Real(ASNSI/IEEE-754)

5: Double(ANSI/IEEE-754 double precision floating point)

6: octor string

7: Character string

8: Bit string

9: Enumerated

10:Date

11:Time

12:BACnetObjectIdentifier

Context-special tags: 含有一个context tag  如其位于结构中的第一个context tag则为1,第二个context tag则为2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值