OPC XML
Author: Marko Mattlio.
OPC XML research is based on OPC XML 0.31 draft version instructions.
1, OPC introduction
The OPC Found will define a set of OLE / COM-based interfaces to perform real-time automated data exchange in systems using COM, which is mainly suitable for using a Microsoft operating system-based client.
The purpose of defining the interface is to develop all the universal interfaces of all automation devices and communication systems, allowing them to communicate between MES, communicating between or between or with other systems.
Figure 1: Special interface and OPC
OPC has been divided into several independent working groups that focus on different areas: data access, alarms, and events, historical data access, security, batch, and XML.
In addition to safety and XML, all working groups have defined OPC interfaces in their respective fields. The Security Working Group is committed to the security of the OPC, while the XML Working Group tries to develop a flexible, coherent rules and format to express its production underlying data with XML, such as data access, alarm and event, which can also be from the OPC interface. Read the same data.
2, OPC XML manual
OPC XML will provide an OPC integration plan with e-commerce function. The OPC Foundation's Market Director and the US Department of Industrial Automation Marketing Manager said: "OPC XML is to achieve from control equipment, production underlying automation system to run through the entire manufacturing industry The key to manufacturing data sharing between information applications. "
2.1 background
The OPC Foundation has defined the following interfaces: Data Access Service, Event Service, Batch Service and Historical Data Services, which contain information useful to the company, currently available to enterprise applications based on OLE / COM-based interface.
XML, extended tag language, and XML-based mode language provide another method for describing structural information between the exchange collaborative application. XML This technology can be applied in one and more vast platforms, which is superior to OLE / COM. OPC-XML is the OPC Foundation to easily exchange production data in XML series technology.
2.2 foundation
Earlies of the OPC XML manual list a number of possible ways to transfer XML, such as SOAP, HTTP, BizTalk, Socket. The latest version focuses on SOAP 1.1 and its internal transmission methods, HTTP, and MSMQ.
OPC XML is set to a way: [Allows its structure to live in SOAP accommodation as a SOAP overall. Thus, the processing of the OPC XML error message is implemented by SOAP error elements and OPC error messages. SOAP error message Sends a whole success / fail message, while a single error is transmitted through an OPC error.
2.3 OPC XML interface
The OPC XML manual defines a set of pattern languages to mark these interfaces.
l Read: ReadRequest, ReadReply
L Write: WriteRequest, Writereply
l Subscribe: SubscriptionRequest, SubscriptionReply, SubscriptionCallback
l Cancel Subscription: SubscriptioncanceLrequest, SubscriptionCanceCalLreply
These interfaces are implemented by the following four exchange methods:
l Datarequest / DataReponse
l WriteRequest / Writeresponse
l Canceldatarequest / CanceldatareSponse
l BrowseRequest / Browseresponse
Since these languages are unpredictable, they have to be changed, so they are not explained in detail. 2.3.1 Data Request
The data request is to request OPC data, have two ways to synchronize (request - response) and asynchronous (subscription - update). It is implemented by reading requests and subscription requests.
2.3.2 Data Response
The data response is a response to the data request. If it is a synchronous request, then request once, answer once, if it is an asynchronous request, including the initial value and error code, after which the server sends an entry containing the value change.
2.3.3 Write request
Write requests are requests to write process control values to a specific entry. If the specific expiration time is exceeded, the server does not receive the request, then what can not write.
2.3.4 Write response
The write response is a response to the write request, which gives all errors existing from the write control value to a specific entry.
2.3.5 Cancel data request
The cancellation data request is to cancel a specific data request, if the data request is a subscription request, all subsequent data updates are canceled, and if the request is not a subscription, the request server releases the resource allocated to this request. The cancellation data request is implemented by subscriptioncancelrequest.
2.3.6 Cancellation Data Response
The cancellation data response is the response to the cancellation data request, which shows whether the cancel action is successful.
2.3.7 Browse Request
The browse request is the request to request a "branch" and "leaf" list of the specific location of the server address space, and the return information will display "real" existing the structure of the server address space. Or can provide a prompt. The content of the request should include the "Start Point" of the browsing, and the empty request is to browse "root" by default.
2.3.8 Browse Response
The browse response is the response to the browsing request, and the return value is "foliage" located at a specific location of the server address space.
2.4 OPC XML Service Realization
The OPC XML manual does not explain how to implement this service, but the Working Group is planning to implement this feature on the future WINDOW2000 platform.
3 SOAP
3.1 Introduction to SOAP
SOAP provides a simple lightweight protocol for information exchange using XML in a decentralized, distributed environment. SOAP itself does not define any application semantics, such as programming models or special semantics. It only defines a simple mechanism to show semantics, which is implemented by providing a modular package model. At the same time, SOAP defines a set of encoding mechanisms in the module data package. In this way, SOAP can be used from the information system to the RPC so different systems.
3.2 SOAP Message Structure
One SOAP package document has two parts: SOAP header and SOAP body part, SOAP header includes transmission information, this information is user-defined, its content depends on your application. SOAP body part includes actual data to be transmitted.
Figure 2: SOAP message structure
3.3 Simple SOAP Example
SOAP messages include HTTP requests.
POST / stockquote http / 1.1
Host: www.stockquoteserver.com
Content-type: text / xml; charSet = "UTF-8"
Content-Length: nnnn
SOAPACTION: "Some-Uri"
XMLns: soap-env = "http://schemas.xmlsoap.org/soap/envelop/" SOAPENV: EncodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"> Soap-env: body> Soap-env: envelope> The SOAP response includes an HTTP response. HTTP / 1.1 200 ok Content-type: text / xml; charSet = "UTF-8" Content-Length: nnnn XMLns: soap-env = "http://schemas.xmlsoap.org/soap/envelop/" SOAPENV: EncodingStyle = "http://schemas.xmlsoap.org/soap/encoding/" /> m: getLastTradePricResponse> Soap-env: body> Soap-env: envelope>