摘要:MCGS组态软件在工业控制领域中有着广泛的使用,通过对工业现场各种数据的采集来实现对现场的实时监控,具有操作简单、动态效果明显等优点,深受用户的喜爱。但MCGS自身提供的设备驱动大多为使用较为广泛的常见设备,不能满足用户的所有要求。
鉴于MCGS组态软件对单片机的设备驱动的缺乏和当前高校实验教学需求的迫切,研究、设计了MCGS串口设备驱动构件。本文首先分析开发MCGS驱动构件所要遵守Visual Basic 6.0的ActiveX DLL接口规范,并根据MCGS设备驱动构件必须具有的5个属性和8个方法来制定驱动构件的编写方案。利用MCGS高级开发包在Visual Basic 6.0环境下生成驱动构件程序的基本框架并根据设备驱动构件所要遵守的规范和其固有的属性及方法编写驱动程序,并在Visual Basic 6.0环境下调试、运行生成驱动构件。将生成的驱动构件挂接到MCGS组态软件中,在MCGS组态环境中调试后再运用串口调试助手对驱动构件进行调试与验证,证实该驱动构件的可行性。
关键词 MCGS;设备驱动;Visual Basic 6.0
Abstract:The MCGS configuration software has been widely used in the field of industrial control, it realize the real-time monitoring on the spot by collecting a variety of the data in industrial field, and has the advantages of simple operation, obvious dynamic effect, and deeply loved by users. But most of the device driver provided by MCGS are for the use of common equipment, and cannot meet all the users’ requirements.
As the lack of single chip microcomputers’ device driver and current requirements of experimental teaching in colleges and universities to MCGS, so research, design the serial device driver component of MCGS.At first, the present paper analyze the development of MCGS device driver component to observe the Visual Basic 6.0 ActiveX DLL interface specification and depend on five attributes and eight ways which MCGS device driver component must have to writing the device driver. Using MCGS advanced development generate driver component basic program frame in Visual Basic 6.0,and write device driver component based on device driver components to comply with the specifications and its inherent properties and methods, and debugging, running in Visual Basic 6.0 environment to generate drive components. Attaching the generated driver component to the MCGS configuration software, debugging in MCGS and using the serial debugging assistants to drive again after debug and validation to component confirmed the feasibility of the driver components.
Keywords MCGS Device Drivers Visual Basic 6.0