BACnet通信分析Word文件下载.docx
- 文档编号:19981202
- 上传时间:2023-01-13
- 格式:DOCX
- 页数:42
- 大小:30.66KB
BACnet通信分析Word文件下载.docx
《BACnet通信分析Word文件下载.docx》由会员分享,可在线阅读,更多相关《BACnet通信分析Word文件下载.docx(42页珍藏版)》请在冰豆网上搜索。
3、BACnetNPDU结构.
版本信息
1Byte
Version
控制字
Control
目标网络号
2Bytes
DNET
目标网络长度
DLEN
目标地址
可变长度
DADR
原网络号
SNET
原网络长度
SLEN
原地址
可变
路由数目
HopCount
消息类型
MessageType
卖方ID
VendorID
应用层信息
版本信息:
默认0x01
操纵字:
BIT7:
1表示MessageType存在,为0时MessageType不存在
BIT6:
保留,为0
BIT5:
1表示DNETDLENHopCount存在,当DLEN为0时说明广播网络
DADR不存在;
0表示DNETDLENDADRHopCount不存在
BIT4:
BIT3:
1表示SNETSLEN存在,当SLEN为0时说明无效SADR不存在;
0表示SNETSLENSADRHopCount不存在
BIT2:
1表示为一个需确认的请求数据单元,一复杂ACK数据单元或一网络层
信息非reply的;
0表示除去上述情形的数据单元
BIT一、0:
网络优先级
11=LifeSafetymessage
10=CriticalEquipmentmessage
01=Urgentmessage
00=Normalmessage
目标网络号:
FFFF的时候表示广播
目标长度:
表示DADR的长度
目标地址:
目标网络MAC地址
原网络号:
同目标网络号
原网络长度:
表示SADR的长度
原地址:
原网络的MAC地址
路由数量:
数据需要经过的路由个数,当不存在DNET的时候,需设置为FF
消息类型:
X'
00'
:
Who-Is-Router-To-Network
X'
01'
I-Am-Router-To-Network
02'
I-Could-Be-Router-To-Network
03'
Reject-Message-To-Network
04'
Router-Busy-To-Network
05'
Router-Available-To-Network
06'
Initialize-Routing-Table
07'
Initialize-Routing-Table-Ack
08'
Establish-Connection-To-Network
09'
Disconnect-Connection-To-Network
0A'
toX'
7F'
ReservedforusebyASHRAE
80'
FF'
Availableforvendorproprietarymessages
卖方ID:
当控制字的BIT7为1并且消息类型为X'
的时候,才会存在
本次开发没有效到,再也不说明
本次应用中操纵字只用到0x20和0x04两种,前者为广播查询设备,后者微点对对取设备数据或属性。
4、BACnetAPDU结构:
(应用层协议数据单元)
BACnet网络层数据要紧分为一下几种:
BACnetPDU:
=CHOICE
{
confirmed-request-PDU[0]BACnet-Confirmed-Request-PDU,
unconfirmed-request-PDU[1]BACnet-Unconfirmed-Request-PDU,
simpleACK-PDU[2]BACnet-SimpleACK-PDU,
complexACK-PDU[3]BACnet-ComplexACK-PDU,
segmentAck-PDU[4]BACnet-SegmentACK-PDU,
error-PDU[5]BACnet-Error-PDU,
reject-PDU[6]BACnet-Reject-PDU,
abort-PDU[7]BACnet-Abort-PDU
}
关于本次应用,要紧用到了
BACnet-Confirmed-Request-PDU(需确认的请求协议数据单元)
BACnet-Unconfirmed-Request-PDU(无需确认的请求协议数据单元)
BACnet-ComplexACK-PDU(复杂的ACK命令)
BACnet-Error-PDU(报错的协议数据单元)
关于上述几种数据的分类要紧依照pdutype(下文进行讲解)进行判定。
.BACnet-Confirmed-Request-PDU的结构:
BACnet-Confirmed-Request-PDU:
=SEQUENCE
pdu-type[0]Unsigned(0..15),--0forthisPDUtype
segmented-message[1]BOOLEAN,
more-follows[2]BOOLEAN,
segmented-response-accepted[3]BOOLEAN,
reserved[4]Unsigned(0..3),--mustbesettozero
max-segments-accepted[5]Unsigned(0..7),--asper20.1.2.4
max-APDU-length-accepted[6]Unsigned(0..15),--asper20.1.2.5
invokeID[7]Unsigned(0..255),
sequence-number[8]Unsigned(0..255)OPTIONAL,--onlyifsegmentedmsg
proposed-window-size[9]Unsigned(1..127)OPTIONAL,--onlyifsegmentedmsg
service-choice[10]BACnetConfirmedServiceChoice,
service-request[11]BACnet-Confirmed-Service-RequestOPTIONAL
BIT7
BIT6
BIT5
BIT4
BIT3
BIT2
BIT1
BIT0
PDUTYPE
SEG
MOR
SA
MaxSegs
MaxResp
InvokeID
SequenceNumber(onlypresentbySEG==1)
ProposedWindowSize(onlypresentbySEG==1)
ServiceChioce
ServiceRequest……
PDUType0(BACnet-Confirmed-Service-Request-PDU)
SEG0(UnsegmentedRequest)
1(SegmentedRequest)
MOR0(NoMoreSegmentsFollow)
1(MoreSegmentsFollow)
SA0(SegmentedResponsenotaccepted)
1(SegmentedResponseaccepted)
MaxSegs(0..7)(Numberofresponsesegmentsacceptedper20.1.2.4)
MaxResp(0..15)(SizeofMaximumAPDUacceptedper20.1.2.5)
InvokeID(0..255)
SequenceNumber(0..255)OnlypresentifSEG=1
ProposedWindowSize(1..127)OnlypresentifSEG=1
ServiceChoiceBACnetConfirmedServiceChoice
ServiceRequestVariableEncoding
SEG:
指出当前的数据单元是不是为完整的仍是为一部份分段信息
MOR:
指出是不是还有更多的分段信息
SA:
为1时指出将收到一个复杂的回应(complexack)
MaxSegs:
指出设备将要接收到多少分段信息
B'
000'
Unspecifiednumberofsegmentsaccepted.
B'
001'
2segmentsaccepted.
010'
4segmentsaccepted.
011'
8segmentsaccepted.
100'
16segmentsaccepted.
101'
32segmentsaccepted.
110'
64segmentsaccepted.
111'
Greaterthan64segmentsaccepted.
MaxResp:
指出将收到的(APDU)最大长度
0000'
UptoMinimumMessageSize(50octets)
0001'
Upto128octets
0010'
Upto206octets(fitsinaLonTalkframe)
0011'
Upto480octets(fitsinanARCNETframe)
0100'
Upto1024octets
0101'
Upto1476octets(fitsinanISO8802-3frame)
InvokeID:
挪用者ID
ServiceChioce:
此处说明次报文的作用,详见BACnetConfirmedServiceChoice
ServiceRequest:
依照BACnetConfirmedServiceChoice不同而结构不同,详见
BACnet-Confirmed-Service-Request
BACnetConfirmedServiceChoice:
=列举类型
--AlarmandEventServices
acknowledgeAlarm(0),
confirmedCOVNotification
(1),
confirmedEventNotification
(2),
getAlarmSummary(3),
getEnrollmentSummary(4),
getEventInformation(29),
subscribeCOV(5),
subscribeCOVProperty(28),
lifeSafetyOperation(27),
--FileAccessServices
atomicReadFile(6),
atomicWriteFile(7),
--ObjectAccessServices
addListElement(8),
removeListElement(9),
createObject(10),
deleteObject(11),
readProperty(12),
readPropertyConditional(13),
readPropertyMultiple(14),
readRange(26),
writeProperty(15),
writePropertyMultiple(16),
。
上述标记为红色的表示本次应用中所用到的,因此只对这些进行讲解。
能够依照BACnetConfirmedServiceChoice找到相对应的Request或Ack的数据的结构
BACnet-Confirmed-Service-Request:
=CHOICE
127)OPTIONAL,
--requiredforMS/TPmaster,see
max-info-frames[63]UnsignedOPTIONAL,
device-address-binding[30]SEQUENCEOFBACnetAddressBinding,
database-revision[155]Unsigned,
configuration-files[154]SEQUENCEOFBACnetObjectIdentifier,
last-restore-time[157]BACnetTimeStamp,
backup-failure-timeout[153]Unsigned16,
active-cov-subscriptions[152]SEQUENCEOFBACnetCOVSubscription,
max-segments-accepted[167]Unsigned,
slave-proxy-enable[172]SEQUENCEOFBOOLEANOPTIONAL,
auto-slave-discovery[169]SEQUENCEOFBOOLEANOPTIONAL,
slave-address-binding[171]SEQUENCEOFBACnetAddressBindingOPTIONAL,
manual-slave-address-binding[170]SEQUENCEOFBACnetAddressBindingOPTIONAL,
profile-name[168]CharacterStringOPTIONAL
上述标记为红色者既是本次应用用到的设备属性对象
ANALOG-INPUT:
object-identifier[75]BACnetObjectIdentifier,
object-name[77]CharacterString,
object-type[79]BACnetObjectType,
present-value[85]REAL,
description[28]CharacterStringOPTIONAL,
device-type[31]CharacterStringOPTIONAL,
status-flags[111]BACnetStatusFlags,
event-state[36]BACnetEventState,
reliability[103]BACnetReliabilityOPTIONAL,
out-of-service[81]BOOLEAN,
update-interval[118]UnsignedOPTIONAL,
units[117]BACnetEngineeringUnits,
min-pres-value[69]REALOPTIONAL,
max-pres-value[65]REALOPTIONAL,
resolution[106]REALOPTIONAL,
cov-increment[22]REALOPTIONAL,
time-delay[113]UnsignedOPTIONAL,
notification-class[17]UnsignedOPTIONAL,
high-limit[45]REALOPTIONAL,
low-limit[59]REALOPTIONAL,
deadband[25]REALOPTIONAL,
limit-enable[52]BACnetLimitEnableOPTIONAL,
event-enable[35]BACnetEventTransitionBitsOPTIONAL,
acked-transitions[0]BACnetEventTransitionBitsOPTIONAL,
notify-type[72]BACnetNotifyTypeOPTIONAL,
event-time-stamps[130]SEQUENCEOFBACnetTimeStampOPTIONAL,
--accessedasaBACnetARRAY
ANALOG-OUTPUT:
object-identifier[75]BACnetObjectIdentifier,
object-name[77]CharacterString,
object-type[79]BACnetObjectType,
present-value[85]REAL,
description[28]CharacterStringOPTIONAL,
device-type[31]CharacterStringOPTIONAL,
status-flags[111]BACnetStatusFlags,
event-state[36]BACnetEventState,
reliability[103]BACnetReliabilityOPTIONAL,
out-of-service[81]BOOLEAN,
units[117]BACnetEngineeringUnits,
min-pres-value[69]REALOPTIONAL,
max-pres-value[65]REALOPTIONAL,
resolution[106]REALOPTIONAL,
priority-array[87]BACnetPriorityArray,
relinquish-default[104]REAL,
cov-increment[22]REALOPTIONAL,
time-delay[113]UnsignedOPTIONAL,
notification-class[17]UnsignedOPTIONAL,
high-limit[45]REALOPTIONAL,
low-limit[59]REALOPTIONAL,
deadband[25]REALOPTIONAL,
limit-enable[52]BACnetLimitEnableOPTIONAL,
event-enable[35]BACnetEventTransitionBitsOPTIONAL,
acked-transitions[0]BACnetEventTransitionBitsOPTIONAL,
notify-type[72]BACnetNotifyTypeOPTIONAL,
event-time-stamps[130]SEQUENCEOFBACnetTimeStampOPTIONAL,
profile-name[168]CharacterStringOPTIONAL
ANALOG-VALUE:
object-identifier[75]BACnetObjectIdentifier,
object-name[77]CharacterString,
object-type[79]BACnetObjectType,
present-value[85]REAL,
description[28]CharacterStringOPTIONAL,
status-flags[111]BACnetStatusFlags,
event-state[36]BACnetEventState,
reliability[103]BACnetReliabilityOPTIONAL,
out-of-service[81]BOOLEAN,
units[117]BACnetEngineeringUnits,
priority-array[87]BACnetPriorityArrayOPTIONAL,
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- BACnet 通信 分析