【发布时间】:2017-07-31 11:30:41
【问题描述】:
我正在尝试从 BACnet 接口读取对象和属性。我们正在使用 BACnet4J 的示例代码,我们的客户端代码预计将与 LumInsight Desktop(Propriety Software)提供的 BACnet 接口进行通信。
因此,在我们的案例中,设备发现已完成,但我们陷入了如何从 BACnet 接口读取设备级别和对象级别信息的问题。
这是我目前得到的输出:
SLF4J: 加载类失败
“org.slf4j.impl.StaticLoggerBinder”。 SLF4J:默认为无操作 (NOP) 记录器实现 SLF4J:请参阅 http://www.slf4j.org/codes.html#StaticLoggerBinder 了解更多 细节。初始化打印地址...地址[networkNumber=0, macAddress=[a,2c,37,5,ba,c0]] RemoteDevice(instanceNumber=10001, 地址=地址 [networkNumber=0, macAddress=[a,2c,37,5,ba,c0]]) ObjectIdentifier:设备 10001 getName:LumInsight 虚拟路由器 getModelName:LIBI-01 远程设备:RemoteDevice(instanceNumber=10001, 地址=地址 [networkNumber=0, macAddress=[a,2c,37,5,ba,c0]]) 用户 数据:模拟输入:模拟输入 12 模拟输入 12 com.serotonin.bacnet4j.exception.PropertyValueException
请查找随附的源代码供您参考。
ObjectIdentifier ai3 = new ObjectIdentifier(ObjectType.analogInput,12);
System.out.println("analog input:"+ai3);
List<ObjectIdentifier> oids = new ArrayList<ObjectIdentifier>();
oids.add(ai3);
System.out.println(ai3);
for (int i = 0; i < 10; i++) {
PropertyValues pvs = RequestUtils.readOidPresentValues(localDevice1, d1, oids, null);
// System.out.println(pvs);
//System.out.println(pvs.get(ai3, PropertyIdentifier.presentValue));
System.out.println(pvs.get(ai3, PropertyIdentifier.presentValue));
Thread.sleep(5000);
}
【问题讨论】:
-
请阅读Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - 总结是这不是解决志愿者的理想方式,并且可能会适得其反。请不要将此添加到您的问题中。