Summary of the invention
For overcoming above-mentioned software maintenance workload greatly and software defective poor for applicability, a kind of industrial data acquisition system that adopts rear BOUND communication plug-in unit of the present invention, adopt " rear binding " method, behind software translating, be in operation and carry out corresponding communication plug-in unit and call, the communication software plug-in unit can be developed after systemic software development is finished, improved the dynamically adapting ability of system, collection has larger application reference to be worth for industrial data.
For realizing goal of the invention, the technical solution used in the present invention: a kind of industrial data acquisition system of rear BOUND communication plug-in unit that adopts is comprised of sensor, instrument, computer communication interface and industrial computer; The output terminal of sensor connects instrument, and instrument is connected with industrial computer by the computer communication interface.
Sensor, instrument are more than one group or one group.
Instrument is connected with the computer communication interface by serial ports, Ethernet or CAN bus.
Be provided with communication plug-in unit and data acquisition Framework in the industrial computer; Comprised the InventorySocketReceHandle event interface that is used for to the homophony module notice related communication event of data acquisition Framework in the communication plug-in unit, be contained among the parameter s trResponseName and strXmlData of two character string types for the respond packet of these events; Parameter s trResponseName has described two types data in the communication event: a kind of is the real-time device data that gather the current reception of Framework for notification data; Another is the Real Time Monitoring data that gather the current reception of Framework for notification data, parameter s trXmlData is used for depositing the current data content that receives, the data type of describing in the data content of depositing in this parameter and the strResponseName parameter is corresponding
Defined the Data Analysis form of real-time device data and Real Time Monitoring data in the data acquisition Framework, different data type correspondences different Data Analysis forms, simultaneously, the data acquisition Framework has also comprised different Communications Control Interfaces, is used for the communications transaction of management different agreement;
When this interface receives from the communication response event in the communication plug-in unit, the communication plug-in unit automatic analysis is included in strResponseName parameter and the strXmlData parameter in the communication data stream, finds out the data of transmitting in the current communication process according to the content of strResponseName parameter and belongs to real-time device data or Real Time Monitoring data; Then according to the Data Analysis form that defines in the content of strXmlData parameter and the data acquisition Framework the effective contents extraction in the data out, finish from communication data stream and gather useful this process of industrial data.
The different communication control interface that the data acquisition Framework comprises mainly contains:
DisplayName interface: be used for the title of obtaining communication agreement, realize the return character string format by unique name of obtaining plug-in unit.
GetCommPara interface: be used for obtaining the messaging parameter of agreement, the return character string format.
SetCommPara interface: be used for arranging the communicating protocol parameter on the corresponding hardware device.
StartModual interface: be used for log-on data and gather Framework 5 corresponding communication protocol processing modules, also started the data acquisition of system simultaneously.
StopModual interface: be used for stopping the work of communication module.
OnInventorySocketReceHandler interface: be used for receiving the communication response event from communication plug-in unit 4.
Communication protocol in the data acquisition Framework mainly contains serial port protocol, CAN bus protocol and ICP/IP protocol.
Described sensor, instrument, computer communication interface and industrial computer adopt commercially available common components.
Beneficial effect of the present invention: the present invention adopts " rear binding " method, behind software translating, be in operation and carry out corresponding communication plug-in unit and call, the communication software plug-in unit can be developed after systemic software development is finished, improved the dynamically adapting ability of system, collection has larger application reference to be worth for industrial data.
Specific implementation method
Below in conjunction with accompanying drawing invention is described further, understands to make things convenient for the technician.
As shown in Figure 1: a kind of industrial data acquisition system of rear BOUND communication plug-in unit that adopts is comprised of sensor 1, instrument 2, computer communication interface 3 and industrial computer 6.The output terminal of sensor 1 connects instrument 2, and instrument 2 is connected withindustrial computer 6 by computer communication interface 3.
Sensor 1, instrument 2 are more than one group or one group.
Instrument 2 is connected with computer communication interface 3 by serial ports, Ethernet or CAN bus.
Be provided with communication plug-in unit 4 and data acquisition Framework 5 in theindustrial computer 6.
Comprised the InventorySocketReceHandle event interface in the communication plug-in unit 4, this interface is used for the relevant communication event of homophony module notice to data acquisition Framework 5, is contained among the parameter s trResponseName and strXmlData of two character string types for the respond packet of these events.
Parameter s trResponseName has described two types data common in the communication event: a kind of is the real-time device data, and it is real-time device data that strResponseName is used for the data that notification data gathers Framework 5 current receptions; Another is the Real Time Monitoring data, and the data that strResponseName is used for the 5 current receptions of notification data collection Framework are Real Time Monitoring data.
Parameter s trXmlData is used for depositing the current data content that receives, and the data type of describing in the data content of depositing in this parameter and the strResponseName parameter is corresponding.
Defined the Data Analysis form of real-time device data and Real Time Monitoring data in the data acquisition Framework 5, different data type correspondences different Data Analysis forms.In addition, data acquisition Framework 5 has also comprised different Communications Control Interfaces, is used for the communications transaction of management different agreement, and in the present invention, these communication modes mainly contain serial port protocol, CAN bus protocol and Ethernet protocol.Communications Control Interface in data acquisition Framework 5 mainly contains:
DisplayName interface: be used for the title of obtaining communication agreement, realize the return character string format by unique name of obtaining plug-in unit.
GetCommPara interface: be used for obtaining the messaging parameter of agreement, the return character string format.
SetCommPara interface: be used for arranging the communicating protocol parameter on theindustrial computer 6 interior corresponding hardware devices.
StartModual interface: be used for log-on data and gather Framework 5 corresponding communication protocol processing modules, also started the data acquisition of system simultaneously.
StopModual interface: be used for stopping the work of communication module.
OnInventorySocketReceHandler event interface: be used for receiving the communication response event from communication plug-in unit 4.
When this interface received from the communication response event in the communication plug-in unit 4, its automatic analysis was included in strResponseName parameter and the strXmlData parameter in the communication data stream.Find out the data of transmitting in the current communication process according to the content of strResponseName parameter and belong to real-time device data or Real Time Monitoring data; Then according to the Data Analysis form that defines in the content of strXmlData parameter and the data acquisition Framework 5 the effective contents extraction in the communication data stream out, finish from communication data stream and gather useful this process of industrial data.
As shown in Figure 2: a kind of course of work that adopts the industrial data acquisition system of rear BOUND communication plug-in unit:
1) development and Design data acquisition Framework 5 defines framework interface, carries out the compiling link program, working procedure;
2) be connected to computer communication interface 3 for particular sensor 1, instrument 2, for its data protocol, exploitation corresponding software plug-in unit, realize the InventorySocketReceHandle event interface, the deal with data agreement is carried out the compiling link program, is developed as plug-in card program, this program be put into data acquisition Framework 5 same paths under, preserve plug-in card program with plus as the file suffixes name;
3) definition data acquisition Framework 5 need to call the plug-in unit name in the configuration file of data acquisition Framework 5, data acquisition Framework 5 is dynamically searched the plug-in software as the file suffixes name with plus under its operation catalogue, by DisplayName interface obtaining communication protocol name, obtain the messaging parameter of agreement by the GetCommPara interface, then utilize the SetCommPara interface that communicating protocol parameter on theindustrial computer 6 interior corresponding hardware devices is set.
4) after communications setting is finished, call the StartModual interface and start corresponding communication event processing module on the communication plug 4, obtain the data (these data are transmitted in the mode of communication data stream after entering industrial computer 6) that enter the spot sensor 1 in theindustrial computer 6 via instrument 2, computer communication interface 3 by the InventorySocketReceHandle event interface at last, when not needing data, stop communication plug 4 communication event processing modules by calling the StopModual interface.
Embodiment 1: when communication protocol is serial communication, data acquisition Framework 5 is dynamically found out serial ports plus file under its operation catalogue, then utilize the DisplayName interface to obtain the serial port protocol name, obtain the serial communication parameter by the GetCommPara interface, then utilize the SetCommPara interface that serial communication parameter on theindustrial computer 6 interior corresponding hardware devices is set.After communications setting is finished, call the StartModual interface and start corresponding communication event processing module on the communication plug 4, receive from the communication response event in the communication plug-in unit 4 by the InventorySocketReceHandle event interface at last, automatic analysis is included in strResponseName parameter and the strXmlData parameter in the communication data stream.Find out the data of transmitting in the current communication process according to the content of strResponseName parameter and belong to real-time device data or Real Time Monitoring data; According to the Data Analysis form that defines in the content of strXmlData parameter and the data acquisition Framework 5 data of the collection autobiography sensor 1 in the communication data stream are extracted.
Embodiment 2: when communication protocol is the CAN bus communication, data acquisition Framework 5 is dynamically found out CAN bus plus file under its operation catalogue, then utilize the DisplayName interface to obtain CAN bus protocol name, obtain CAN bus communication parameter by the GetCommPara interface, then utilize the SetCommPara interface that CAN bus communication parameter on theindustrial computer 6 interior corresponding hardware devices is set.After communications setting is finished, call the StartModual interface and start corresponding communication event processing module on the communication plug 4, receive from the communication response event in the communication plug-in unit 4 by the InventorySocketReceHandle event interface at last, automatic analysis is included in strResponseName parameter and the strXmlData parameter in the communication data stream.Find out the data of transmitting in the current communication process according to the content of strResponseName parameter and belong to real-time device data or Real Time Monitoring data; According to the Data Analysis form that defines in the content of strXmlData parameter and the data acquisition Framework 5 data of the collection autobiography sensor 1 in the communication data stream are extracted.
Embodiment 3: when communication protocol is ethernet communication, data acquisition Framework 5 is dynamically found out Ethernet plus file under its operation catalogue, then utilize the DisplayName interface to obtain the Ethernet protocol name, obtain the ethernet communication parameter by the GetCommPara interface, then utilize the SetCommPara interface that ethernet communication parameter on theindustrial computer 6 interior corresponding hardware devices is set.After communications setting is finished, call the StartModual interface and start corresponding communication event processing module on the communication plug 4, receive from the communication response event in the communication plug-in unit 4 by the InventorySocketReceHandle event interface at last, automatic analysis is included in strResponseName parameter and the strXmlData parameter in the communication data stream.Find out the data of transmitting in the current communication process according to the content of strResponseName parameter and belong to real-time device data or Real Time Monitoring data; According to the Data Analysis form that defines in the content of strXmlData parameter and the data acquisition Framework 5 data of the collection autobiography sensor 1 in the communication data stream are extracted.
The present invention adopts " rear binding " method, behind software translating, be in operation and carry out corresponding communication plug-in unit and call, the communication software plug-in unit can be developed after systemic software development is finished, and has improved the dynamically adapting ability of system, and collection has larger application reference to be worth for industrial data.
The present invention describes by accompanying drawing, without departing from the present invention, can also carry out various conversion and be equal to replacement patent of the present invention, therefore, patent of the present invention is not limited to disclosed specific implementation process, and should comprise the whole embodiments that fall in the Patent right requirement scope of the present invention.