论文部分内容阅读
自动控制系统中,经常会用上位微机的串口监控由可编程控制器或单片机组成的控制系统的运行情况。在上位机编程中也常会遇到上、下位机数据交换与上位机图形显示、数据处理等事务相矛盾的问题,本文提出了一种解决这种矛盾的方法,利用串行接口中断实现数据在上位机后台自动交换,在设计前台事务处理程序时就可以不考虑数据交换问题,避免了两者之间的矛盾。 在控制系统中常会遇到上、下位机这种系统构成,通常上位机是IBM—PC/XT兼容机,下位机是单片机系统、单板机系统或可编程控制器系统.这几种组成方式都需要实现上、下位机数据交换。往往在数据交换过程中,上位机还要实时处理一些事务,如显示图形、实时处理数据等,数据交换与其它事务处理成为一对矛盾。 上、下位机的数据交换一般是通过串行通讯实现的,在上位机编程中,大多数采用查询方式发送、中断方式接收,这样上位机在实时处理事务的同时还要不断地查询发送数据,编程很困难.笔者在实际工作中经过反复试验,编制出串行接口自动数据发送和数据接收程序,数据发送和数据接收均采用中断方式,在程序中一旦做好设置,即可实现数据自动交换,大大简化编程。
Automatic control system, often with the host computer’s serial port monitoring by the programmable controller or microcontroller control system consisting of the operation. In the host computer programming often encounter the upper and lower computer data exchange with the host computer graphics display, data processing and other matters contradictory issues, this paper presents a solution to this contradiction, the use of serial interface interrupt data PC background automatic exchange, in the design of foreground transaction processing program can not consider the data exchange problems, to avoid the contradiction between the two. In the control system often encounter, the next crew of this system configuration, usually the host computer is IBM-PC / XT compatible machine, the next crew is the microcontroller system, single board machine system or programmable controller system. Need to achieve on the next bit machine data exchange. Often in the data exchange process, the host computer also need to deal with some real-time transactions, such as the display graphics, real-time data processing, data exchange and other transactions become a contradiction. The upper and lower computer data exchange is generally achieved through serial communication in the host computer programming, most of the way to send using the query, interrupt receiving, so PC in real-time transaction processing but also continue to query the send data, Programming is very difficult.The author in the actual work through trial and error, the preparation of a serial interface to send and receive data automatically the program, data transmission and data reception are used interrupt, once the program is set up, you can achieve automatic data exchange , Greatly simplifying programming.