查看MBus的源代码
←
MBus
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
=== Wired M-Bus === Wired M-Bus has a bus topology where a single master can communicate with up to 250 slaves (even more when secondary addressing is used) over twisted pair cable. The master communicates with a slave using voltage changes (36/24V) and a slave communicates with the master using current changes(1.0/1.5mA). The current can optionally be used by devices as a power supply. M-Bus devices are protected against polarity reversal and may use a baud rate between 300 Baud and 38400 Baud. Most meters use 2400 Baud. Wired M-Bus differentiates between five different frame types: single character (the byte 0xe5 is used for confirmation purposes), SND_NKE (send link reset), SND_UD (send user data), REQ_UD1 (request user data 1), REQ_UD2 (request user data 2) and RSP_UD (respond user data). The most common M-Bus message exchange is the request/response service where the master sends a REQ_UD2 frame addressed to a specific slave (usually a meter) and the slave answers with RSP_UD message containing all the current measurement values. The REQ_UD2 frame contains only the primary address (1 byte) of the slave that is to be read. A master cannot address certain data points it wants to read. Instead the slave always answers with a complete list of its data. A slave that successfully receives a REQ_UD2 message with a matching address replies with a RSP_UD frame. All other slaves that receive the request do not answer. The RSP_UD frame contains the address of the slave sending the frame, a control information (CI) field equal to 0x72, 0x78 or 0x7A and a variable data structure that is explained further down. The CI field may have other values if an application layer other than the M-Bus application layer is used (e.g. COSEM). The jMBus library only supports the M-Bus application layer. <br> ==== Primary Addressing ==== The primary address is coded as a single byte allowing values between 0 and 255. Addresses 1 to 250 may be assigned to slaves. The other addresses have special purposes: 255 is a broadcast address. A device that receives a message with address 255 never replies to it. Sending REQ_UD2 frames to the broadcast address makes therefore little sense. 254 is also a broadcast address. This time all slaves shall answer requests which may lead to collisions and is only meant for testing purposes. 251 and 252 are reserved and should not be used for now. 0 is used by unconfigured slaves. They can later be assigned to other addresses using secondary addressing. 253 indicates that secondary addressing is being used. <br> ==== Secondary Addressing ==== Unconfigured slaves usually have a primary address of 0 assigned. In this case the master can still address the slave using secondary addressing. Secondary addressing works using two message exchanges. First the master sends a SND_UD frame addressed to primary address 253. The SND_UD frame contains the secondary address of the target slave. The addressed slave replies with a confirmation (single character). This mechanism is called selecting a slave. Next the master can read the slave by sending a regular REQ_UD2 frame again to primary address 253. Only the selected slave will answer the request. The secondary address is a world wide unique ID of the M-Bus device. It is 8 bytes long and consists of the following fields: Identification Number (4 bytes) – A number ranging from 00000000 to 99999999 to identify the meter. Manufacturer ID (2 bytes) – Three letters that identify the manufacturer. Version (1 byte) – Specifies the version of the device. The version is manufacturer specific. Device type (1 byte) – This field codes the device type (e.g. electricity meter, cold water meter) <br>
返回到
MBus
。
个人工具
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面