求解fuxa组态连接bacnet设备的步骤和方法

您好,fuxa在连接bacnet设备时,出现设备连接成功,但是tag标签刷新不出来,出现这种错误'bacnet' working (connection || polling) overload! 或者您有连接bacnet设备的经历吗,求解

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
连接BACnet并读取/写入数据,您需要使用BACnet协议栈和Java BACnet库。以下是一个简单的示例,使用BACnet4J库: ```java import java.util.List; import java.net.InetAddress; import com.serotonin.bacnet4j.*; import com.serotonin.bacnet4j.exception.BACnetException; import com.serotonin.bacnet4j.service.unconfirmed.WhoIsRequest; import com.serotonin.bacnet4j.obj.BACnetObject; import com.serotonin.bacnet4j.type.enumerated.ObjectType; import com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier; import com.serotonin.bacnet4j.type.primitive.ObjectIdentifier; import com.serotonin.bacnet4j.type.primitive.UnsignedInteger; public class BacnetExample { public static void main(String[] args) throws Exception { // 创建BACnet协议栈 final LocalDevice localDevice = new LocalDevice(1234, "127.0.0.1"); localDevice.initialize(); // 发送Who-Is请求以获取设备列表 final List<RemoteDevice> devices = localDevice.sendGlobalBroadcast(new WhoIsRequest()).getDevices(); // 打印设备列表 for (final RemoteDevice device : devices) { System.out.println("Device: " + device); } // 读取设备属性 final RemoteDevice device = devices.get(0); final ObjectIdentifier objectId = new ObjectIdentifier(ObjectType.analogInput, 0); final BACnetObject object = localDevice.getObject(device, objectId); final UnsignedInteger presentValue = (UnsignedInteger) object.getProperty(PropertyIdentifier.presentValue); System.out.println("Present value: " + presentValue); // 写入设备属性 final UnsignedInteger newValue = new UnsignedInteger(42); localDevice.setProperty(device, objectId, PropertyIdentifier.presentValue, newValue); } } ``` 请注意,此示例仅适用于本地连接。如果您需要连接到远程BACnet设备,则需要更改代码以使用远程设备的IP地址和端口号。此外,您可能需要在代码中添加错误处理和异常捕获。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值