The hottest factory output monitoring and query sy

2022-07-30
  • Detail

Shanghai Jiatai Plastic Co., Ltd. is a professional company that produces surgical gloves, medical gloves, scientific research gloves and various PVC gloves. Its annual output value is between RMB 50 million and RMB 100million. Its products are basically exported. There are two production workshops and 26 production lines in total in the whole plant. All production lines in the whole plant are monitored in real time by the plant output monitoring and query system. The output data of each production line is stored in real time, and the data in the power down holding area in the PLC is read into the corresponding variables defined by the monitoring system, The data is stored every minute in the standard SQL language (the output data of 26 production lines is stored in the SQLSERVER database every minute, that is, the current output of 26 production lines). You can query the output of any workshop or any production line through date, time, time period, workshop, production line, etc. you can make statistics on the monthly output of workshops and production lines, and after finding the records that meet the conditions, Display the results through reports, and store and print the results according to the specified report format. The following is a brief discussion of relevant technical issues

2 system structure and function

the structure diagram of the factory output monitoring query system is shown in Figure 1

Figure 1 Schematic diagram of output query system

the function of the system is to query the output of any production line (26 production lines in total) of workshop 1 and workshop 2 at any time. The specific requirements are as follows: 1) the output data of each production line can be stored for at least 4 months to query the historical data; 2) It can query the output of any month, day, hour and minute of each production line; 3) It can query the output of any production line at any time; 4) Query results can be displayed in the report in a specific format and printed out at the same time; 5) The output of any month, day, hour and minute of each production line can be displayed in the form of histogram and real-time trend curve on the computer

the query method of the query system can be realized: 1) query by date; 2) Query by time; 3) Query by production line; 4) Query according to any time period; 5) Query by shift (morning, middle and evening shift); 6) Query the output of any workshop or production line in any month; 7) You can use different permutations (1) to (5) for complex queries

3 system design

the design of the system is relatively simple, and the selection and configuration of software and hardware are shown in Table 1

Table 1 system software and hardware configuration

the design of factory output monitoring and query system mainly lies in the design of software system, and the following issues are the key points to be considered

1) there are 26 production lines in the two workshops, 26 records should be generated every minute, and 26 records should be inserted into the database every minute. The system works 24 hours a day without stopping, so the data volume of a day is 37440 records. The monthly data volume is records. If you want to store for 4 months, the data volume is records. The amount of data is quite large. The data storage of hard disk is close to g. many flight researchers have systematically studied the impact of different heat treatment systems on the microstructure and performance of alloys. After the equipment, ships, vehicles and equipment are used, not only will the system resources be seriously occupied during query, but also ordinary databases such as access tables are unable to manage such a huge data system. When access manages such huge data, the system will not only cause instability, but also unpredictable situations. Therefore, you can only find databases that can manage large data systems, so you can choose sqlserver or oracle

2) the configuration software (Kingview) supports basic operations such as data insertion, selection and deletion for the standard database, and supports the standard SQL language. Using the SQL function provided by the configuration software flexibly, the monitoring system can perform various simple and complex operations on the database through ODBC (open data source) and standard SQL language

3) even if a large database, SQL server or Oracle, is used, as the daily data volume is up to 37440 records, if all the records of one month or even four months are written into the same table in the same database, all the tables with a large amount of data will collapse, that is, the database can be managed, and the query speed can be expected to ensure the stable operation of closed-loop control, which will be very slow. The idea to solve the problem is to take the date of the system as the name of the current day table. When the system time is 00:00:00, create a new table, and create different tables through sqlcreatetable (deviceid, "tablename", "templatename") function, because the configuration software supports string function

4) the query criteria are complex. In order to complete such a complex query, the active control is used, because the configuration software supports third-party controls, lists all conditions for permutation and combination, and takes every situation into account. Then, the program is used to convert the selection condition into the working condition of sqlselect() function. Because the process requires that the output of any production line can be queried at any time, in order to realize this function, you can create a new site and site variables ( this site cxhour, this site cxminute, this site cxhour1, finally, people in the industry say this site cxminute1). When querying by time period, first use the time entered by the previous two variables as a condition to query, and assign the data of the queried records to the intermediate variables customized in the process. Then, the time entered in the next two variables is used as a condition to query, and the query results are also assigned to the user-defined intermediate variables. Calculate the difference between the two query results, and then add the date, time and workshop production line output to the table through the report configuration

5) query of monthly output. It is necessary to determine the number of days in the entered month, and then query from the first day to the last day of the month. The query time is the output of each production line at 23:59 of each day. Then, the queried data is accumulated until the last day of the month. The specific program implementation is to fill the data into the

Copyright © 2011 JIN SHI