Summary of the invention
The present invention is intended at least one of solve the problems of the technologies described above.
For this reason, the object of the invention is to propose a kind of safe, stable, communication module of CMP integrated control system reliably and easily, this control system can realize communication and the information interaction between main industrial computer and the next unit and secondary industrial computer by communication module, for each technique unit under the next unit of real time access and secondary industrial computer and be integrated unit, complete each technique unit and be integrated the unified management of unit.
To achieve these goals, embodiments of the invention provide a kind of communication module of CMP integrated control system, for realizing the communication of CMP integrated control system inside, comprise: OPC access submodule and TCP/IP access submodule, and two submodule concurrent workings, wherein, described CMP integrated control system comprises: the next unit, secondary industrial computer and main industrial computer, wherein, described the next unit (each PLC) is corresponding connected one by one with a plurality of technique units respectively, for controlling the operation of described a plurality of technique units, and monitor running status and the procedure parameter of described a plurality of technique units, described secondary industrial computer be integrated unit and be connected, described in controlling, be integrated the operation of unit, and described in monitoring, be integrated running status and the procedure parameter of unit, described main industrial computer obtains status information and the procedure parameter of described a plurality of technique units by described OPC access submodule from described the next unit, and send and control steering order, technical recipe and the technological parameter that described a plurality of technique unit moves to described the next unit, and to described secondary industrial computer sending controling instruction, so that described secondary industrial computer is controlled, be integrated the corresponding action of unit execution by described TCP/IP access submodule, and receive the feedback information of described secondary industrial computer.
In addition, the communication module of CMP integrated control system according to the above embodiment of the present invention can also have following additional technical characterictic:
In some instances, described OPC access submodule further comprises: opc server, described opc server is for configuring described the next unit information to realize the communication of described opc server and described the next unit, and wherein, described the next unit packets of information is drawn together title and the address of each slave computer; OPC client, described OPC client for and described opc server communication, be responsible for to connect and disconnect described opc server, and writing data or from described opc server read data to described opc server.
In some instances, described OPC client is accessed described opc server by realizing OPC self defined interface.
In some instances, described OPC client is also for creating described target opc server and OPC group objects, and adds according to this OPC item object, and according to described OPC item, described OPC client is obtained the value of named variable by described opc server.
In some instances, described OPC client is also for remove described OPC item object and described OPC group objects when exiting, and deletes described target opc server, free system resources, with disconnect with described target opc server between be connected.
In some instances, described OPC client is write data in synchronous or asynchronous mode to described opc server, the mode that described OPC client is passed through to subscribe to, from described opc server read data, transmits and receive data to the next unit thereby realize main industrial computer.
In some instances, described OPC client is write data in synchronous or asynchronous mode to described opc server, specifically comprises: described OPC client is carried out synchronous or asynchronous write data by Boolean type data WriteMode, floating type data WriteMode or integer data WriteMode to described opc server.
In some instances, described TCP/IP access submodule adopts ripe TCP/IP communication modes, using described main industrial computer and secondary industrial computer as communication two party, the IP address that main industrial computer utilization is predetermined and port numbers access secondary industrial computer, and if described main industrial computer while not receiving the feedback of described secondary industrial computer in Preset Time, the Communications failure of judgement and described secondary industrial computer, and eject warning information window with prompting technologist.
In some instances, the steering order that described main industrial computer sends to described secondary industrial computer by described TCP/IP access submodule comprises: set up or disconnect selection and reading command, load preparation and unloading piece END instruction and whole state parameter reading command of instruction, technical recipe, described TCP/IP access submodule sends the interface function that utilizes described secondary industrial computer to provide the packet of each instruction.
In some instances, described TCP/IP access submodule adopts connection-oriented communication modes.
According to the CMP integrated control system of the embodiment of the present invention, tool has the following advantages:
The invention has the advantages that:
(1) efficiently, real-time is good, network resource consumption is low.
(2) be convenient to safeguard, when lower floor's control system (the next unit and secondary industrial computer) needs maintenance or hardware device to change, if address and the original function of each variable of lower floor remain unchanged, just can not affect the normal use of upper strata control system (main industrial computer).
(3) good extensibility, native system is expanded new unit module as need, only need according to new unit module need to select suitable communication modes, communication module completes appending of corresponding configuration or variable, without changing original system.
(4) safety, stable, reliable, native system adopts OCP technology and TCP/IP communications protocol to realize the communication between main industrial computer and the next unit and secondary industrial computer, and when communication abnormality, give the alarm and remind technologist, therefore, native system provides good assurance for normal data interaction.
Additional aspect of the present invention and advantage in the following description part provide, and part will become obviously from the following description, or recognize by practice of the present invention.
Embodiment
Describe embodiments of the invention below in detail, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has the element of identical or similar functions from start to finish.Below by the embodiment being described with reference to the drawings, be exemplary, only for explaining the present invention, and can not be interpreted as limitation of the present invention.
In description of the invention, it will be appreciated that, term " " center ", " longitudinally ", " laterally ", " on ", D score, " front ", " afterwards ", " left side ", " right side ", " vertically ", " level ", " top ", " end ", " interior ", orientation or the position relationship of indications such as " outward " are based on orientation shown in the drawings or position relationship, only the present invention for convenience of description and simplified characterization, rather than device or the element of indication or hint indication must have specific orientation, with specific orientation structure and operation, therefore can not be interpreted as limitation of the present invention.In addition, term " first ", " second " be only for describing object, and can not be interpreted as indication or hint relative importance.
In description of the invention, it should be noted that, unless otherwise clearly defined and limited, term " installation ", " being connected ", " connection " should be interpreted broadly, and for example, can be to be fixedly connected with, and can be also to removably connect, or connect integratedly; Can be mechanical connection, can be to be also electrically connected to; Can be to be directly connected, also can indirectly be connected by intermediary, can be the connection of two element internals.For the ordinary skill in the art, can concrete condition understand above-mentioned term concrete meaning in the present invention.
Below in conjunction with accompanying drawing, describe according to the communication module of the CMP integrated control system of the embodiment of the present invention.
Fig. 1 is the theory diagram of CMP integrated control system according to an embodiment of the invention.As shown in Figure 1, CMP integrated control system 100 according to an embodiment of the invention, comprising: the next unit 110, main industrial computer 130 and secondary industrial computer 140.
Wherein, the next unit 110 respectively with a plurality of technique units corresponding be connected one by one, for controlling the operation of a plurality of technique units, and monitor running status and the procedure parameter of a plurality of technique units.Secondary industrial computer 140 be integrated unit and be connected, for controlling the operation that is integrated unit, and described in monitoring, be integrated running status and the procedure parameter of unit;
The communication module 120 of the CMP integrated control system of the embodiment of the present invention is for realizing the communication between main industrial computer 130 and the next unit 110 and secondary industrial computer 140, and wherein, communication module 120 further comprises OPC access submodule and TCP/IP access submodule.
Main industrial computer 130 is accessed submodule by OPC and from the next unit 110, is obtained status information and the procedure parameter of a plurality of technique units, and send to the next unit 110 steering order, technical recipe and the technological parameter of controlling a plurality of technique unit operations, and by TCP/IP, access submodule to secondary industrial computer 140 sending controling instructions and carry out corresponding action so that secondary industrial computer 140 is controlled the coupled unit that is integrated, and receive the feedback information of secondary industrial computer 140.
As a concrete example, shown in Fig. 1 and Fig. 2, above-mentioned the next unit 110 comprises a plurality of slave computers, in the example shown in Fig. 2, the next unit 110 for example comprises two slave computers, i.e. programmable logic controller (PLC) PLC1 in Fig. 2 and programmable logic controller (PLC) PLC2.A plurality of technique units include but not limited to technique unit 1 and technique unit 2, and PLC1 is connected with technique unit 1, and PLC2 is connected with technique unit 2.PLC1 and PLC2 control respectively the operation of technique unit 1 and technique unit 2, and monitor their running status and procedure parameter.
In other words, in Fig. 2, the main body of the CMP integrated control system 100 of the embodiment of the present invention adopts Two level control module.Wherein, lower floor's control system (being the next unit 110) can be selected a plurality of PLC(programmable logic controller (PLC)s), and each PLC directly controls respectively affiliated technique unit (such as each polishing unit etc.), upper strata control system (main industrial computer 130) can be selected IPC(industrial computer), and monitor each technique unit and manage the operation of whole system by each PLC.And by Industrial Ethernet, realize physical connection between upper strata control system and lower floor's control system.For being integrated unit, for example, because it has had independent controller (being secondary industrial computer 140, is IPC), so keeping on the basis of existing control system structure, the IPC that this can be inherited to unit is as secondary IPC.Utilize equally Industrial Ethernet to realize the physical connection of main industrial computer 130 and secondary industrial computer 140.
In one embodiment of the invention, above-mentioned OPC access submodule further comprises: opc server and OPC client.Wherein, opc server is used for configuring the next unit information to realize the communication of opc server and the next unit 110, and the next unit 110 is monitored and managed, and wherein, the next unit packets of information is drawn together title and the address of each slave computer.OPC client and opc server communication, for connecting in use and disconnecting opc server, and write data or from opc server reading out data to opc server.
Particularly, OPC access modules is the main means of communication of the CMP integrated control system 100 of the embodiment of the present invention, and it mainly comprises opc server and OPC client.As a concrete example, as shown in Figure 3, opc server is responsible for configuring each PLC information of lower floor's control system (title and the address that mainly comprise PLC), and realization is connected with lower floor's control system.The major function of OPC client comprises: connect and disconnect opc server and read and write each OPC data item.Wherein, lower floor's control system is set up a plurality of memory blocks (DB) and is responsible for depositing total data (comprising state variable and technological parameter etc.) temporarily.In actual production process, OPC client completes data in each memory block of lower floor read and write by initiatively accessing opc server operates.Upper strata control system utilizes this OPC access modules can read in real time and show state variable and the technological parameter of unit module, downloads technical recipe, and sends every steering order etc., and then realize the unified management of whole CMP integrated control system.
Further, in another example, OPC client is by OPC self defined interface access opc server.More specifically, OPC client creates target opc server and OPC group objects, and adds according to this OPC item object, and according to each OPC item object, OPC client is obtained the value of named variable from opc server.In addition, OPC client is also for remove OPC item object and OPC group objects when exiting, and deletes target opc server, free system resources, with disconnect with target opc server between be connected.
In other words, OPC technology is DNA framework and the COM technology based on Microsoft, according to expansibility, designs.OPC specification description opc server com object and the interface thereof that need to realize, CLIENT PROGRAM is communicated by letter with opc server by interface, has indirectly realized the access to field data.At present, OPC has two sockets: OPC self defined interface and OPC automation interface.Self defined interface efficiency is high, and by this interface, client can bring into play the optimum performance of opc server, is applicable to adopting client's (embodiment of the present invention preferably adopts C++ programming language) of C Plus Plus.Therefore, embodiments of the invention preferably adopt OPC self defined interface.
In addition, from high level, opc server is comprised of three objects: server object, group objects and an object (shown in Figure 3).
Wherein, target opc server is the main object of opc server program.In the OPC of OPC access modules client, first create this object, recycling target opc server creates OPC group, and the pointer of group objects is passed to OPC client, by OPC client direct control group objects.Further, OPC client is added the data item of needs access in same group to as OPC item.Wherein, when OPC client is carried out data access to opc server, Shi Yizuwei unit carries out, and CLIENT PROGRAM is carried out unified read-write operation to the OPC item in group, has improved the efficiency of data communication.OPC item represents and being connected of data in opc server.It is pointed out that OPC item is not actual data source, only mean and being connected of data source.Therefore,, while adding OPC item in OPC group, each address of strict difinition, guarantees the correctness that data read.
In another embodiment of the present invention, OPC client is write data in synchronous or asynchronous mode to opc server, or the mode that OPC client is passed through to subscribe to is from opc server reading out data.Wherein, OPC client is write data in synchronous or asynchronous mode to opc server, specifically comprises: OPC client is write data by boolean (bool) type data WriteMode, floating-point (float) type data WriteMode or whole (int) type data WriteMode to opc server.
In other words, between OPC client and opc server, comprise alternately two aspects: for OPC client, from opc server, writing data on the one hand, is that OPC client is from opc server reading out data on the other hand.In OPC standard, opc server has read three kinds of modes with the data of OPC client: synchronize, asynchronous and subscribe to.In an embodiment of the present invention, OPC client is write synchronous write or asynchronous write for data acquisition to opc server.For reading of data, the unified subscription formula that adopts.
In a concrete example, according to different data types, embodiments of the invention can be realized respectively synchronous (or asynchronous) write method of various data types, so that in program development process, the access mode of data is more clear and be easy to check.The system of the embodiment of the present invention has mainly realized three kinds of modes that synchronous (or asynchronous) write, comprise bool type data write method SyncWriteBool (int ItemNo, bool ItemValue)/AsyncWriteBool (int ItemNo, bool ItemValue), float type data write method SyncWriteReal (int ItemNo, double ItemValue)/AsyncWriteReal (int ItemNo, double ItemValue) and int type data write method SyncWriteInt (int ItemNo, int ItemValue)/AsyncWriteInt (int ItemNo, int ItemValue).Wherein, first parameter represent by assignment to as if group in which, second parameter value of composing of indicating.For array variable, i.e. continuation address variable of the same type, can be by SyncWrite (int ItemNo, void*ItemValue, type ValueType, int ValueNo)/AsyncWrite (int ItemNo, void*ItemValue, type ValueType, int ValueNo) realize and to write function, wherein parameter ItemNo represent in group which, the ItemValue value of composing of indicating, ValueType represents data type, and ValueNo represents variable number.
Take synchronous write method as example, in function body, first according to data type, access mode is divided, then set gradually every property value (comprising data type and value etc.) according to parameter content.If the use method of synchronization, need call the function Write of IOPCSyncIO.If use asynchronous system, need call the function Write of IOPCAsyncIO2.Below the main code example of synchronous write method:
void?OpcClient::SyncWrite(int?ItemNo,void*ItemValue,type?ValueType,int?ValueNo)
And for read operation, definition class COPCDataCallback(derived class CComObjectRoot and class IOPCDataCallback), the read work of all variablees all realizes in its member function OnDataChange.OnDataChange is for the treatment of the notice of OPC group objects, and this notice is automatically carried out by opc server when data change.In the realization of the formula of subscription data access mode, first according to the data type of each OPC item, reading manner is segmented, then the value of each is assigned to successively to the variable of appointment.Because embodiments of the invention adopt subscription formula data reading manner, unify all parametric variables of reading system, so define specially class OpcPublic, be responsible for temporary every process variable.The numbering of such member variable by OPC item finds the item of self correspondence, thereby realizes reading of data.In engineering, other classes all can be called class OpcPublic, and read each member variable in class, and then can process accordingly required data.Because each member variable of class OpcPublic is constantly updated, so guaranteed that the required data of master routine are always up-to-date.
More specifically, for example, write operation for the significant data in the CMP integrated control system of the embodiment of the present invention (technological parameter and system configuration information), this system adopts synchronous mode OPC data WriteMode, to guarantee that each parameter correctly arranges, and can not be missed.For the write operation of general variable, this system is suitably selected asynchronous system OPC data WriteMode, to reduce the consumption of CPU and Internet resources, guarantees the real-time of system.Than the method for synchronization and asynchronous system, subscription formula data acquisition modes can reduce the number of times of OPC client-access server effectively, the consumption of CPU and Internet resources is dropped to minimum, can carry out a large amount of data, and farthest avoid the situation of network congestion simultaneously.
In a concrete example, the OPC access submodule in communication module 120 and TCP/IP access submodule all operate in the control system of upper strata.And the OPC access opc server of submodule and the reciprocal process of OPC client are mainly divided into following step:
1) create also connection server object.
Particularly, initialization COM storehouse, utilizes CLSIDFromProgID function to obtain CLSID.CLSID based on obtaining, OPC client creates an OPCServer object, and obtains a pointer variable IOPCServer who points to server object.
2) interpolation group and item.
As the main interface of opc server, IOPCServer interface is responsible for creating OPC group, and returns to other interface pointer, and assurance OPC client can be called the interface function of opc server.OPC client can be called IOPCItemMgt interface by the OPC group objects creating, and adds the OPC item object of some.
3) read-write operation of data.
OPC client is carried out the value of each Item object in synchronous or asynchronous write OPCGroup by calling the member function Write of IOPCSyncIO or IOPCAsyncIO2.And for the reading of data, the unified subscription formula data acquisition modes that adopts of OPC client.
4) disconnect and being connected of server.
OPC client discharges all interface pointer and deletes successively OPC item, OPC group and target opc server when exiting.
In a concrete example, shown in Fig. 2, be integrated unit by secondary industrial computer 140(IPC independently) control, there is independently local control system.And physical connection based on Industrial Ethernet, upper strata control system (i.e. main industrial computer 130) and be integrated and access submodule by TCP/IP between unit control system (being secondary industrial computer 140) and realize mutual communication with TCP/IP communication modes.More specifically, in one embodiment of the invention, TCP/IP access submodule adopts connection-oriented communication modes.
In other words, TCP/IP is current application communications protocol the most widely, is widely used in various PC network.ICP/IP protocol has realized two kinds of communication modes: connectionless communications protocol (UDP) and connection-oriented communications protocol (TCP).For connectionless communications protocol, the resource that UDP takies is less, but does not need take over party to confirm during communication, belongs to insecure transmission, may go out packet loss phenomenon.TCP mode is carried out before exchanges data, must set up a paths with communication side, has so both determined the route between communication two party, has guaranteed that again communication two party is movable, can respond each other, and the data of delivering is errorless.Accurate in order to guarantee communication, the embodiment of the present invention preferably adopts connection-oriented communication modes.
Particularly, in one embodiment of the invention, main industrial computer 130 is accessed submodule to secondary industrial computer 140 sending controling instructions by TCP/IP and is carried out corresponding action so that secondary industrial computer 140 is controlled the coupled unit that is integrated, and feed back to main industrial computer 130, whether main industrial computer 130 is normal according to the communication between this feedback judgement and secondary industrial computer 140.And in another embodiment of the present invention, main industrial computer 130 also when not receiving the feedback of the main industrial computer 140 of secondary in Preset Time, is judged the Communications failure with secondary industrial computer 140, and is ejected warning information window with prompting technologist.Wherein, above-mentioned steering order comprises: set up or disconnect selection and reading command, load preparation and the unloading piece END instruction of instruction, technical recipe and read whole state parameter instructions.Preset Time presets according to real needs.
As a concrete example, i.e. TCP/IP access submodule is using upper strata control system (main industrial computer 130) and be integrated unit control system (secondary industrial computer 140) as communication two party.Upper strata control system utilizes IP address and the port numbers (IP address and port numbers address are definition in advance) that technologist inputs in main operation interface to initiate communication and find to be integrated unit control system, treat the other side's normal response, can set up stable both sides' communication and connect.Afterwards, the instruction pre-defining based on both sides, upper strata control system is sent the packet of regulation according to technologist's operational requirements, be integrated unit control system receives after packet at every turn, immediately instruction is wherein resolved and (for the setting of parameter, should be assigned to the variable that is integrated unit control system appointment; For instructions, can in the groove function of program, call and be integrated the corresponding interface function that apparatus control system provides), and then carry out and move accordingly or return the parameter value needing, idiographic flow is as shown in Figure 4.Be that said process comprises the following steps:
Step S401: the IP address that upper strata control system utilization sets in advance and port numbers are initiated communication request to being integrated unit control system.
Step S402: be integrated unit control system and make and set up communication with upper strata control system after normal response and be connected according to communication request.
Step S403: upper strata control system is sent the packet of regulation according to technologist's operation.
Step S404: be integrated unit control system and receive packet, obtain corresponding steering order after it is resolved, and control is integrated the parameter that appointment was moved or returned in unit execution accordingly accordingly, to feed back to upper strata control system.
Further, the parameters that need to read due to upper strata control system comprises numerous types of data, so structure variable of definable, all parameters that need to feed back to upper strata control system are all included in this structure variable, upper strata control system is the variable in choice structure body as required, and it is carried out to follow-up processing.By this thinking, embodiments of the invention have been unified data reading manner, and have facilitated the exploitation of program.In addition, for each instruction, be integrated unit control system and all should give to reply accordingly, guarantee that control system correctly receives.If upper strata control system (Preset Time) not in official hour receives arbitrarily, reply, assert Communications failure, and show corresponding warning information on Control System Software interface, inform in time technologist.And according to the needs of this CMP integrated control system, the packet of transmission mainly comprises following several respects command content: 1) set up or disconnect; 2) selection of technical recipe and reading; 3) load is prepared and unloading piece such as finishes at the action; 4) read whole state parameters.
According to the CMP integrated control system of the embodiment of the present invention, tool has the following advantages:
The invention has the advantages that:
(1) efficiently, real-time is good, network resource consumption is low.
(2) be convenient to safeguard, when lower floor's control system (the next unit and secondary industrial computer) needs maintenance or hardware device to change, if address and the original function of each variable of lower floor remain unchanged, just can not affect the normal use of upper strata control system (main industrial computer).
(3) good extensibility, native system is expanded new unit module as need, only need according to new unit module need to select suitable communication modes, communication module completes appending of corresponding configuration and variable, without changing original system.
(4) safety, stable, reliable, native system adopts OCP technology and TCP/IP communications protocol to realize the communication between main industrial computer and the next unit and secondary industrial computer, and when communication abnormality, give the alarm and remind technologist, therefore, native system provides good assurance for normal data interaction.
In the description of this instructions, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or example in conjunction with specific features, structure, material or the feature of this embodiment or example description.In this manual, the schematic statement of above-mentioned term is not necessarily referred to identical embodiment or example.And the specific features of description, structure, material or feature can be with suitable mode combinations in any one or more embodiment or example.
Although illustrated and described embodiments of the invention, those having ordinary skill in the art will appreciate that: in the situation that not departing from principle of the present invention and aim, can carry out multiple variation, modification, replacement and modification to these embodiment, scope of the present invention is by claim and be equal to and limit.