1、毕业设计英文翻译可编程控制器的数据库系统DatabaseSystemsforProgrammableLogicControllers212020年4月19日文档仅供参考Database Systems for Programmable Logic ControllersABSTRACTIn this paper, we identify the database issues associated with programmable logic controllers (PLC), special-purpose computers used in scientific and industr
2、ial applications, e.g. in factories in manufacturing environments. We propose as a PLC database system a single-user,real-time, scalable main-memory-only relational database system with a two-level architecture having historical data modeling and manipulation capabilities, and query processing techn
3、iques incorporating time- and/or error-constrained query evaluation. We revise the ladder logic language, the most common PLC language, to incorporate data manipulation language instructions. We add a separate time component into the PLC processor scan time to handle database updates, backup, integr
4、ity enforcement and data archival issues. 1. IntroductionA programmable logic controller (PLC) is a special-purpose computer used within real-time scientific computing systems, and industrial control systems, say, the automated control of a factorys machinery - the running example used in this paper
5、. This paper is a position paper that proposes a PLC database system and discusses its features. In doing so, we touch bases with a number of basic database topics, and, thus, frequently refer to other work for details. PLCs are mostly used in manufacturing environments - hence, the choice of our ru
6、nning example. However, PLCs are also used in scientific applications for signal data gathering and preliminary data processing. Thus, we think that for some scientific applications, a PLC database may also serve as a local/transient part of a larger scientific database.With the rapid advances in co
7、mputer hardware and falling memory prices, in recent years, the capabilities of the new PLCs in the marketplace have been increasing dramatically. This paper is a position paper that argues that a PLC software can now contain a database system to greatly increase its functionality. We propose the ar
8、chitecture in Figure 1 as the architecture of an environment where real-time data gathering (from multiple sensors) and real-time data manipulation takes place.We now list the advantages of having a database system directly inside a PLC.(1)Data Modeling Techniques : The input and output buffers repr
9、esent a rather unorganized transient model of the real world, and hence, carl be modeled better using the traditional data modeling techniques of databases.(2) Historical Databases : PLCs routinely deal with different versions of data over time. Therefore, historical data modeling techniques as well
10、 as historical data manipulation techniques can replace the ad hoc ways of manipulating historical data in PLCs.(3) User-Friendly Interfaces : Presently in the marketplace, the PLC software and industrial terminals allow a limited display of messages and variable-data information in memory. For exam
11、ple, the contact histogram function displays the on/off history of a specific main memory.(4) Handling Large Volumes of Data : With the added capabilities of a database and a query language, the PLC may analyze much larger volumes of data.(5) Data Reduction and Compaction at the PLC Level : Presentl
12、y, for further analysis or simply due to various regulations, data collected by PLCs get transmitted and stored into a host computer file using an architecture shown.Since the present PLCs cannot satisfactorily analyze most data, they simply transmit data to the host computer. In some scientific exp
13、eriments and applications, the data gathered is so large that arguments have been raised for processing the data on-the-fly during the execution of an experiment/transaction SSDB 86(a)Real-Time Database : The data in the input buffer must be scanned within reasonably short real-time intervals rangin
14、g from microseconds to seconds. Therefore,responses to queries must be guaranteed to be less than a certain realtime time bound, almost always less than 5 to 10 seconds.(b)Main Memory Database : Microseconds/seconds query response restrictions necessitate main-memory-only databases.(c) Scalable Data
15、base : Once the environment of a PLC and the requirements of the associated application program are determined, the possible query types to the database stay fixed for a reasonably long period of time. Since the response time of queries is of utmost importance, the DBMS should be scaled so that only
16、 the needed routines/functions (e.g., access methods, data structures, etc.) are incorporated.In section 2, we discuss the general characteristics PLCs, and briefly present the ladder logic language. Section 3 discusses the features of the proposed database system for PLCs.In general, the PLC hardwa
17、re is mostly custom-built with occasional off-the-shelf hardware, and consists of a CPU (or multiple CPUs), main memory, an industrial terminal, and high- and medium-speed data communications hardware. The size of the main memory ranges from 16K bytes (of 5 to 10 years ago) to 8M bytes (of the prese
18、nt time).Although the CPU has an instruction set similar to those found in CPUs of 16-bit and 32-bit machines, it is especially equipped with fast bit manipulation instructions. The industrial terminal comes with a special keyboard to make the programming of the PLC easier and/or to intervene with t
19、he application program.The PLC software consists of an operating system (ranging from a very simplistic monitor (of ten years ago) to a sophisticated real-time operating system (of the recent time), high-speed communications software for communicating with I/O processors,medium-speed communications
20、software to the industrial terminal and to other intelligent devices.Both general-purpose computers and PLCs are used for industrial control Star 87.However, they differ in the programming languages that they use, environmental specifications, and their user types. PLCs are rugged, and work in hosti
21、le environments with no special climate controls, tolerating extremes of temperature (60 C), humidity (95%) and air contamination. Users of PLCs include the original programmers of the application programs, as well as plant electricians and maintenance personnel, who are accustomed to relay-type con
22、trolling environments.A rung is an ordered set of PLC instructions drawn on a single line. Instructions on a rung are classified as input instructions (those that monitor the input buffer) and output instructions (those that set the output buffer), and are executed from left to right, sequentially (
23、Please see figure 4). A PLC application program consists of a main program and a set of subroutines, each of which containing an ordered set of rungs。To summarize, the application programmer deals with actual (realtime) clock times, and needs to have precise estimates for program scan times and I/O
24、scan times. For time estimations, the PLC manufacturers supply information such as 4 mseconds for 1000 ladder logic instructions, and 1 mseconds for copying 256 words into an input buffer during the I/O scan. In most applications, the processor scan time is kept below 10 seconds.Thus, database manip
25、ulation instructions also need to have precise time limits available to (or set by) users.2. ArchitectureWe propose a two-level, single-user database system architecture as shown in figure 6. We have omitted from our architecture the external model of the traditional database architecture not becaus
26、e PLCs are not powerful, but because concurrently running application programs using different views create problems in accurately estimating the application program scan times. That is, in a multitasking environment where tasks compete for the resources such as database relations and communication
27、lines, deciding a single top-to bottom execution time of a task in actual time is rather difficult (if at all possible).As far as the hardware computing power is concerned, the present day PLCs are as powerful as personal computers (and, indeed, in some recent products,PLCs are personal computers),
28、and can certainly support multiple industrial terminals and data sharing among the application programs.3. Data Modeling IssuesThe traditional data modeling techniques directly apply to PLC databases. There is no reason why, say, the Entity-Relationship Model Chen 76 of the data in the PLC database
29、cannot be designed. All the well-known advantages of data modeling ToeF 82 directly carry over to the PLC database environment, and will not be elaborated here. As for the conceptual model of our prototype effort, we have chosen the relational model. The PLC environment naturally deals with historic
30、al data, e.g., the last reading of a grinding machine sensor, its value yesterday, etc. Again, there are various historical data modeling approaches SnoA 85 in the literature and, theoretically, any one of them is acceptable.Example. Consider a set of furnaces that produce high-precision airplane pa
31、rts. There are two entity relations, FURNACE and PART, and one time-varying relationship relation PRODUCES as described in figure 7. Please note that PRODUCES relation has tuple timestamping with BEGIN-TIME and END-TIME attributes.4. DBMS IssuesThere are a number of issues that need to be resolved i
32、n a time-constrained, single user DBMS environment. These are(a) Data Archival.(b) Database Backup.(c) Database Integrity enforcement.5. Query Processing IssuesThe conventional database management systems (DBMS) do not have the capability of dynamically meeting the time constraints when the amount o
33、f data is too large to process within a given time quota. Our approach is, for a given time quota, to take an appropriate amount of sample data such that the set of sampled data is guaranteed to be processible by the DBMS within the given.Some basic PLC instructions have also been extended to increa
34、se their functionality.For example, we have extended the examine logic switch instructions, the Examine Input Closed (XIC) and the Examine Input Open (XIO) AB 84, AB 85, to test the logical value of a propositional calculus formula, rather than testing a bit value corresponding to the condition of a
35、 physical I/O. An examine F instruction causes the formula F to be evaluated and the role value is then examined as in the basic examine instructions. In general, the formula F may contain a constant, a variable, a component of a tuple being scanned by the pointer, and fiE) where f is an aggregate f
36、unction and E is a relational algebra expression. The functionality of the PLC Timer and Counter instructions have also been enhanced. Usually conditioned by examine instructions, timers and counters keep track of timed intervals or events; the number of timed intervals or events to be counted is se
37、t in the preset value variables AB 85, AB 84. With the introduction of a time dimension into the database, events and intervals can also be counted using database queries.6 .Query Processing IssuesThe conventional database management systems (DBMS) do not have the capability of dynamically meeting t
38、he time constraints when the amount of data is too large to process within a given time quota. Our approach is, for a given time quota, to take an appropriate amount of sample data such that the set of sampled data is guaranteed to be processible by the DBMS within the given time quota, and, exact t
39、ime-cost formulas can be derived.Clearly, the more stages the query processor goes through, the more overhead is involved in the run-time estimation approach. This implies that, at each stage, as large an amount of time as possible should be allocated to reduce the number of stages. On the other han
40、d, allocating large amounts of time has a higher risk of overspending the time quota and may end up wasting a large amount of time, especially in a hard time constrained environment AbGM 88, StZa 88. The hard time constrained environments denote those environments where overspending the time quota i
41、s strictly not allowed. Therefore, when overspending happens, the query has to be aborted prematurely and the amount of time used in the last stage is considered wasted.7.Other IssuesThe issue of incomplete information in the PLC database is also being investigated.Quite often, the sensors give inco
42、mplete information, usually a range for a reading. On those occasions, the incomplete data is only known to be within some range of values.We represent an incomplete data item as an interval which contains the unknown value.We have finished the implementation of the first version of a PLC database -
43、Liu89 having some of the features summarized in section 3. The system has been developed on SUN workstations using the C language. We are planning to transport it into a PLC, and evaluate its performance.ReferencesAB84 PLC-3 Programmable Controller Programming Manual, Allen-Bradley Co., 1984.AB85 PL
44、C-5/15 Programmable Controller Processor Manual, Allen-Bradley Co., 1985.Chri83 Christodoulakis, S., Estimating Record Selectivities, Information Systems,Vol 8, 1983.HP88 Hewlett-Packard Announcement of the HP RTDBS, Sept. 1988.Klug81 A. Klug, ABE - A Query Language for Constructing Aggregate-by-Exa
45、mple, 1st LBL Workshop on Statistical Database Management, Dec. 1981.Ullm88 J.D Ullman, Principles of Database and Knowledge-Base Systems, Computer Science Press, 1988.SSDB86 Panel on Scientific Databases, Third Int. Workshop on Statistical and SCientific Database Management, 1986.Star87 R.J. Staron
46、, A Toolset to Develop Programmable Controller Systems,unpublished manuscript, Allen-Bradley Co., March 1987.可编程控制器的数据库系统文章摘要在这篇文章中,我们确定一种在科学和工业上有特别应用目的的计算机可编程控制器( PLC )数据库系统的相关问题。例如:在制造环境的工厂里。 我们建议作为数据库系统的PLC的那些单用户,实时可调整的主记忆体。只有关系数据库系统有一个双级结构,具有历史数据建模和操作能力,查询处理技术。区别于阶梯逻辑语言,最常见的PLC语言,融合数据操作语言指令。 我们放
47、入一个单独组成的PLC处理器的扫描时间,处理数据库更新,备份简单算法和数据档案等问题。1. 简介 可编程控制器( PLC )是一个专用计算机,用来实施科学计算系统和工业控制系统。在本文中举一个自动化控制工厂的机器运行的例子。本文是一份立场文章,提出了PLC的数据库系统,并讨论其特征。 这样,我们接触基地的一批基础数据库,因为经常提及其它工作细节而使内容很丰富。 可编程序控制器大多用于制造的环境,因此我们选择了运行的例子。不过,也有的可编程序控制器用在科学应用的信号数据采集和初步数据处理。 因此,我们认为对一些科学应用,可编程数据库,也能够作为本地较大的科学数据库的瞬态部分。现在我们列出有一个直
48、接内置数据库系统的PLC的优点。( 1 )数据建模技术:输入和输出缓冲器是一个对真实世界的活动比较散乱的暂态模型,因此,卡尔建模法是传统数据库建模技术中比较好的方法。( 2)历史数据库:可编程序控制器一段时间内例行处理不同版本的数据。因此,历史数据建模技术以及历史数据操纵技术能够取代专案方式操纵的历史数据的可编程序控制器。( 3 )用户界面友好:当前在市场上买到的该PLC的软件。能有限的展示信息和可变数据信息存储。例如,接触直方图显示功能作为开机/关机史上的一个特定的主记忆体。(4)处理大量数据:由于一个数据库和查询语言的增加 ,PLC能够分析大容量数据。(5)在PLC水平上的数据压缩和压实:
49、当前,由简单系统或是简单处理的的信息,收集的数据由PLC的传送并储存到主机的内存中。由于当前的可编程序控制器不能分析出令人满意的大部分的数据,而只是将数据传输到主机。在一些科学实验和应用中,需要收集到的数据是如此之大。现在还没有PLC的数据库和实时数据库的书面文献报道。然而,就在最近,惠普宣布了1989年获得惠普实时数据库惠普88 所用的内部结构。显然,结构图3的主机通信线路胜于结构。然而,个人电脑可能超载太多数据。现在我们开始讨论可编程数据库的性能。(1)实时数据库:相当短的“实时”一般从微秒到秒,数据的输入缓冲器必须经过扫描。 因此,对查询必须保证其将低于一定的“实时”。有时限的,几乎总是低于5至10秒 。(2)内存数据库:查询响应限制必须的主内存只有数据库。(3)分级数据库:一旦PLC的环境和要求