如何在Python中使用BAC0 readRange
大家好,我尝试使用python 3中的BAC0包来获取bacnet网络中多点的值。 我使用了如下内容:如何在Python中使用BAC0 readRange,python,python-3.x,iot,bacnet,bacnet4j,Python,Python 3.x,Iot,Bacnet,Bacnet4j,大家好,我尝试使用python 3中的BAC0包来获取bacnet网络中多点的值。 我使用了如下内容: bacnet = BAC0.lite(ip=x.x.x.x) tmp_points = bacnet.readRange("11:2 analogInput 0 presentValue"); 这似乎不太好:( 错误是: BAC0.core.io.IOExceptions.NoResponseFromController: APDU Abort Reason : unre
bacnet = BAC0.lite(ip=x.x.x.x)
tmp_points = bacnet.readRange("11:2 analogInput 0 presentValue");
这似乎不太好:(
错误是:
BAC0.core.io.IOExceptions.NoResponseFromController: APDU Abort Reason : unrecognizedService
在文件中我只能找到
def readRange(
self,
args,
range_params=None,
arr_index=None,
vendor_id=0,
bacoid=None,
timeout=10,
):
"""
Build a ReadProperty request, wait for the answer and return the value
:param args: String with <addr> <type> <inst> <prop> [ <indx> ]
:returns: data read from device (str representing data like 10 or True)
*Example*::
import BAC0
myIPAddr = '192.168.1.10/24'
bacnet = BAC0.connect(ip = myIPAddr)
bacnet.read('2:5 analogInput 1 presentValue')
Requests the controller at (Network 2, address 5) for the presentValue of
its analog input 1 (AI:1).
"""
def读取范围(
自己
args,
范围参数=无,
arr_索引=无,
供应商id=0,
bacoid=无,
超时=10,
):
"""
生成ReadProperty请求,等待回答并返回值
:param args:带[]的字符串
:返回:从设备读取的数据(str表示10或True等数据)
*示例*::
进口氯化钡
myIPAddr='192.168.1.10/24'
bacnet=BAC0.connect(ip=myIPAddr)
bacnet.read('2:5模拟输入1呈现值')
向位于(网络2,地址5)的控制器请求当前值
其模拟输入1(AI:1)。
"""
要从设备对象读取多个属性,必须使用readMultiple
readRange
将从类似数组的属性读取(例如,TrendLogs对象将记录实现为数组,我们使用readRange使用记录块读取它们)
有关如何使用readMultiple的详细信息,请参见:
一个简单的例子是
bacnet = BAC0.lite()
tmp_points = bacnet.readMultiple("11:2 analogInput 0 presentValue description")
作为参考,unrecognizedService是来自设备的消息,告诉您它不支持此服务。