基于BACnet的PLC控制器的设计与实现
2018-01-22郭庆秦明达许金
郭庆+秦明达+许金
摘 要: 为了使PLC控制器能够与BACnet国际楼宇自动控制标准契合,设计并开发了基于STM32控制芯片和MS/TP协议的PLC控制器。控制器可通过梯形图进行现场编程,具有完整的控制逻辑,满足BACnet的一致性要求。实验测试表明,PLC控制器可以使用RS 485总线与PC上的BACnet虚拟机进行通信,达到0.596 ms的响应时间,并满足PLC的稳定性,具有编程简单、高效、实时性好、运行稳定的特点。
关键词: PLC控制器; BACnet; MS/TP; STM32; 楼宇自动控制; 梯形图编程
中图分类号: TN876?34; TN710.1; TP368.2 文献标识码: A 文章編号: 1004?373X(2018)02?0038?06
Abstract: To make PLC controller fit with the international building automation control standard of BACnet, the programmable logic controller (PLC) based on STM32 control chip and MS/TP protocol was designed and developed. The controller can be programmed in spot by using the ladder diagram, and has complete control logic to meet the conformance requirements of BACnet. The experiment result shows that the PLC can communicate with BACnet virtual machine on PC via RS 485 bus, whose response time can reach to 0.596 ms, and meet the stability of the PLC. The PLC has the characteristics of simple and efficient programming, high real?time performance, and stable operation.
Keywords: PLC controller; BACnet; MS/TP; STM32; building automation control; ladder diagram programming
0 引 言
PLC(Programmable Logic Controller)作为灵活方便、通用性强、可靠性高、接口简单、编程容易、稳定实用的现场控制器,是目前应用最广泛的现场控制器之一。在空调控制系统、电梯控制系统以及其他楼宇控制系统中,PLC控制器的应用也十分广泛,而随着楼宇自动控制系统的发展和研究,BACnet(Building Automation and Control Networks)国际标准也更多地应用到楼宇控制系统中。由于不能便捷地与BACnet网络通信,PLC控制器的发展和使用受到了极大的限制。
基于BACnet协议的PLC控制器,可以在不改变PLC编程方式的前提下,使操作人员可以从BACnet网络中监控到PLC控制器以及其控制设备的状态。这种新型的PLC控制器可以减少编程人员的培训成本,对我国智能建筑的发展和BACnet的研究和应用是十分必要的。
1 基于BACnet协议的PLC控制器的设计实现
BACnet协议在OSI/RM(Open System Interconnection/Reference Model)模型的基础上进行了最大程度上的精简。精简后的结构只留下应用层、网络层、数据链路层和物理层[1]。根据协议结构,所设计的整体自动控制系统如图1所示。系统采用MS/TP(Master?Slave/Token?Passing data link protocol)作为整个系……
