为了实现三容水箱教学实验平台中液位控制算法的多样化和可移植性,设计了基于Matlab图形用户界面(Graphic User Interface,GUI)的计算机监控系统.利用Matlab的串口通信API,通过RS-485/RS-232数据通信接口实现对三容水箱液位的数据采集和控制.通信采用Modbus RTU协议确保数据的可靠传输.系统软件界面友好、编程方便、操作简单,同时用户可以植入算法使系统运行于多种模式下.结果表明,基于Matlab GUI设计的计算机监控系统能够快速、准确地绘制出液位响应曲线,Flash动画能够实时模拟出实验进度.%In order to achieve the algorithm diversification portability of the computer monitoring system in the liquid level control,the paper designed a computer monitoring system based on Matlab graphical user interface (GUI).The system uses Matlab' s serial communication API,and uses the RS-485/RS-232 data communication interface to achieve data collection and controlling for the three-tank.Modbus RTU protocol is applied for communication to ensure the accuracy of data transmission.System software has a friendly interface,easy programming,simple operation and other features,users can implant the algorithm to run the system in a variety of modes.Experimental result shows that design of the computer monitoring system can quickly and accurately draw the level response curve,Flash animation can simulate real-time experimental progress based on Matlab GUI.
展开▼