Development and application of PLC upper computer

  • Detail

Development and application of PLC upper computer monitoring software of vulcanizing machine

with the continuous improvement of the automatic control level of vulcanizing machine, the temperature and pressure data acquisition and recording methods of vulcanizing machine have experienced disc recorder, dot recorder, intelligent paperless recorder and even the more advanced upper computer monitoring system at present. The upper computer monitoring system has friendly interface, safe and reliable control, high precision and large amount of data storage, which has been more and more favored by users. The author uses the resistance touch tablet computer as the upper computer, and sends the field data to the upper computer after being collected by sensors and processed by PLC to form a monitoring system

1. Composition of monitoring system

the whole monitoring system is composed of a/D module, D/a module, CPU, sensor, electrical converter and tablet computer, as shown in Figure 1

the upper computer can analyze, save, comprehensively process, print, alarm, graphic display, man-machine dialogue, and control PLC through data transmission

2. Design of monitoring software

2.1 form design

in the process of software programming, man-machine interface (mm,) is very important, because it directly exchanges information with the operator. A friendly man-machine interface requires that it can truly reproduce the state of the control equipment and accurately collect the data of the required parameters, which mainly depends on the control combination of VB6.0 and the original code. The whole man-machine interface includes vulcanization state screen (main screen), real-time curve screen, data viewing screen, historical curve screen, process screen, alarm screen, password screen and switch state screen, and each screen can be switched with each other. Of course, it can also have different man-machine interfaces according to production habits, which has good flexibility

the main screen is shown in Figure 2. It collects the temperature and pressure signal of the vulcanizer in real time and saves it in the database with the name of date. It displays the vulcanization time and step sequence parameter data of each pot of tires, and the output, capsule count, and the current information of the machine are also clear at a glance. The bar graph control can dynamically indicate the vulcanization process of each tire, and has a percentage to remind the operator. If a valve is opened, the color of the corresponding valve name in the main screen changes, and there will be an animation of liquid flow in the pipeline, which vividly reproduces the change of the valve state. This can be achieved by using API functions in the picture control. The reset menu can reset the left and right counts and output respectively. Click the communication button to communicate with PLC through serial port for data exchange. The data acquisition frequency can be set in timer control. The main screen is the window of the monitoring system. Basically, all the data that operators need to know are concentrated here. The friendliness of the screen and the integrity of its functions directly affect the success of the human-machine interface

the real-time curve screen tracks the temperature and pressure parameters of the vulcanizer in real time, which can be divided into disc type and linear type. The disc type respects the habit of the original disc recorder, records the value of each time in real time in a unit of one day, and draws an arc between the real-time data and the previous time data, so as to accurately display the change of the value. The linear type is displayed in one hour (generally, the tire vulcanization time is within one hour). If one hour of data is collected, the real-time curve will drift from right to left with the acquisition frequency. At this time, the curve corresponding to the current value will be displayed at the right end of the picture control. This dynamic drift effect can be realized by the windowsAPI function. These two curve methods have their own advantages. The former can intuitively understand the curve situation of all tires of the day, but the upper computer display shows the data of the day, and the graph appears small and the resolution is not high. It has high definition, but it can only display the mapping line for the current period of time. If you need a longer curve, you have to check it from the historical screen. Generally speaking, both give consideration to application and complement each other

the data collected every day is stored in the database of that day. To view the curve of that day, just open the database of that day to draw the historical curve of that day

process screen: all parameters that need to be modified are concentrated in the process screen, and the step sequence, step time, valve status, PID parameters, delay setting, vulcanization specification and machine number can be modified. The screen has many functions and complex operations, but it mainly focuses on the database. Establish a database to connect with treeview control. The database includes various process numbers, and each process number is a table. Click the table name, and the contents of the table are displayed in the DataGrid control. You can modify the contents of the table through the keyboard

other pictures will not be detailed

2.2 communication between upper computer and PLC

in the upper computer link communication, the upper computer mostly communicates with PLC in the main state. Commands are generally sent from the upper computer to PLC, and any data can be sent from PLC to the upper computer. The communication between the two is connected through the serial port of the upper computer, which is mostly made by mixing some dry mortar and some materials with thermal insulation characteristics, and follows the RS-232 protocol. The command format is:

the response code is: the conference site will be divided into three sub venues

when writing the communication program with v86.0, the communication control (MSComm) should be used. After the communication control is transferred in, it is also necessary to compile the communication code, such as the positive data area dmoooondm0003 of internal temperature, internal pressure, external temperature and external pressure memory core collected by PLC, and the internal temperature, internal pressure, external temperature and external pressure of the main screen are displayed in label1 (0) ~ label1 (3) respectively. Then the communication code established under VB6.0 is as follows:

privatesubtimer1 timer()

mport=1 whether the coml port

F is overshoot or too large@ 11. Whether the belt and tension are just right; Ttings=9600, e, 7,2 set the communication conditions

rtopen=true open the serial port

r$=@00rd read the content of plcdm0000-dm0003

rd$=r$+fcs (r$)


tput=rd$+chr$(13) send the command


dummy=doeverts (1) this is because polymers are composed of long-chain molecules

buffercount =27

instring$=put accept data

label1 (0) caption=MID$(instring$,8,4)

Label1(1). caption=MID$(instring$,12,4)

Label1(2). caption=MID$(instring$,16,4)

Label1(3). Caption=mid$(instring$, 20,4)



data is sent in frames. FCS is calculated every time a frame is accepted and the results are compared with FCS contained in the frame, so that it can check the data errors in the frame. FCS is 8-bit data converted into 2 ASC Ⅱ characters, which is the result of XOR operation on the data from the beginning of the frame to the end of the frame body. The FCS function codes under VB6.0 are as follows:

functionfcs (o$)

dimb%, I%, II%, ff$


II% =len (o$)

fori%=ito II%

b%=b%=orasc (mid (o$, i%),


1flenc(ff$) =1 then

FF $= 0 + FF $


FCS = FF $+ *


3 Conclusion

this example has been successfully applied to the automatic control system of vulcanizer, and it is in good condition from the actual operation. Of course, it needs to be constantly improved to make it richer and more powerful

Copyright © 2011 JIN SHI