摘要
提出了分布式气象数据采集系统的实现方案。阐述了PC机与单片机之间多机通讯的原理及实现方法。其中的单片机是针对应用最广泛的MCS-51系列中的8031单片机设计的。利用8031单片机串行口的多机通讯模式和PC机的奇偶校验位,构成分布式气象数据采集系统。分布式气象数据采集系统是一个多机系统,它以PC机为主机,以其奇偶校验位为多机通讯标志位,以单片机为从机。从单片机进行数据采集及初级处理,而PC主机则汇总数据并完成综合处理,同时还能根据情况随时向各个从单片机发出操作命令。采用的RS-422A标准串行接口代替了常用的RS-232C标准串行接口,它采用差动接收、差动发送的工作方式,提高了通讯可靠性。在软件上,把通讯数据分为数据帧和命令帧,按照主从机之间的通讯协议分别传送,这有利于程序的模块化设计。该方法可以推广应用于其他系统,对硬件电路设计及程序设计具有一定的参考价值。
An implementation scheme of distributed meteorological data collection system is proposed. The principle and implementation method of Multi Computer communication between personal computer and Single Chip Micyoco are described. The design of Single Chip Micyoco is directly facing 8031 Single Chip Micyoco of the series of MCS - 51. Constitutes the distributed meteorological data collection system with the Multi Computer communication mode of serial interface of 8031 Single Chip Micyoco and the P/V bit of personal computer. The distributed meteorological data collection system is a Multi Computer system with personal computer as master computer, P/V bit as Multi Computer communication sign bit, Single Chip Micyoco as slave computer. The slave Single Chip Micyoco be used of data collection and processing and the master PC be used of synthesize processing. The master PC can send out managerial command according to the condition of system at any moment. The usualy standard of RS - 232C of serial interface replace by RS - 422A. Using the difference receive and transmit,reliability was improved. At the software of this system, the communicate data separate into data frames and command frames and be able to respective transmission according to the communication protocol between master computer and slave computer. It is in favor of modularization of programmer. The design method can be generalized for other system and is valuable for the designs of both hardware and software.
出处
《气象水文海洋仪器》
2002年第3期1-6,共6页
Meteorological,Hydrological and Marine Instruments
关键词
分布式气象数据采集系统
多机通讯
通讯协议
单片机
distributed,data collection, Multi Computer communication,communication protocol, Single Chip Micyoco